Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Add("DX 12-10", PeriodType.Minute, 3);

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

    Add("DX 12-10", PeriodType.Minute, 3);

    This was on 7.0.0.23 vista 32 bit.

    I'm missing something or not understanding something or NT is incorrect.

    If I am looking at a 3 minute chart with DX 12-10 and I'm making a strategy, and adding Add("DX 12-10", PeriodType.Minute, 3);...

    I'm using print statements, and print out an EMA & SMA.. These match up with the chart 1 for 1.

    But when I add to my DX 12-10 3 minute strategy,

    Add("^VIX", PeriodType.Minute, 3);
    Add("ES 12-10", PeriodType.Minute, 3);
    Add("DX 12-10", PeriodType.Minute, 3);

    And when I print out BarsArray[3] for my EMA and SMA, they NO LONGER match from 9:30 - 9:46.. they run higher.

    I haven't tested looked at major results down the line, but it has appeared that mid-morning to afternoon eventually converges and will match the chart.

    This is showing up on market replay from a random day in the first week of December, and showing up for 12/6.

    I've downloaded 7.0.1000.1 tonight. I'm going to run my same test tomorrow night.


    So, I think NT is incorrect for some reason..or I'm not understanding what is going on.

    If this sounds familiar, where do I need to look?

    I just think it is odd that DX12-10 and DX12-10 barsarray[1] is the same, but when i make DX12-10 barsarry[3], it's OFF and not the same.

    If the test fails tomorrow night, I can post code and can try to write down to exactly what I'm looking at in market replay on DX 12-10.

    #2
    sledge, thanks for the post - that should not be the case - please let us know how you're testing on R1 goes. In addition I would suggest to just print the timestamps and CurrentBars of each series involved to get a good insight into the sequence of events.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Bertrand View Post
      sledge, thanks for the post - that should not be the case - please let us know how you're testing on R1 goes. In addition I would suggest to just print the timestamps and CurrentBars of each series involved to get a good insight into the sequence of events.

      This is very strange. I added the time to view for each data series.

      On a DX12-10 chart, with strategy with data series:

      Add("^VIX", PeriodType.Minute, 3);
      Add("ES 12-10", PeriodType.Minute, 3);
      Add("DX 12-10", PeriodType.Minute, 3);

      MarketReplay does not fire my strategy until 9:30 am. Market replay is at 9:30:00 am, and I'm getting data:

      BarsInProgess =2
      Time[0]-12/7/2010 9:33:00 AMES 12-10 Close [ES][0]= 1234.5
      Time[2]-12/6/2010 3:57:00 PMES 12-10 Closes[2 ][0]= 1234.5
      Time[3]-12/6/2010 3:54:00 PMDX 12-10 Closes[3 ][0]= 79.645



      Now, market replay to 9:44:57 am

      BarsInProgess =2
      Time[0]-12/7/2010 9:45:00 AMES 12-10 Close [ES][0]= 1234
      Time[2]-12/7/2010 9:39:00 AMES 12-10 Closes[2 ][0]= 1234
      Time[3]-12/7/2010 9:36:00 AMDX 12-10 Closes[3 ][0]= 79.31

      (EMA/SMA not shown. they are off, getting closer. but DX 12-10 value is correct.)


      Fast forward to 10:10:25 am.

      BarsInProgess =2
      Time[0]-12/7/2010 10:12:00 AMES 12-10 Close [ES][0]= 1229.5
      Time[2]-12/7/2010 10:06:00 AMES 12-10 Closes[2 ][0]= 1229.5
      Time[3]-12/7/2010 10:03:00 AMDX 12-10 Closes[3 ][0]= 79.55

      (EMA/SMA not shown. they are finally matching the chart. DX 12-10 value is correct.)
      (note, I believe I don't have a problem with ES values

      ----

      Now the BIG thing that I've noticed, if I move ^VIX to the last spot with the same setup on DX 12-10 chart,
      market replay fires BEFORE 9:30 am, and DX12-10 is correct for EMA's/SMA's.


      Add("ES 12-10", PeriodType.Minute, 3);
      Add("DX 12-10", PeriodType.Minute, 3);
      Add("^VIX", PeriodType.Minute, 3);


      Problems solved!!!!


      I'm not sure what effect the first data series has on the chart, but it appears to be significant.

      I thought the chart data series would be the driver, and anything else added would be secondary.

      Maybe it is because ^VIX is 9:30 to 4:30 ?


      Note: applying the same printout strategy on an ES12-10 show similar problem. market replay doesn't start until 9:30 am if ^VIX is first
      (funny dates show up for BarsArray, etc).

      Everything looks ok if ^VIX is last.



      So does this remind anyone of anything? Did I miss something that said the first additional data series should match your chart?

      Comment


        #4
        sledge, the primary chart series would be the 'driver' in terms of the sessions definitions used, as they would apply to all series added programmatically (you can check which template is used if your right click on the chart and go to the DataSeries dialog window). To see what the instrument default settings would be please go to the Instrument Manager and then check the default template used for each master instrument you're working with. If you can attach the print strategy you used here I can give it a run on my end as well for you.
        BertrandNinjaTrader Customer Service

        Comment


          #5
          when ^VIX first on ES or DX chart, market replay doesn't start until 9:30am, (nothing printed in output window). B C and ema/sma are off from what is actual on chart.

          when ES or DX first on ES or DX chart and ^VIX last, market replay works all the time.and prints and appears to be correct.

          note: when moving the slider, you get all that pre calculation which might or might not be correct. I usually slide forward to around 9:10am where ever it stops, and then use the 100x to speed up to 9:30 and hit pause to see what is happening, etc.



          protected override void Initialize()
          {
          CalculateOnBarClose = false;

          Add("^VIX", PeriodType.Minute, 3);
          Add("ES 12-10", PeriodType.Minute, 3);
          //Add("ES 12-10", PeriodType.Minute, 3);
          Add("DX 12-10", PeriodType.Minute, 3);
          //Add("DX 12-10", PeriodType.Minute, 3);
          Add("DX 12-10", PeriodType.Minute, 3);
          Add("^VIX", PeriodType.Minute, 3);

          }


          protected override void OnBarUpdate()
          {


          /*


          Print ( "BarsInProgess =" + BarsInProgress );



          Print ( "A " + (Time[0]) + " Close [ES][0]= " + Close[0] +
          " EMA (6)[0] =" + Math.Round (EMA(6)[0],2) +
          " SMA (14)[0] =" + Math.Round (SMA(14)[0],2) );


          Print ( "B " + (Time[2]) + " Closes[2 ][0]= " + Closes[2][0] +
          " EMA(BarsArray[2],6) [0]=" + Math.Round (EMA(BarsArray[2],6) [0],2) +
          " SMA(BarsArray[2],14)[0]=" + Math.Round (SMA(BarsArray[2],14)[0],2) );

          Print ( "C " + (Time[3]) + " Closes[3 ][0]= " + Closes[3][0] +
          " EMA(BarsArray[3],6) [0]=" + Math.Round (EMA(BarsArray[3],6) [0],2) +
          " SMA(BarsArray[3],14)[0]=" + Math.Round (SMA(BarsArray[3],14)[0],2) );

          }

          Comment


            #6
            In a MultiSeries environment please use Times instead of Time to point to the correct series for your timestamp checks - in addition you likely get confused by seeing the prints for each BIP call (as you do not filter them), try this changed version for example :

            Code:
            if (BarsInProgress == 0)
            	Print ( "A " + (Time[0]) + " Close [ES][0]= " + Close[0] + " EMA (6)[0] =" + Math.Round (EMA(6)[0],2) + " SMA (14)[0] =" + Math.Round (SMA(14)[0],2) ); 
            
            if (BarsInProgress == 2)
            	Print ( "B " + (Times[2][0]) + " Closes[2][0]= " + Closes[2][0] + " EMA(BarsArray[2],6) [0]=" + Math.Round (EMA(BarsArray[2],6) [0],2) + " SMA(BarsArray[2],14)[0]=" + Math.Round (SMA(BarsArray[2],14)[0],2) ); 
            
            if (BarsInProgress == 3)
            	Print ( "C " + (Times[3][0]) + " Closes[3][0]= " + Closes[3][0] + " EMA(BarsArray[3],6) [0]=" + Math.Round (EMA(BarsArray[3],6) [0],2) + " SMA(BarsArray[3],14)[0]=" + Math.Round (SMA(BarsArray[3],14)[0],2) );
            Please also note that you add 5 series to work in total with 6, primary one would be 0, so the 6th series would carry a BarsArray / BIP index of 5.
            BertrandNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Board game geek, 11-02-2023, 04:05 AM
            3 responses
            944 views
            0 likes
            Last Post HTubman
            by HTubman
             
            Started by kaseipds, Today, 06:26 PM
            3 responses
            9 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Started by earlthebest, Today, 06:19 PM
            0 responses
            9 views
            0 likes
            Last Post earlthebest  
            Started by gttrading1, Today, 05:01 PM
            1 response
            14 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Started by Skifree, Today, 06:12 PM
            0 responses
            9 views
            0 likes
            Last Post Skifree
            by Skifree
             
            Working...
            X