Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

DOW EMA200 @ YM minute chart

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

    DOW EMA200 @ YM minute chart

    My strategy needs ( amongst other things ) the ema 200 from the DOW Index 1 h data serie at a 1 minute YM Future chart.

    So i ad :

    AddDataSeries("^DJIA", BarsPeriodType.Minute, 60);

    .....

    ema60min200dow = EMA(Closes[1],200)[0];

    That works, but for 200 hours dow i need about 4 weeks back data for getting the correct ema200 .

    This first 4 weeks i can't start the strategy algo so i just wait 200 dow bars...

    barsdow = CurrentBars[1];
    if (barsdow < 200) return;


    But i can`t stop ploting the chart and some other ym 1 min chart indicators.
    So the first 4 weeks the strategy Analyser plots Tausends of 1 Minute YM bars and Tausends other YM 1 min indicators values for no reason. This makes the strategy Analyser very slow...

    So, how can i get this Dow 60 min EMA 200 without ploting about 400 h of 1 min ym chart in the Strategy ?
    Last edited by jr123; 04-08-2018, 01:06 PM.

    #2
    Hello jr123,

    The AddDataSeries() method allows for a barsToLoad overload parameter.

    AddDataSeries(string instrumentName, BarsPeriod barsPeriod, int barsToLoad, string tradingHoursName, bool? isResetOnNewTradingDay)

    Below is a public link to the help guide.


    Or you would need to use a BarsRequest and do all calculations custom.

    Below is a public link to the help guide.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_ChelseaB View Post
      Hello jr123,

      The AddDataSeries() method allows for a barsToLoad overload parameter.

      AddDataSeries(string instrumentName, BarsPeriod barsPeriod, int barsToLoad, string tradingHoursName, bool? isResetOnNewTradingDay)

      ....[/url]
      Thank you very much.
      This seems working.


      But there is a small difference beetween the result.
      The DJIA Chart with 60 min (200 Days back ) shows EMA200
      on the END of 04/05/2018 : 24502


      AddDataSeries("^DJIA", new BarsPeriod {BarsPeriodType = BarsPeriodType.Minute, Value = 60},1400,"US Equities RTH",false);

      if (BarsInProgress == 1 )
      {
      ema60min200dow = EMA(Closes[1],200)[0];
      Print(Time[0] + " ema60min200dow " + ema60min200dow );
      }

      this code shows at the same time :
      05.04.2018 22:00:00 ema60min200dow 24508,3080877318

      Why this (small) difference ?

      Comment


        #4
        Hello jr123,

        I'm still testing this but on my end I'm not getting correct bar times with AddDataSeries().

        In the script, bars are ending on the hour and not the half hour which would not match the trading hours template applied. I should be seeing bar closes every half hour.

        Once I have more information I will update this thread.

        I appreciate your patience.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_ChelseaB View Post
          Hello jr123,

          I'm still testing this but on my end I'm not getting correct bar times with AddDataSeries().

          In the script, bars are ending on the hour and not the half hour which would not match the trading hours template applied. I should be seeing bar closes every half hour.

          Once I have more information I will update this thread.

          I appreciate your patience.
          OK, this seems the reason.

          With 30 min chart DJIA and ema400 the chart EMA is
          identical to the script EMA 400. So for now i will use ema400 / 30 min.
          Seems the same as 60min / ema200 .

          Comment


            #6
            Hello jr123,

            The issue is with the IsResetOnNewTradingDay bool.

            You have this set to false which means it will not create a new bar on the new session.

            You can have your chart match this by disabling Break EOD in the data series section of the chart.

            (Or you can set this to true in the AddDataSeries() call)
            Chelsea B.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by NullPointStrategies, Yesterday, 05:17 AM
            0 responses
            54 views
            0 likes
            Last Post NullPointStrategies  
            Started by argusthome, 03-08-2026, 10:06 AM
            0 responses
            130 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            72 views
            0 likes
            Last Post NabilKhattabi  
            Started by Deep42, 03-06-2026, 12:28 AM
            0 responses
            44 views
            0 likes
            Last Post Deep42
            by Deep42
             
            Started by TheRealMorford, 03-05-2026, 06:15 PM
            0 responses
            49 views
            0 likes
            Last Post TheRealMorford  
            Working...
            X