• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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].

    Paul H.NinjaTrader Customer Service

    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"));
        Paul H.NinjaTrader Customer Service

        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

            https://gyazo.com/a6dbd7845babfe41eb4f9207b878376a

            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

              https://gyazo.com/bd7e7662a703662ba4b3dc5e3c9dc6f3

              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


                Paul H.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Unsuitable, Today, 07:26 AM
                0 responses
                2 views
                0 likes
                Last Post Unsuitable  
                Started by bumbledbee, Today, 04:28 AM
                1 response
                6 views
                0 likes
                Last Post NinjaTrader_Marco  
                Started by Tmaninc, Today, 02:13 AM
                3 responses
                12 views
                0 likes
                Last Post Tmaninc
                by Tmaninc
                 
                Started by rexmie888, Yesterday, 09:37 PM
                1 response
                11 views
                0 likes
                Last Post NinjaTrader_ChrisSch  
                Started by larkmail, Yesterday, 06:19 PM
                1 response
                7 views
                0 likes
                Last Post NinjaTrader_Marco  
                Working...
                X