Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

stop order error

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

    stop order error

    I have the following code in a strat:

    longentrylevel = High[1]+TickSize;
    LongOrder = EnterLongStop(1,longentrylevel,"LongEntry1");

    And it produced the error:

    Buy or buy stop orders cant be placed below the market.
    Affected Order: Buy 1 stop @9551

    Would I get round this by making sure longentrylevel >= GetCurrentBid() ?

    #2
    Correct. You can't submit that type of order with a price below the market.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      short stop order

      For a short stop order:

      ShortOrder = EnterShortStop(shortentrylevel,"ShortEntry1");

      Would I be looking at shortentrylevel >= GetCurrentBid()

      or would it be shortentrylevel >= GetCurrentAsk()?

      On the basis that we buy at the bid and sell at the ask.

      Comment


        #4
        mballagan,

        I believe for shorts you need to be > the ask.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          stop order

          Further to my previous post I modified my code so that:

          longentrylevel >= GetCurrentBid() on a buy stop order

          However this still sometimes produces the error 'Buy stop or buy stop limit orders cant be placed below the market'

          Is it possible that the market moves past the value longentrylevel by the time the order reaches the exchange?

          Comment


            #6
            Yes it is possible if you are working so close to the inner markets.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              stop error

              I have put the code in a try/catch block but the error is still displayed and the strat crashes out, is there a way I can get round this problem?

              Comment


                #8
                try catch will not be able to catch this. At the time you place the order it is valid. By the time you receive a state back from the brokerage/exchange it is not. You simply should not be trying to trade so close to the inner markets.
                Josh P.NinjaTrader Customer Service

                Comment


                  #9
                  Last night I received this message - this is from the trace file:
                  2009-10-12 17:41:55:031 ERROR: A Buy order placed at '1/2/2009 11:36:00 AM' has been ignored since the stop price is less than or equal to the close price of the current bar. This is an invalid order and subsequent orders may also be ignored. Please fix your strategy.
                  I am confused by the date, because I did not have and was not using NT back at the beginning of this year. Am I misunderstanding the error message?

                  Comment


                    #10
                    Eastbank, this could also occur during a backtest you ran for this period.
                    BertrandNinjaTrader Customer Service

                    Comment


                      #11
                      Ah, that makes sense, thanks Bertrand

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by ZenCortexAuCost, Today, 04:24 AM
                      0 responses
                      3 views
                      0 likes
                      Last Post ZenCortexAuCost  
                      Started by ZenCortexAuCost, Today, 04:22 AM
                      0 responses
                      0 views
                      0 likes
                      Last Post ZenCortexAuCost  
                      Started by SantoshXX, Today, 03:09 AM
                      0 responses
                      13 views
                      0 likes
                      Last Post SantoshXX  
                      Started by DanielTynera, Today, 01:14 AM
                      0 responses
                      2 views
                      0 likes
                      Last Post DanielTynera  
                      Started by yertle, 04-18-2024, 08:38 AM
                      9 responses
                      42 views
                      0 likes
                      Last Post yertle
                      by yertle
                       
                      Working...
                      X