Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

OnBarOpen

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    OnBarOpen

    I've come across an issue with my back testing regarding the use of indicators and how they update historically using bar close data.

    Looking at the RSI for example, historical values are plotted using the value at the close of each bar. In real time, when I am trading live, if the RSI is at a particular point, say below 30 (oversold) at the open of the currently forming candle (which I can get using 'UpdateOnEachTick') then I want to use that as an entry for my strategy, rather than waiting until the bar closes and observing what the value is at that point in time.

    Essentially, what I want to do is change the RSI to plot historical figures using RSI values at the open of each candle rather than the close of each candle. This way my back testing would be accurate as it would mimic what I would be seeing in real time, rather than playing a guessing game as to what the RSI value would be at the open of each candle.

    I'm sure that this is achievable but I'm not so sure how I should approach this.

    #2
    Hello Sudonega,

    Thank you for the post.

    With a historical test there would not be a way to do that. Because it processes OnBarClose historically and IsFirstTickOfBar cannot be used there would not be a way to do something on the open of a bar. For backtesting you would generally need to use a secondary more granular series like 1 tick if you wanted to simulate OnEachTick processing. That also entails that the indicator being used can calculate using a 1 tick series and still reach the same result as it did using the primary.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    579 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    334 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    101 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    554 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    551 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X