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 Cumulative Delta

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

    Order Flow Cumulative Delta

    Hi,
    Thanks for this wonderful indicator!

    Is there a way I can get an average size/length of the UP delta bars and separately the DOWN delta bars?

    alternatively, is it something I can suggest as an additional feature for this indicator.

    Many Thanks,

    #2
    You can set the Order Flow Cumulative Delta indicator to 'period = bar' which would then show the calculation for each bar instead of for a session. To do so, follow these steps:
    • Right-click on your chart > Indicators
    • Select the Cumulative Delta indicator from the 'Configured' list
    • Change 'Session' to 'Bars' > OK
    Is this what you're looking for? If not, could you elaborate further on exactly what you desire?

    Comment


      #3
      Originally posted by NinjaTrader_PatrickG View Post
      You can set the Order Flow Cumulative Delta indicator to 'period = bar' which would then show the calculation for each bar instead of for a session. To do so, follow these steps:
      • Right-click on your chart > Indicators
      • Select the Cumulative Delta indicator from the 'Configured' list
      • Change 'Session' to 'Bars' > OK
      Is this what you're looking for? If not, could you elaborate further on exactly what you desire?
      Thanks for your response Patrick.

      I am actually looking for an AVERAGE over the session of each bar(to be accessed programatically). Hope the screenshot below makes my request clearer Click image for larger version

Name:	SharedScreenshot.jpg
Views:	1461
Size:	38.3 KB
ID:	1049894

      -----
      // Print the close of the cumulative delta bar with a delta type of Bid Ask and with a Session period
      Print("Delta Close: "+OrderFlowCumulativeDelta(BarsArray[0],CumulativeDeltaType.BidAsk,CumulativeDeltaPeriod.Session,0).DeltaClose[0]);
      }
      ----
      The above sample code snippet from help guides provides the close value, I am looking for a average over the session, for the UP bars and the DOWN bars.

      Thanks

      Comment


        #4
        Hello SuperDriveGuy,

        Thanks for your reply.

        Yes, you could create a custom script where you basically check to see if the bar is an up or down bar, accumulate the delta based on the up or down bar and divide the accumulated (for each side) by the number of up bars and down bars for the average.

        If you would like this created for you, we can provide references to 3rd party coders, please let us know.

        If you would like us to create a feature request for Average of the upbar delta and Average of the down bar delta, in value or plot form, please let us know.

        Paul H.NinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_PaulH View Post
          Hello SuperDriveGuy,

          Thanks for your reply.

          Yes, you could create a custom script where you basically check to see if the bar is an up or down bar, accumulate the delta based on the up or down bar and divide the accumulated (for each side) by the number of up bars and down bars for the average.

          If you would like this created for you, we can provide references to 3rd party coders, please let us know.

          If you would like us to create a feature request for Average of the upbar delta and Average of the down bar delta, in value or plot form, please let us know.
          Hi Paul,
          Thanks for the advice, I have managed to create something very basic, probably not very efficient programming, as a workaround, it will do for me now.
          I think it would be useful to the see the AVERAGES plotted as a lines AND also to be able to access them programatically. Please submit this as feature request.
          Thanks

          Comment


            #6
            Hello SuperDriveGuy,

            Thanks for your reply.

            I will submit a feature request and will update this thread when I have further information.
            Paul H.NinjaTrader Customer Service

            Comment


              #7
              Originally posted by NinjaTrader_PaulH View Post
              Hello SuperDriveGuy,

              Thanks for your reply.

              I will submit a feature request and will update this thread when I have further information.
              Hi Patrick,

              I am using a List

              -------------
              private List<double> upDeltaLength = new List<double>(100);
              private List<double> downDeltaLength = new List<double>(100);
              OFCDeltaBar = OrderFlowCumulativeDelta(OFCDeltaType,OFCDeltaPeri odBar,0);
              ------------


              ---------------
              deltaLength=OFCDeltaBar.DeltaClose[0];
              if (deltaLength > 0)
              {
              upDeltaLength.Add(deltaLength);
              }
              else if(deltaLength < 0)
              {
              downDeltaLength.Add(deltaLength);
              }
              Print("Average of UP Delta Bars="+upDeltaLength.Average());
              Print("Average of DOWN Delta Bars="+downDeltaLength.Average());
              ---------------

              The issue with this is it does not reset after every session... If I do a List.Clear(), I get an error as sometimes the list has no value when I am accessing it... Is there a cleaner way to do this? maybe using DataSeries? But I can't find the AVERAGE method for it? Any tips will be much appreciated.

              Thanks

              Comment


                #8
                Hello SuperDriveGuy,

                Thanks for your post.

                Another approach may be to use double variables to hold the up accumulation, the down accumulation and keep a count of up, a count of down, and simply divide the up accumulation by the up count, divide the down accumulation by the down count and then reset all upon a new session.

                Paul H.NinjaTrader Customer Service

                Comment


                  #9
                  Hello SuperDriveGuy,

                  Just to follow-up.

                  The feature request is assigned as SFT-3865, "OF+ Cumulative Delta expose/plot Up Bar average and Down Bar average."

                  Please note that a feature request may or may not be implemented. If implemented it would be noted in the release notes of the NT8 version it was first released in. For your reference, here is a link to the release notes in the help guide: https://ninjatrader.com/support/help...ease_notes.htm
                  Paul H.NinjaTrader Customer Service

                  Comment


                    #10
                    Originally posted by SuperDriveGuy View Post

                    Thanks for your response Patrick.

                    I am actually looking for an AVERAGE over the session of each bar(to be accessed programatically). Hope the screenshot below makes my request clearer Click image for larger version

Name:	SharedScreenshot.jpg
Views:	1461
Size:	38.3 KB
ID:	1049894

                    -----
                    // Print the close of the cumulative delta bar with a delta type of Bid Ask and with a Session period
                    Print("Delta Close: "+OrderFlowCumulativeDelta(BarsArray[0],CumulativeDeltaType.BidAsk,CumulativeDeltaPeriod.Session,0).DeltaClose[0]);
                    }
                    ----
                    The above sample code snippet from help guides provides the close value, I am looking for a average over the session, for the UP bars and the DOWN bars.

                    Thanks
                    I'm curious as to what you're trying to do once you get the "Average" calculated.

                    Can you not simply use two Simple Moving Averages (one plotting Delta High, one plotting Delta Low) and then choose however many "bars you want to average"?

                    The attached screenshot is from the Delta Bar on a 5 minute chart of 6E using a 12 period setting for the High & Low SMA's (which would equate to a 60 minute average)

                    If I use a much larger period for the SMA's the resulting number averages out most (if not all) of the "Outliers" but then I have no idea what you need the number to do for you.


                    Click image for larger version

Name:	Order Flow Cumulative Delta (Delta High &amp; Delta Low SMA's) 2019-04-04_12-42-ET.png
Views:	2066
Size:	41.9 KB
ID:	1053466

                    Comment


                      #11
                      Originally posted by TopGunNote View Post

                      I'm curious as to what you're trying to do once you get the "Average" calculated.

                      Can you not simply use two Simple Moving Averages (one plotting Delta High, one plotting Delta Low) and then choose however many "bars you want to average"?

                      The attached screenshot is from the Delta Bar on a 5 minute chart of 6E using a 12 period setting for the High & Low SMA's (which would equate to a 60 minute average)

                      If I use a much larger period for the SMA's the resulting number averages out most (if not all) of the "Outliers" but then I have no idea what you need the number to do for you.


                      Click image for larger version

Name:	Order Flow Cumulative Delta (Delta High &amp; Delta Low SMA's) 2019-04-04_12-42-ET.png
Views:	2066
Size:	41.9 KB
ID:	1053466
                      Thanks for your input TopGunNote, I have learnt a lot from some of the indicators you posted. Thank you!

                      The solution you described is very simple and good.

                      I just ended up using this...
                      if (deltaLength > 0)
                      {
                      upDeltaLength.Add(deltaLength);
                      }
                      else if(deltaLength < 0)
                      {
                      downDeltaLength.Add(deltaLength);
                      }
                      upDeltaLengthAvg=upDeltaLength.Average();
                      downDeltaLengthAvg = downDeltaLength.Average();


                      The idea I had in mind was when using this on a fixed candle length charts e.g. range ... the increasing or decreasing delta length, would indicate which side was being more aggressive, irrespective of the price movement.

                      Regards

                      Comment


                        #12
                        I have more or less the same issue...
                        I would like to know the Range (High-Low) of the OFCD bar but i get a weird number that I do not understand what does it mean
                        Any clue how to solve this issue??
                        Thank you very much!!!
                        FVJ
                        PD: Attached are relevant screenshots....​
                        Click image for larger version

Name:	230418 Range of OFCD.jpg
Views:	285
Size:	76.1 KB
ID:	1246996
                        Click image for larger version

Name:	image.png
Views:	288
Size:	45.7 KB
ID:	1246997Click image for larger version

Name:	230418 Range of OFCD 3.jpg
Views:	286
Size:	92.0 KB
ID:	1246998

                        Comment


                          #13
                          Originally posted by efeuvejota01 View Post
                          I have more or less the same issue...
                          I would like to know the Range (High-Low) of the OFCD bar but i get a weird number that I do not understand what does it mean
                          Any clue how to solve this issue??
                          Thank you very much!!!
                          FVJ
                          Hello FVJ,

                          Thank you for your note.

                          To get the range from the Order Flow Cumulative Delta indicator, you could write a script that utilizes the Delta High and Delta Low values rather than the standard High and Low values that are used in the range indicator. Here is the syntax available to access the Delta High and Delta Low as noted in the help guide:

                          Returns High value -
                          OrderFlowCumulativeDelta(CumulativeDeltaType deltaType, CumulativeDeltaPeriod period, int sizeFilter).DeltaHigh[int barsAgo]
                          OrderFlowCumulativeDelta(ISeries<double> input, CumulativeDeltaType deltaType, CumulativeDeltaPeriod period, int sizeFilter).DeltaHigh[int barsAgo]

                          Returns Low value -
                          OrderFlowCumulativeDelta(CumulativeDeltaType deltaType, CumulativeDeltaPeriod period, int sizeFilter).DeltaLow[int barsAgo]
                          OrderFlowCumulativeDelta(ISeries<double> input, CumulativeDeltaType deltaType, CumulativeDeltaPeriod period, int sizeFilter).DeltaLow[int barsAgo]



                          Please let us know if we may be of further assistance.
                          Emily C.NinjaTrader Customer Service

                          Comment

                          Latest Posts

                          Collapse

                          Topics Statistics Last Post
                          Started by MarianApalaghiei, Today, 10:49 PM
                          3 responses
                          9 views
                          0 likes
                          Last Post NinjaTrader_Manfred  
                          Started by XXtrader, Today, 11:30 PM
                          0 responses
                          3 views
                          0 likes
                          Last Post XXtrader  
                          Started by love2code2trade, Yesterday, 01:45 PM
                          4 responses
                          28 views
                          0 likes
                          Last Post love2code2trade  
                          Started by funk10101, Today, 09:43 PM
                          0 responses
                          9 views
                          0 likes
                          Last Post funk10101  
                          Started by pkefal, 04-11-2024, 07:39 AM
                          11 responses
                          37 views
                          0 likes
                          Last Post jeronymite  
                          Working...
                          X