Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Exit when open is above entry price

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

    Exit when open is above entry price

    Hi

    There seems to be no reference to entry price in the wizard. I suppose I will need code for the following, but I don't know where to start.

    I want to enter long when bar close>bar open and price rises a further 10 pips above the high of that bar. This I think I can do with the wizard.

    Exit is on first open which is above the entry price. I imagine this is either done by reference to the entry price value which seems the most straightforward, ie exit=when open>entry price, or could it be done by making reference to the entry bar ie exit when open > (high of entry bar +10 ).

    Help would be appreciated.

    Steve

    #2
    Steve, you can just place a Buy / Sell Stop order then at this price + / - your desired offset - http://www.ninjatrader-support.com/H...APosition.html
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Bertrand, thanks for the reply

      I note the references you make. Actually, it may be a little more complicated as there are additional entry conditions, which I should have mentioned.
      • A bar will close higher than the open
      • The entry must be on the next bar or it will be rejected.
      • The entry will be 10 pips above the high of the previous bar.

      Basically, there will be an up bar, and entry will be 10 pips above it on the next bar.
      The strategy is needed for daily bars and hourly. I will later set for short trades in the same way.

      I have made some progress, using the wizard as follows

      Close[1]>Open[1]
      Get CurrentBid0==High[1] + 10 TickSize
      EnterLong

      This is not correct as entries are registered not on the next bar on hourly charts, but on the next but one bar, instead of being rejected. Also, there are no entries registered on the daily charts. The time parameters were set to 9.50am open and 7.00am close.

      What am I doing wrong?

      Steve

      Comment


        #4
        Steve, first of all : in backtesting orders are always placed for the next bar - this is expected, as this is the next possible trade location then, as the bars triggering the condition for entry already closed.

        For your EnterLong - was this just an abbreviation for entering a LongStop order at the price you saved to the variable?

        Session times are non effective for daily bars, the bars does not know about the intraday formation, you can access the daily Open, High, Low, Close, Volume data.
        BertrandNinjaTrader Customer Service

        Comment


          #5
          Bertrand

          Okay, so if the conditions for triggering an entry are not met in the next bar, then the conditions will be looked for in the following bar and there is no way of preventing this? It needs to start looking for the next up bar or down bar for my idea. It derives from a strategy of buy on Monday above Friday high if Friday was an up day. Exit first profitable open.

          Enter Long was the instructions I entered in the wizard as the action to take when the conditions I have stated were met.

          So how come there were no trades registered in the daily chart?

          Steve

          Comment


            #6
            Steve, if there are no trades shown, then it means your entry condition as programmed in did not trigger, or evaluate to 'true', you would need to remove parts of it until you see trades triggering and see why the part prevented entries. A common approach is using a drawing when the conditions hit, this way you would know exactly when to expect an entry on the next bar then -

            BertrandNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by NRITV, Today, 01:15 PM
            2 responses
            9 views
            0 likes
            Last Post NRITV
            by NRITV
             
            Started by frankthearm, Today, 09:08 AM
            7 responses
            31 views
            0 likes
            Last Post NinjaTrader_Clayton  
            Started by maybeimnotrader, Yesterday, 05:46 PM
            5 responses
            26 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by quantismo, Yesterday, 05:13 PM
            2 responses
            20 views
            0 likes
            Last Post quantismo  
            Started by adeelshahzad, Today, 03:54 AM
            5 responses
            33 views
            0 likes
            Last Post NinjaTrader_BrandonH  
            Working...
            X