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

Add Orderflow Cumulative Delta

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

    Add Orderflow Cumulative Delta

    Hello,

    I do not find how to add in a strategy OrderFlowCumulativeDelta for added dataseries1 and use it eg like
    && OrderFlowCumulativeDelta1.DeltaClose[0] > OrderFlowCumulativeDelta1.DeltaOpen[0] // I assume in OnBarUpdate "as usual" it has to be changed to Closes[1][0] and Opens[1][0] ??

    but if so what is necessary in DataLoaded (or somewhere else in the script) to have it working OK?

    Thank you!
    Tony

    #2
    Hello Tony,

    Are you asking how to supply an input series to an indicator?

    OrderFlowCumulativeDelta(ISeries<double> input, CumulativeDeltaType deltaType, CumulativeDeltaPeriod period, int sizeFilter)
    OrderFlowCumulativeDelta(BarsArray[1], CumulativeDeltaType.BidAsk, CumulativeDeltaPeriod.Session, 0)

    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hello,

      thank you for your reply. No, I´m asking how to use the
      && (OrderFlowCumulativeDelta1.DeltaClose[0] > OrderFlowCumulativeDelta1.DeltaOpen[0]) // this I get with strategy builder
      for dataseries1 and not dataseries0
      in a strategy

      Thank you!
      Tony

      Comment


        #4
        Hello Tony,

        What you mean by dataseries1?

        Is this an added series with AddDataSeries()?
        (Or in the Strategy Builder on the Additional Data page?)

        If so, the answer is the same. Set the input series to the added series.

        If not, can you clarify what you mean by dataseries1?
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Hello,

          thank you for your reply. Back to beginning and question please: when I make a simple strategy with strategy builder there appears the message in the log tab
          18.10.2019 08:58:05 Default 'Order Flow Cumulative Delta' tried to load additional data. All data must first be loaded by the hosting NinjaScript in its configure state. Attempted to load NQ 12-19 Globex: 1 Tick
          Why please?

          There is no additional coding from me. Only added the indicator in strategy builder as I started coding 10 years ago.

          Thank you!
          Tony
          Attached Files

          Comment


            #6
            Hello Tony,

            Thanks for your reply.

            When using the OrderFlow Cumulative delta indicator in a script, you must add the data that the indicator uses which is a 1 tick data series. This is specified in the help guide " Critical: You will want to make sure to add a 1 tick series in the Additonal Data section of the Strategy Builder, when working with the Order Flow Cumulative Delta in this context." . Please see the section, " Order Flow Cumulative Delta Values NinjaScript or Strategy Builder access" on this page: https://ninjatrader.com/support/help...tive_delta.htm

            Paul H.NinjaTrader Customer Service

            Comment


              #7
              Hello,

              thank you for your reply.

              When adding the cumdelta indicator with strategy builder then its not done? I did it with the strategy builder to see how it should be.
              Sorry, I dont know now how to make it working.

              Thank you!
              Tony

              Comment


                #8
                Hello Tony,

                Thanks for your reply.

                Correct, it is not automatically done for you.

                To add a 1 tick data series in the strategy builder, in the "Additional Data" window, click "add", click the check box for "primary instrument", set the type to tick and the value to 1. This will add a 1 tick series of the charts instrument which will provide the data the Order Flow Cumulative delta needs to perform its function. You would not need to do anything else.


                Paul H.NinjaTrader Customer Service

                Comment


                  #9
                  Hello Paul,

                  thank you for your reply.

                  Comparing the indicator "orderflow cumulative delta" added to a script or adding dataseries volumetric and using "barsType.Volumes[CurrentBar].CumulativeDelta" is there a difference for CPU? When I use volumetric with 3 Range it is plotting the 3 Range but its using also 1 Tick. Yes? So its the same for CPU?

                  Concerning "barsType.Volumes[CurrentBar].CumulativeDelta" I want to ask (I can not read in the helpguide for orderflow volumetric bars) what "Gets a long value" is? Its the close?
                  So when one wants to work with the High and Low and not only the Close of delta and compare the current bar with the bar before then it is only possible with the indicator "orderflow cumulative delta" or could it be done also with volumetric "directly" (as already added and necessary in the script)

                  Because IF High and low of delta would be also provided by volumetric dataseries then one does not need to add the indicator "orderflow cumulative delta" when volumetric is used in the script (because of CPU)

                  I hope I translate and explain correctly so that you know what I mean.


                  Thank you!
                  Tony
                  Last edited by tonynt; 10-20-2019, 11:52 AM. Reason: translation error

                  Comment


                    #10
                    Hello Tony,

                    Thanks for your reply.

                    Yes,both Volumetric and Cumulative delta indicators will use a 1 tick added data series to generate their values so in that sense they would be the same. The Volumetric bars also generate a lot more data/calculations and can optionally display all of that data so in that sense, the Volumetric bars would have a higher cpu/gpu expectation. If you are adding both indicators to your strategy, you only need to add a single 1 tick series as they both would use the same data (and any other indicator that needs a 1 tick series).

                    A "long" value is just a C# variable "type" A long can be a significanly larger value than the standard int type. Please see this intenet referenced site: https://docs.microsoft.com/en-us/dot...-numeric-types The cumulativeDelta "close" would be the long value returned.

                    The Volumetric bar does not provide access to Cumulative Delta's Open, High, or Low, it only provides the Cumulative "Close" value. If you need those values then indeed you would have to add the Order Flow Cumulative Delta indicator.

                    Paul H.NinjaTrader Customer Service

                    Comment


                      #11
                      Hello,

                      thank you for your reply. I am confused now, sorry. So when I want to use the Cumulative Delta indicator on a 4 RangeBar-Chart, then I do have in State.Configure "AddDataSeries(Data.BarsPeriodType.Tick, 1); " only? My script doesnt trigger now. Do I have to add or modify somewhere else in the script so that its used as a 4 Range cum delta?
                      I only have then in State.Dataloaded "OrderFlowCumulativeDelta1 = OrderFlowCumulativeDelta(Close, NinjaTrader.NinjaScript.Indicators.CumulativeDelta Type.BidAsk, NinjaTrader.NinjaScript.Indicators.CumulativeDelta Period.Session, 0);"
                      and in onbarupdate eg "&& OrderFlowCumulativeDelta1.DeltaClose[0] > OrderFlowCumulativeDelta1.DeltaOpen[0]"


                      Thank you!
                      Tony

                      Comment


                        #12
                        Hello tonynt,

                        Thanks for your reply.

                        If you want to run the indicator by itself on the 4 range chart you need only add the indicator itself as it will automatically add the 1 tick series it needs.

                        If you are running a strategy that adds the indicator, then the strategy will need to provide the 1 tick series to the indicator (as the indicator will be "hosted" by the strategy). When you add the indicator to the strategy, you will need to ensure you are following the help guide examples to ensure the order flow indicator is updated. Please see the example shown under "Calling the OrderFlowCumulativeDelta() method by reference" on this page: https://ninjatrader.com/support/help...ive_delta2.htm
                        Paul H.NinjaTrader Customer Service

                        Comment


                          #13
                          Hello,

                          I tried already - before asking my question. Why is there in the sample cumulativeDelta = OrderFlowCumulativeDelta(CumulativeDeltaType.BidAs k, CumulativeDeltaPeriod.Session, 0);

                          but with strategy builder it is

                          OrderFlowCumulativeDelta1 = OrderFlowCumulativeDelta(Close, NinjaTrader.NinjaScript.Indicators.CumulativeDelta Type.BidAsk, NinjaTrader.NinjaScript.Indicators.CumulativeDelta Period.Session, 0);

                          Thank you!
                          Tony


                          Comment


                            #14
                            Hello tonynt,

                            Thanks for your reply.

                            Are you asking for help with the strategy builder or a Ninjascript strategy? Can you clarify what specifically your question is?
                            Paul H.NinjaTrader Customer Service

                            Comment


                              #15
                              Hello,

                              what you mean with strategy builder or ninjascritp strategy.

                              I started to do a ninjascript strategy with the strategy builder (so that I see the logic and after this I could continue as usual by adding in the editor)

                              But already when starting with the strategy builder this is confusing this time because it is different there with
                              "OrderFlowCumulativeDelta1 = OrderFlowCumulativeDelta(Close, NinjaTrader.NinjaScript.Indicators.CumulativeDelta Type.BidAsk, NinjaTrader.NinjaScript.Indicators.CumulativeDelta Period.Session, 0);"

                              while sampel from the link it is"cumulativeDelta = OrderFlowCumulativeDelta(CumulativeDeltaType.BidAs k, CumulativeDeltaPeriod.Session, 0);"

                              Thank you!
                              Tony

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by dustydbayer, Today, 01:59 AM
                              0 responses
                              1 view
                              0 likes
                              Last Post dustydbayer  
                              Started by inanazsocial, Today, 01:15 AM
                              0 responses
                              2 views
                              0 likes
                              Last Post inanazsocial  
                              Started by trilliantrader, 04-18-2024, 08:16 AM
                              5 responses
                              22 views
                              0 likes
                              Last Post trilliantrader  
                              Started by Davidtowleii, Today, 12:15 AM
                              0 responses
                              3 views
                              0 likes
                              Last Post Davidtowleii  
                              Started by guillembm, Yesterday, 11:25 AM
                              2 responses
                              10 views
                              0 likes
                              Last Post guillembm  
                              Working...
                              X