Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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.
    JimNinjaTrader Customer Service

    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
        JimNinjaTrader Customer Service

        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 junkone, Today, 11:37 AM
          0 responses
          6 views
          0 likes
          Last Post junkone
          by junkone
           
          Started by quantismo, 04-17-2024, 05:13 PM
          5 responses
          35 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by proptrade13, Today, 11:06 AM
          1 response
          6 views
          0 likes
          Last Post NinjaTrader_Clayton  
          Started by love2code2trade, 04-17-2024, 01:45 PM
          4 responses
          34 views
          0 likes
          Last Post love2code2trade  
          Started by cls71, Today, 04:45 AM
          2 responses
          10 views
          0 likes
          Last Post eDanny
          by eDanny
           
          Working...
          X