Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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.

    JesseNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by alexstox, 10-16-2018, 03:29 PM
    11 responses
    343 views
    0 likes
    Last Post aligator  
    Started by ageeholdings, 05-01-2024, 05:22 AM
    6 responses
    44 views
    0 likes
    Last Post ageeholdings  
    Started by tony_28217, Today, 07:04 PM
    0 responses
    11 views
    0 likes
    Last Post tony_28217  
    Started by flybuzz, Today, 10:33 AM
    1 response
    9 views
    0 likes
    Last Post flybuzz
    by flybuzz
     
    Started by spencerp92, 10-10-2023, 09:56 AM
    4 responses
    312 views
    0 likes
    Last Post flybuzz
    by flybuzz
     
    Working...
    X