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?
Ceasefire Collapse: Iran Fires 24 Missiles, Israel Hits …
Traders Hideout
June 15 Peace Odds Surge From 3.6% to 12.25% After Trump …
Prediction Markets & Event Contracts
Six Days to Kickoff: World Cup Prediction Markets Hit $1 …
Prediction Markets & Event Contracts
April 2026 Jobs Report: +115k vs +65k Expected
Traders Hideout
UMA Votes Tonight: Polymarkets $80M Strategy Bitcoin Bat …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
NexusFi site changelog and issues/problem reporting
15 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