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 Jon17, Today, 04:33 PM
          0 responses
          1 view
          0 likes
          Last Post Jon17
          by Jon17
           
          Started by Javierw.ok, Today, 04:12 PM
          0 responses
          4 views
          0 likes
          Last Post Javierw.ok  
          Started by timmbbo, Today, 08:59 AM
          2 responses
          10 views
          0 likes
          Last Post bltdavid  
          Started by alifarahani, Today, 09:40 AM
          6 responses
          41 views
          0 likes
          Last Post alifarahani  
          Started by Waxavi, Today, 02:10 AM
          1 response
          20 views
          0 likes
          Last Post NinjaTrader_LuisH  
          Working...
          X