Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Candle reference onpricechange

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

    Candle reference onpricechange

    when using onpricechange and you wish to know when the Current Bar High exceeds the Open of the bar 1 bar ago

    Are you stating the High[0] > Open[1]
    or since this is intrabar is this consider the current close before the bar actually closes

    Close[0] > Open[1]

    thanks

    #2
    Hello DTSSTS,

    Thanks for your post.

    With Calculate.OnPriceChange, High[0] will be the current high of the current forming bar.
    With Calculate.OnPriceChange, Close[0] will be the current price of the current forming bar, which also may be the High of the bar (or not) at that moment.

    If you want the High of the currently forming bar, then use High[0].

    Comment


      #3
      thanks that is how i was looking at it as well. The reason for the Question is I have sometimes the High[0] > Open[1] will not be true, but my exits are triggering, I may substitue Close for High and see if I can eliminate that issue

      Comment


        #4
        Hello DTSSTS,

        Thanks for your reply.

        I would suggest using print statements to prove the condition.

        Print (Time[0]+" High[0] = "+High[0]+ " Open[1] = "+Open[1]+ " High[0] > Open[1] condition is: "+(High[0] > Open[1] ? "True" : "False"));

        Comment


          #5
          thanks for the statement, I never know what the Print statement should say, THANKS ALOT

          Comment


            #6
            I HAVE this strategy in Strategy Builder, I will have to unlock the code to add this print Correct? I also do not know where to put the Print in the Code, is there a video showing that



            It just happen here the tops of those RED bars is the Open and the High, the stop out occurred and the price was never close to High 0 exceeding Open1

            Comment


              #7
              Issue is why does it work 2 times then randomly NOT



              3 exits on ths image, all same conditions for exit, also most like Dark Pool Data or something that is not actually plotted on chart but that was an actual real time print

              Comment


                #8
                Hello DTSSTS,

                Thanks for your replies.

                You can construct a print statement in the strategy builder, however, you cannot print the logic of High[0]>Open[1] ? True: False. However, printing the values of High[0] and Low[1] will still allow you to see their values and you can make the comparison.

                Here is a short generic video (looking to see when a condition is true or false) that shows how to construct a print statement in the strategy builder. As shown in the video I think it best if you use an empty set which will provide a lot of data but should allow you to work back through to see when the logic is or is not true. https://paul-ninjatrader.tinytake.co...NV8xMDk5MDc5Nw


                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by NullPointStrategies, Yesterday, 05:17 AM
                0 responses
                71 views
                0 likes
                Last Post NullPointStrategies  
                Started by argusthome, 03-08-2026, 10:06 AM
                0 responses
                143 views
                0 likes
                Last Post argusthome  
                Started by NabilKhattabi, 03-06-2026, 11:18 AM
                0 responses
                76 views
                0 likes
                Last Post NabilKhattabi  
                Started by Deep42, 03-06-2026, 12:28 AM
                0 responses
                47 views
                0 likes
                Last Post Deep42
                by Deep42
                 
                Started by TheRealMorford, 03-05-2026, 06:15 PM
                0 responses
                51 views
                0 likes
                Last Post TheRealMorford  
                Working...
                X