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

NT8: Access delta for each tic of a volumetric range bar

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

    NT8: Access delta for each tic of a volumetric range bar

    I would like to be able to access each delta value for each tic of a range bar. After the bar has closed.
    Is there anyway to do this?

    #2
    Hello saturntd,

    When you use the term "Delta", what are you referring to?

    In math Delta refers to amount of change.

    Are you referring to the difference (or absolute difference) between the close of the current bar and the previous bar?

    Are you referring to the difference between the close of the current bar and the open of the current bar?

    Are you referring to the difference between the high and the low?
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hello,

      Not intending to hijack this thread, but I am interested on seeing Delta prices between Buy/Sell for each price once a 5 minute bar has closed.

      I also want to see difference between buy/sell as bar is forming in real time on same 5 minute bar.

      Please see screenshot attached.

      Thanks
      Attached Files

      Comment


        #4
        Hello music_p13,

        Your request to display the difference between Bid/Ask for each price on Volumetric Bars is being tracked with ID #SFT-3326.

        Please note it is up to the NinjaTrader Development to decide if and when a request will be implemented.

        Thank you for your feedback.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Hello, please add my vote to SFT-3326. Thanks

          Comment


            #6
            Hello walter739,

            Thank you for your reply.

            I've added a vote to SFT-3326 as well.

            Please let us know if we may be of further assistance to you.
            Kate W.NinjaTrader Customer Service

            Comment


              #7
              I got it working like this:

              in State.Configure
              ...
              AddDataSeries(BarsPeriodType.Tick, 1); // My second series

              in OnBarUpdate()
              if (BarsInProgress == 2)
              {
              Delta += OrderFlowCumulativeDelta(BarsArray[2], CumulativeDeltaType.BidAsk, CumulativeDeltaPeriod.Bar, 0).DeltaClose[0];
              }

              Delta = 0.0;


              in OnRender
              // do what you need to do here to display the delta

              Comment


                #8
                Hello jalley, thanks for the help and your time, but I am not an expert programmer and I do not know how to use on render, I am trying to be able to choose the size of the delta in the tick of the 5 min bar to enter long or short, but I have not been able to find any sample strategy with volumetric bars to be able to guide me and do this.

                Put your syntax in a simple strategy but I know that I am far from making it functional, I would like for now to be able to print the delta for each tick but I can't find how to develop that syntax.

                }
                else if (State == State.Configure)
                {

                AddDataSeries(BarsPeriodType.Tick, 1);
                }
                else if (State == State.DataLoaded)
                {
                EMA1 = EMA(Close, Convert.ToInt32(Ema14));
                SetProfitTarget("", CalculationMode.Percent, Profit);
                SetStopLoss("", CalculationMode.Percent, Loss, false);
                }
                }

                protected override void OnBarUpdate()
                {
                if (BarsInProgress != 0)
                return;

                if (CurrentBars[0] < 1)
                return;

                if (BarsInProgress == 2)
                {
                Delta += OrderFlowCumulativeDelta(BarsArray[2], CumulativeDeltaType.BidAsk, CumulativeDeltaPeriod.Bar, 0).DeltaClose[0];
                }

                Delta = 0.0;

                // Set 1
                if (CrossAbove(Close, EMA1, 1))
                {
                EnterLong(Convert.ToInt32(DefaultQuantity), "");
                Lowlong = Low[0];
                Print(Convert.ToString(Times[0][0]) + @" low " + Convert.ToString(Low[0]) + @" Delta " + Convert.ToString(Delta));
                }

                }

                Thank you for your time, I attach an image of how I would like according to that value of the delta in the tick to be able to activate my order.

                Comment


                  #9
                  Move the If (BarsInProgress == 2) up to the top before your other checks to exit I would assume would fix it.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by alifarahani, Today, 09:40 AM
                  4 responses
                  19 views
                  0 likes
                  Last Post alifarahani  
                  Started by gentlebenthebear, Today, 01:30 AM
                  3 responses
                  15 views
                  0 likes
                  Last Post NinjaTrader_Jesse  
                  Started by PhillT, Today, 02:16 PM
                  2 responses
                  7 views
                  0 likes
                  Last Post PhillT
                  by PhillT
                   
                  Started by Kaledus, Today, 01:29 PM
                  3 responses
                  11 views
                  0 likes
                  Last Post NinjaTrader_Jesse  
                  Started by frankthearm, Yesterday, 09:08 AM
                  14 responses
                  47 views
                  0 likes
                  Last Post NinjaTrader_Clayton  
                  Working...
                  X