Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Buy Sell Pressure Indicator Used with OnBarUpdate

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

    Buy Sell Pressure Indicator Used with OnBarUpdate

    I am developing a strategy using the Buy/Sell Pressure indicator which is an ontickupdate indicator. I want the strategy to place an order at the end of bar. Can you give/point me to me a snippet of code to show how to use both ontickupdate and onbarupdate at the same time?

    Thanks

    #2
    Hello cpabiz20k,

    This can be done by triggering the order in a condition that requires IsFirstTickOfBar to be true.

    The help guide has example code.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thanks Chelsea - I am not quite sure what to do with this...I think the main issue is that the indicator always shows 50 at the beginning of every bar. We tested and it also shows 50 for the previous bar's value. Our strategy needs to track the value of the buy sell pressure from the prior candle. Is there a way to get the true value of the buy sell pressure indicator from the previous candle?

      Comment


        #4
        Hello cpabiz20k,

        By using a barsAgo value?
        BuySellPressure().BuyPressure[1]

        Are you talking historical or real-time?

        Is TickReplay on?
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          I checked and I do have the TickReplay on...I have tried both market replay and live. Can I send you the sample code and ask you to look at it for me?
          Thanks

          Comment


            #6
            Hello cpabiz20k,

            Add the indicator to the chart with AddChartIndicator().

            Are you seeing the values you are printing do not match the indicator that appears on the chart?

            Are you calling Update() to ensure the values are up to date in the indicator?

            I am not able to reproduce this behavior.

            Attached is the test script and a screenshot of the output on my end compared with the DataBox from the chart with the mouse over that particular bar.
            Attached Files
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              That worked perfectly. I was missing several small things related to isfirsttick. Thanks - Your help is much appreciated!

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by NullPointStrategies, Today, 05:17 AM
              0 responses
              33 views
              0 likes
              Last Post NullPointStrategies  
              Started by argusthome, 03-08-2026, 10:06 AM
              0 responses
              124 views
              0 likes
              Last Post argusthome  
              Started by NabilKhattabi, 03-06-2026, 11:18 AM
              0 responses
              64 views
              0 likes
              Last Post NabilKhattabi  
              Started by Deep42, 03-06-2026, 12:28 AM
              0 responses
              41 views
              0 likes
              Last Post Deep42
              by Deep42
               
              Started by TheRealMorford, 03-05-2026, 06:15 PM
              0 responses
              46 views
              0 likes
              Last Post TheRealMorford  
              Working...
              X