NexusFi: Find Your Edge


Home Menu

 





negative bars


Discussion in ThinkOrSwim

Updated
    1. trending_up 1,195 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?
Strike Pause Holds, Oil Erases Monday Spike -- May CPI W …
Traders Hideout
CME Group Fee Schedule Changes Hit All Four Exchanges -- …
Traders Hideout
Iran Ceasefire Surges to 19.5% on US 15-Point Plan -- 82 …
Prediction Markets & Event Contracts
Fabrication or Framework? Irans Denied MOU Explains the …
Prediction Markets & Event Contracts
TradingView Deploys AI to Monitor SEC Filings in Real Ti …
TradingView
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Big Mike in Ecuador
205 thanks
Sober Journey With S&P
21 thanks
30 Sessions
20 thanks
Volume Indicators
8 thanks
Thanks Mike. Godspeed.
7 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