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

ATR like TOS ATR

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

    ATR like TOS ATR

    Having migrated to Ninjatrader from TOS I am having a discrepancy in data when I compare the ATR.

    In TOS I am using ATR(5 day, simple). Investigating it seems that the OHLC values I get in TOS are different than the ones in Ninja.

    This is for /ES. Issue looks to be related to session template.
    In the indicator I also want the session Open and Close values.

    I can not see how to reference two different session templates from within an indicator/strategy.

    Alternatively I can program a new ATR indicator, but I need to extract the overnight High and Low for use in the ATR calc paired with the Session Close.

    When I use

    if ( (Bars.BarsSinceSession == 0 ) && (Time[0].ToString("ddd") != "Sun" ) )
    {
    Print("");
    Print(Time[0] + " " + Time[0].ToString("ddd"));
    Print("Open: " + Open[0]);
    Print("PrvDayClose: " + Bars.GetDayBar(1).Close);
    Print("PrvDayHigh: " + Bars.GetDayBar(1).High);
    Print("PrvDayLow: " + Bars.GetDayBar(1).Low);
    }

    I am able to capture the Session Open, and PrvDayClose correctly with the code above.
    The Prv Day High and Low though are the regular session High and Low and I want the overnight H/L if they are larger/smaller respectively.

    I tried Add("ES 09-16", PeriodType.Day, 1); // Add Day Bars for ATR calc
    But ATR on this also does not match TOS. Can I pass a 24h session template to the alternate time period?

    Any thoughts or suggestions?

    #2
    Hello EricC64,

    Thanks for your post and welcome to the forums!

    What datafeed are you connected to NinjaTrader7 with?
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Data Feed

      I am testing using the Sim101 account and the NinjaTrader live feed. We have the Continuum Data feed I think.

      For Example in TOS I see the following ATRs over last couple of days
      Date TOS Ninja
      8/23 11.95 10.6 (Candle shows 8/24 and 8/23 candle missing. I see an 8/25 candle
      8/22 11.70 10.81
      8/19 11.55 11.02

      Chart looks to be using the 24/7 default session.
      Strategy is using US Index Emini Futures RTH/ETH

      Comment


        #4
        Hello EricC64,

        Thanks for your reply.

        In the case of the NinjaTrader continuum data feed, in Ninjatrader7, a daily bar is preconfigured as RTH and session templates cannot change that.

        A work around would be to replace the daily bar with a 1440 minute bar which will then be effected by the session template.
        Paul H.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by junkone, Today, 11:37 AM
        1 response
        9 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by frankthearm, Yesterday, 09:08 AM
        11 responses
        41 views
        0 likes
        Last Post frankthearm  
        Started by quantismo, 04-17-2024, 05:13 PM
        5 responses
        35 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by proptrade13, Today, 11:06 AM
        1 response
        6 views
        0 likes
        Last Post NinjaTrader_Clayton  
        Started by love2code2trade, 04-17-2024, 01:45 PM
        4 responses
        35 views
        0 likes
        Last Post love2code2trade  
        Working...
        X