• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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.
    https://ninjatrader.com/support/help...dataseries.htm

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

    Below is a public link to the help guide.
    https://ninjatrader.com/support/help...arsrequest.htm
    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 guvenators, Today, 05:18 PM
            1 response
            13 views
            0 likes
            Last Post NinjaTrader_ShawnB  
            Started by LANwarr1or, Today, 03:00 PM
            2 responses
            8 views
            0 likes
            Last Post LANwarr1or  
            Started by Newtrader101, Today, 02:53 PM
            2 responses
            10 views
            0 likes
            Last Post Newtrader101  
            Started by JuanPabloQuevedo, Today, 02:53 PM
            2 responses
            9 views
            0 likes
            Last Post JuanPabloQuevedo  
            Started by samir, Today, 03:16 PM
            2 responses
            14 views
            0 likes
            Last Post samir
            by samir
             
            Working...
            X