Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

is it possible to set tick reply for second timeframe in strategy

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

    is it possible to set tick reply for second timeframe in strategy

    Hi i am trying to make a strategy that consist of two different timeframe(2000 ticks and 1 ticks) where the strategy mainly use 2000 ticks and the 1 ticks chart is for the action of each 2000 tick bar. When I open the ES920 chart, I have set the chart to tick replay. I have noticed that the data that I receive from the 1 ticks chart does not match with the data on the 2000 ticks chart. For example, within each 2000 ticks bar, there are 2000 of the (1 tick) bars. I have set some variables and logic so that when the 1 tick bar is larger than the High_variable, it will be set as the High_variable, same thing goes for the Low_variable. After the 2000 of the (1 tick) bars have ran, I have notice that the 2000 tick bar High and Low sometimes different than the High_variable and the Low_Variable, maybe 1/7 of the data are different. I have checked multiple times of my code and I'm sure it's correct. I was wondering would it be because the 1 tick chart isn't tick reply? so that the data is not as accurate as tick reply. I was wondering would there be any other way to access the inner bar action if it's possible.

    Here's what it has Print
    -------------------------------------------------
    Highs 1 tick bar = 3102.5
    High 2000 tick bar = 3102
    Lows 1 tick bar = 3102.5
    Lows 2000 tick bar = 3099.75
    -------------------------------------------------
    Highs 1 tick bar = 3105.5
    High 2000 tick bar = 3098.75
    Lows 1 tick bar = 3103.25
    Lows 2000 tick bar = 3097.25
    -------------------------------------------------
    Highs 1 tick bar = 3099.25
    High 2000 tick bar = 3099.25
    Lows 1 tick bar = 3097.5
    Lows 2000 tick bar = 3097.5
    -------------------------------------------------
    Highs 1 tick bar = 3100.25
    High 2000 tick bar = 3100.25
    Lows 1 tick bar = 3097.25
    Lows 2000 tick bar = 3097.25
    -------------------------------------------------
    Highs 1 tick bar = 3100.5
    High 2000 tick bar = 3100.5
    Lows 1 tick bar = 3097.75
    Lows 2000 tick bar = 3097.75
    -------------------------------------------------
    Highs 1 tick bar = 3099.25
    High 2000 tick bar = 3099.25
    Lows 1 tick bar = 3096.75
    Lows 2000 tick bar = 3096.75
    -------------------------------------------------
    Highs 1 tick bar = 3100
    High 2000 tick bar = 3100
    Lows 1 tick bar = 3096.75
    Lows 2000 tick bar = 3096.75
    -------------------------------------------------
    Highs 1 tick bar = 3099.75
    High 2000 tick bar = 3099.75
    Lows 1 tick bar = 3097.25
    Lows 2000 tick bar = 3097.25
    -------------------------------------------------
    Highs 1 tick bar = 3101.5
    High 2000 tick bar = 3103
    Lows 1 tick bar = 3098.25
    Lows 2000 tick bar = 3101
    -------------------------------------------------

    Code from the 1 tick OnBarUpdate:

    if(lastCurrentBar != CurrentBars[0]){ //only runs a new 2000 ticks bar bhas formed
    Print("-------------------------------------------------");
    Print("Highs 1 tick bar = " + BarHigh);
    Print("High 2000 tick bar = " + Highs[0][0]);
    Print("Lows 1 tick bar = " + BarLow);
    Print("Lows 2000 tick bar = " + Lows[0][0]);

    BarHigh = Closes[1][0];
    BarLow = Closes[1][0]; //Reset BarHigh and BarLow
    }
    BarClose = Closes[1][0];
    if(Closes[1][0]>=BarHigh){BarHigh = Closes[1][0];} //Set BarHigh and BarLow when new Low and High is beat
    if(Closes[1][0]<=BarLow){BarLow = Closes[1][0];}
    lastCurrentBar = CurrentBars[0];

    #2
    Hello horace chow,

    TickReplay causes OnBarUpdate to run historically for Calculate.OnPriceChange or .OnEachTick. This will be using historical tick data.

    While the bar is updating with .OnPriceChange or .OnEachTick the values of the bar may be different than when the bar is fully closed.

    If you are wanting the individual tick information, you would need to add a 1 tick series with AddDataSeries().
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      I understand that if I want the individual tick information, It would need to add a 1 tick series. I have already added the 1 tick series, but the only problem is that I'm not sure would it be because the 1 tick series isn't in tick reply. But occasionally, the data that is giving in each individual tick does not match the data in the 2000 ticks chart. Please refer to my first comment, I have set up some Print statement and printing out the highs and lows of each bar in the 2000 ticks chart and the highs and lows that were found using individual ticks(1 tick series), Occasionally, the highs and lows of the 2000 ticks chart does not match the highs and lows that was found in the individual(1 ticks) tick series.

      Comment


        #4
        Hello horace chow,

        I'm not understanding, are you saying with TickReplay that the bar's open, high, low, and close is changing?

        TickReplay causes the bar update. Meaning the bar may have a new high, low, close, or volume, just like if the bar was updating in real-time with Calculate set to OnPriceChange or OnEachTick.

        Are you saying that while a bar is open, a tick from the 1 tick series added with AddDataSeries is above the high of the primary bar or below the low of the primary bar?
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        597 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        343 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        103 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        556 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        555 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X