Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Order flow data

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

    Order flow data

    Quick question. I have a an indicator that uses order flow delta. My issue is that when I add it to the strategy. Declare private etc... Add to chart in the configure section..... the calculations are off by up to two bars at sometimes. When looking at the one on the chart as an indicator.. Vs the one added to the strategy and the executed. I looked at both on close and on tick. Is there a way to get the results closer...

    #2
    Hello richa61416,

    Thanks for your post.

    Are you using the Order Flow Cumulative Delta as documented where you are adding the Update() code in BarsInProgress == 1?

    With the above in mind, is s print for your added Order Flow Cumulative Delta indicator in the strategy match what is seen on the chart?



    We look forward to hearing from you.

    Comment


      #3
      Inside the indicator DeltaWickedTrendbid it is called from:

      else if (BarsInProgress == 1)
      {
      if (CurrentBar <30)
      return;
      cumulativeDelta.Update(cumulativeDelta.BarsArray[1].Count - 1, 1);

      }

      Then in the Strategy

      private DeltaWickedTrendbid DeltaWickedTrendbid1;
      …….

      else if (State == State.DataLoaded)
      {
      DeltaWickedTrendbid1= DeltaWickedTrendbid(Close);
      AddChartIndicator(DeltaWickedTrendbid1);
      }

      Should the strategy be set to on each tick when using OrderFlow data or it shouldn't matter?
      Attached Files

      Comment


        #4
        Hello richa61416,

        If Order Flow Cumulative Delta is calculating OnEachTick, you would want the host script calculating OnEachTick as well.

        I have attached an example demonstrating adding OFCD in an indicator, and adding that indicator in a strategy. When I print the output from the strategy running OnEachTick, also with OFCD on the chart calculating OnEachTick, my prints match.

        Attached Files

        Comment


          #5
          OK. thanks. I was assuming that the update for barinprogress==1 only had to be in the indicator. I will add it also the strategy and see if that bring me closer.

          Thanks.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by CarlTrading, 03-31-2026, 09:41 PM
          1 response
          45 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by CarlTrading, 04-01-2026, 02:41 AM
          0 responses
          21 views
          0 likes
          Last Post CarlTrading  
          Started by CaptainJack, 03-31-2026, 11:44 PM
          0 responses
          31 views
          1 like
          Last Post CaptainJack  
          Started by CarlTrading, 03-30-2026, 11:51 AM
          0 responses
          50 views
          0 likes
          Last Post CarlTrading  
          Started by CarlTrading, 03-30-2026, 11:48 AM
          0 responses
          42 views
          0 likes
          Last Post CarlTrading  
          Working...
          X