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

Accessing OrderFlow Cumulative Delta

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

    Accessing OrderFlow Cumulative Delta

    Is it possible to access oder flow cumulative data? particularly I am interested in knowing the order flow cumulative delta direction once a bar is completed. If the order flow cumulative delta is downward but close is higher than open I want to paint the bar one color and vice versa if order flos cumulative delta is up and close is less then open I want to pain the bar a different color.

    I am looking for a way to visually single out these events to make them stand out.

    Thanks

    #2
    yes but only if you own the software.

    private OrderFlowCumulativeDelta cumulativeDelta;


    else if (State == State.Configure)
    {
    AddDataSeries(Data.BarsPeriodType.Tick, 1);
    }
    else if (State == State.DataLoaded)
    {
    // Instantiate the indicator
    cumulativeDelta = OrderFlowCumulativeDelta(CumulativeDeltaType.BidAs k, CumulativeDeltaPeriod.Bar, 0);

    }



    if (BarsInProgress == 0)
    {
    yourParameter = cumulativeDelta.DeltaClose[0];



    }
    else if (BarsInProgress == 1)
    {
    // We have to update the secondary series of the hosted indicator to make sure the values we get in BarsInProgress == 0 are in sync
    cumulativeDelta.Update(cumulativeDelta.BarsArray[1].Count - 1, 1);

    //Add your custom indicator logic here.

    yourParameterYouMake= cumulativeDelta.DeltaClose[0];



    }

    Comment


      #3
      Hello jeliner,

      Yes, the OrderFlowCumulativeDelta can be called from a NinjaScript as ballboy11 has shown.

      Below is a link to the help guide.


      The BarBrush can be set to set the color of the bar.
      Chelsea B.NinjaTrader Customer Service

      Comment


        #4
        Hello, I have follow up question on accessing OrderFlowCumulativeDelta. I own a license and I am able to instantiate an instance of OrderFlowCumulativeDelta and compile the indicator successfully using the NinjaTraderEditor, but I am getting error in Visual Studio saying "CS1955:Non-invocable member 'name' cannot be used like a method.". I want to do the indicator development using Visual studio, how do I fix the error so VIsual studio can recognize the type.

        Comment


          #5
          Hello canonguy,

          Thank you for your note.

          It is expected behavior to receive errors when trying to compile in Visual Studio because it does not automatically have access to the NinjaTrader custom project. Visual Studio is only supported as an editor for NInjaScript files. You should only save the file after editing and you should not run or build the solution in Visual Studio. If you have a NInjaScript Editor open at the same time, once you save changes in Visual Studio then the NinjaScript Editor will auto-compile your scripts. One workaround would be to manually include the NinjaTrader.Vendor.cs file in your Visual Studio solution, although this is only temporary because it would be removed every time changes are made to the NinjaScript project. This is noted in the following post from my colleague Jesse:
          Hi all, I.m trying to develop a strategy with the OrderFlowVWAP indicator. And i.m reading the documentation in the wiki: https://ninjatrader.com/support/help...flow_vwap2.htm (https://ninjatrader.com/support/helpGuides/nt8/?order_flow_vwap2.htm) But when i try the code on VISUAL STUDIO 2019 , it doesn.t work: double


          Please also see the tip at the bottom of this page regarding using Visual Studio as an editor for NInjaScript files:


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

          Comment


            #6
            Thanks, that worked!

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Sebastian - TwinPeaks, Yesterday, 01:31 PM
            4 responses
            25 views
            0 likes
            Last Post Sebastian - TwinPeaks  
            Started by FAQtrader, 04-25-2024, 12:00 PM
            6 responses
            97 views
            0 likes
            Last Post blkbird
            by blkbird
             
            Started by bee1943, Today, 09:55 AM
            0 responses
            7 views
            0 likes
            Last Post bee1943
            by bee1943
             
            Started by giulyko00, Yesterday, 11:49 AM
            3 responses
            26 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by NUVERSA, Today, 09:31 AM
            1 response
            10 views
            0 likes
            Last Post NinjaTrader_BrandonH  
            Working...
            X