Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Issue when using multiple data series in a strategy builder

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

    Issue when using multiple data series in a strategy builder

    Hi, i want to know if both ema[0], ema[1] on both es and nq are trending upward so that i can enter a trade on /nq chart.(that means i run the strategy on /nq chart but check if both /es & /nq are meeting the condition i specified)

    I wrote the code for it and testing using playback connection on /NQ 06-25.

    I am printing the values to see if the conditions are being met.

    on the close of the candle, es[0] is printing the es[1] ema value & es[1] is printing the es[2] ema value. Where as /nq ema's are printing for the right candles.
    Why is this happening?


    Sharing some screenshots:

    This is one of my set in the strategy:​ ( when NQ ema-8[0] - 0.2 is greather than or equal to NQ ema-8[1], then print 1st condition satisfied, also print ES ema-8[0], ES ema-8[1] AND print NQ ema-8[0], NQ ema-8[1]



    Click image for larger version

Name:	image.png
Views:	63
Size:	23.1 KB
ID:	1338416


    At close of 9:30 candle, 1st condition got executed, that means : NQ ema-8[0] - 0.2 is greater than or equal to NQ ema-8[1]. Which is good but when i printed the ES values, they are printing for EMA8[1] and EMA8[2]. I am not sure why this is happening.


    Click image for larger version

Name:	image.png
Views:	37
Size:	8.7 KB
ID:	1338417
    Below data boxes will show the ema value of es 06-25 at 9:30, 9:29, 9:28 ( last row in each data box).

    Click image for larger version

Name:	image.png
Views:	36
Size:	19.3 KB
ID:	1338418

    ​​​​​​​Click image for larger version

Name:	image.png
Views:	35
Size:	19.1 KB
ID:	1338419
    ​​​​​​​Click image for larger version

Name:	image.png
Views:	36
Size:	19.6 KB
ID:	1338420​​



    ​​

    #2
    Hello psangram,

    I believe you are just hitting the order of bar processing here. The EMA is a secondary series so you are getting the last closed bar price from the ES when the NQ bar closes. In realtime that could differ further because those are two unique instruments which will have different incoming data, the bars could close at different times depending on the volume of trades in each market.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Really?
      This is very interesting.
      if I run on a 1 min time frame, I thought all the instruments would close exactly at the 1 min.

      if what you said is true, how can I handle my situation then?

      how can I use multiple instruments in my strategy and design what I intended to?​

      Comment


        #4
        Hello psangram,

        The bars will show a close at specific time intervals but those are two different markets so in realtime they will have unique events. Only in historical processing will you see an exact sequence of event processing.

        From what I can tell you are already using the indicators how you want to. When the primary bar closes you are calculating the EMA for each series, whatever the last closed data was for that series would be used.
        JesseNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by raysinred, Yesterday, 10:32 AM
        1 response
        15 views
        0 likes
        Last Post rockmanx00  
        Started by cbadr, Yesterday, 08:19 PM
        0 responses
        4 views
        0 likes
        Last Post cbadr
        by cbadr
         
        Started by DayTradingDEMON, Yesterday, 07:23 PM
        0 responses
        7 views
        0 likes
        Last Post DayTradingDEMON  
        Started by XXfea, Yesterday, 07:01 PM
        0 responses
        9 views
        0 likes
        Last Post XXfea
        by XXfea
         
        Started by RedPothos, Yesterday, 05:07 PM
        0 responses
        12 views
        0 likes
        Last Post RedPothos  
        Working...
        X