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

UpDown Tick Delta Calculation

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

    UpDown Tick Delta Calculation

    Hello All,

    Hope you are well, I have a quick question!

    I am developing an indicator that can use Tick Replay to get the Delta values of bars.
    I have already developed the Bid/Ask Delta.
    I am having issues calculating the UpDownTick Delta.

    I have tried all the combinations I could think of, closest I came to the actual numbers was this:
    if (marketDataUpdate.MarketDataType == MarketDataType.Last)
    {

    if (marketDataUpdate.Price >= marketDataUpdate.Ask){
    delta++;
    lastPrice = 1;
    }
    else if(marketDataUpdate.Price <= marketDataUpdate.Bid){
    delta--;
    lastPrice = -1;
    }
    else
    delta += lastPrice;
    }

    Losing my mind here. Would appreciate some guidance!

    Thanks

    #2
    Hello Vikuno1,

    "Up Down Tick - Accumulates the volume of up ticks vs down ticks. Up ticks are considered buying pressure. Down ticks are considered selling pressure. If the current tick price is the same as the previous tick price, the volume will be recorded to the same pressure as the previous tick."



    Since you want to measure Up Down Tick, this would not be code in OnMarketData(), but would instead be in OnBarUpdate() with a 1 tick series added with AddDataSeries().

    If the tick is greater than the previous tick (Close[0] > Close[1]), accumulate to buying pressure, else accumulate to selling pressure.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_ChelseaB View Post
      Hello Vikuno1,

      "Up Down Tick - Accumulates the volume of up ticks vs down ticks. Up ticks are considered buying pressure. Down ticks are considered selling pressure. If the current tick price is the same as the previous tick price, the volume will be recorded to the same pressure as the previous tick."

      https://ninjatrader.com/support/help...eltaParameters

      Since you want to measure Up Down Tick, this would not be code in OnMarketData(), but would instead be in OnBarUpdate() with a 1 tick series added with AddDataSeries().

      If the tick is greater than the previous tick (Close[0] > Close[1]), accumulate to buying pressure, else accumulate to selling pressure.
      So I am still getting completely different numbers. I am sharing screenshots and attaching my indicator below as well.

      ​Only input that needs to be changed is DeltaType = 2

      Thanks
      Brady
      Attached Files

      Comment


        #4
        Hello Vikuno1,

        It would be expected comparing the current tick to the previous tick would have different results than comparing the bid to the ask.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Ok I think there is a bit of a disconnect. I was not looking at the bid ask. I was looking at the Up Down Tick Delta on Volumetric bars. I think I included a screenshot of the data series I was using for volumetric.

          I am trying to recreate Ninjas Up Down Tick Delta without using Volumetric Bars.

          I keep getting different numbers from Ninjas Volumetric Up Down Tick Delta.

          I tried the 1 Tick Data series with just comparing Close[0] and Close[1] and those were the results I got in the screenshots. They are nowhere close. I could be doing something wrong.

          Thanks!
          Brady

          Comment


            #6
            Hello Brady,

            Are you saving this per price level?

            Below is a link to an example you may find helpful.
            Hello everyone I am trying to get the bid ask volume inside the bar from the example the problem is that I need a method to get the bid and ask volume without tick replay. I am trying to create this indicator on my own - from the example of the developers But the result is without successfully Below is my code I ask for
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              Originally posted by NinjaTrader_ChelseaB View Post
              Hello Brady,

              Are you saving this per price level?

              Below is a link to an example you may find helpful.
              https://forum.ninjatrader.com/forum/...le#post1133429
              I am looking for the Total Up Down Tick Delta of the bar.

              Cannot seem to replicate how Ninja Calculates it.

              I am not sure how the Bid Ask will help, I could just be stupid though haha

              Thanks for your time,
              Let me know if you need anything more from me as well

              Comment


                #8
                Hello Vikuno1,

                I did a quick edit to the example I linked in post # 6, to compare the tick to the previous tick instead of the ask to the bid.
                UpDownTickTest_NT8.zip

                This prints to the output window.
                Chelsea B.NinjaTrader Customer Service

                Comment


                  #9
                  So that works when looking historically. But as soon as it starts running realtime the numbers are way off

                  Is there a way to fix this, or am I just doing something wrong?
                  Attached Files

                  Comment


                    #10
                    Hello Vikuno1,

                    The indicator will update 1 tick behind, but I am showing in real-time this is accurate (albeit 1 tick behind).

                    Below is a link to a test.
                    Chelsea B.NinjaTrader Customer Service

                    Comment


                      #11
                      Originally posted by NinjaTrader_ChelseaB View Post
                      Hello Vikuno1,

                      The indicator will update 1 tick behind, but I am showing in real-time this is accurate (albeit 1 tick behind).

                      Below is a link to a test.
                      https://drive.google.com/file/d/1UNB...w?usp=drivesdk
                      Ok I must be doing something wrong. Attaching screenshots of it not matching.

                      Using a 1 minute ES Chart UpDownTick. Not sure if it could be the low volatility but the numbers are wayy off for some reason.

                      Thank you for taking the time to help!
                      Attached Files
                      Last edited by Vikuno1; 11-30-2023, 10:07 PM.

                      Comment


                        #12
                        Hello Vikuno1,

                        The 9:02 bar is -9, which is only 1 away from -10. Seems correct and delayed by 1 tick.

                        Why do you feel that a difference of 1 is way off?
                        Chelsea B.NinjaTrader Customer Service

                        Comment


                          #13
                          Originally posted by NinjaTrader_ChelseaB View Post
                          Hello Vikuno1,

                          The 9:02 bar is -9, which is only 1 away from -10. Seems correct and delayed by 1 tick.

                          Why do you feel that a difference of 1 is way off?
                          Ok I must be blind or stupid or both. Testing now and it works. I will let you know if it stops for some reason. Thank you so much for the helping and putting up with my apparent blindness.

                          Sorry!

                          Comment

                          Latest Posts

                          Collapse

                          Topics Statistics Last Post
                          Started by fx.practic, 10-15-2013, 12:53 AM
                          5 responses
                          5,404 views
                          0 likes
                          Last Post Bidder
                          by Bidder
                           
                          Started by Shai Samuel, 07-02-2022, 02:46 PM
                          4 responses
                          95 views
                          0 likes
                          Last Post Bidder
                          by Bidder
                           
                          Started by DJ888, Yesterday, 10:57 PM
                          0 responses
                          8 views
                          0 likes
                          Last Post DJ888
                          by DJ888
                           
                          Started by MacDad, 02-25-2024, 11:48 PM
                          7 responses
                          159 views
                          0 likes
                          Last Post loganjarosz123  
                          Started by Belfortbucks, Yesterday, 09:29 PM
                          0 responses
                          8 views
                          0 likes
                          Last Post Belfortbucks  
                          Working...
                          X