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 Mindset, 04-21-2026, 06:46 AM
    0 responses
    57 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    78 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    39 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    101 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    61 views
    0 likes
    Last Post PaulMohn  
    Working...
    X