NexusFi: Find Your Edge


Home Menu

 





negative bars


Discussion in ThinkOrSwim

Updated
    1. trending_up 1,260 views
    2. thumb_up 2 thanks given
    3. group 1 followers
    1. forum 2 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
 shantzzz 
pittsburgh, pa
 
Experience: Intermediate
Platform: sierra, ToS
Trading: /es
Posts: 4 since Nov 2019
Thanks Given: 2
Thanks Received: 1

Hi, newbie question here.

I know that you can have thinkscript look at bars with a negative number, for example

def a = study<study[-1]

but how does this work exactly? Isn't this looking into the future?


Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Iran Lebanon Problem Kills Switzerland Talks, Brent at $ …
Prediction Markets & Event Contracts
Kalshi Sets $4.13B All-Time Weekly Record as Polymarket …
Prediction Markets & Event Contracts
El Clasico Draws $9.2M in Prediction Market Action -- Bi …
Prediction Markets & Event Contracts
Iran Peace Expired NO: Ceasefire on Life Support, OPEC a …
Prediction Markets & Event Contracts
April Jobs Beat Flips Fed Hike Odds Past 52% for First T …
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
NexusFi site changelog and issues/problem reporting
13 thanks
Darmok and Jalad at Tanagra
3 thanks
Big Mike in Ecuador
1 thanks
30 Sessions
1 thanks
  #2 (permalink)
 
Massive l's Avatar
 Massive l 
OR/USA
Legendary /NQ Trader
 
Experience: None
Posts: 2,129 since Mar 2011
Thanks Given: 1,859
Thanks Received: 5,108


shantzzz View Post
Hi, newbie question here.

I know that you can have thinkscript look at bars with a negative number, for example

def a = study<study[-1]

but how does this work exactly? Isn't this looking into the future?

When programming strategies you may want to have your entry triggered on the close of the next (future) bar. However, when backtesting, it's not really a future bar because it's already in the past. It's just the next bar after your conditions for entry have been met.


Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #3 (permalink)
 shantzzz 
pittsburgh, pa
 
Experience: Intermediate
Platform: sierra, ToS
Trading: /es
Posts: 4 since Nov 2019
Thanks Given: 2
Thanks Received: 1


Well explained, thank you


Started this thread Reply With Quote
Thanked by:




Last Updated on November 2, 2019


© 2026 NexusFi®, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Downloads - Top
no new posts