Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Stop Loss Order Rejected

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

    Stop Loss Order Rejected

    I'm having some stop loss orders rejected and I can't figure our why. Sometimes it works and sometimes it doesn't.

    2 message boxes pop up

    "buy stop or buy stop limit orders can't be placed below the market"

    and

    "2/16/2015 9:16:59 PM|1|32|Order='c393761ee8c1420cbf71e0d69f201441/Sim101' Name='Stop loss' New state=Rejected Instrument='$GBPUSD' Action=BuyToCover Limit price=0 Stop price=1.5263 Quantity=1 Type=Stop Filled=0 Fill price=0 Error=OrderRejected Native error='Buy stop or buy stop limit orders can't be placed below the market.'"

    I had the strategy output the following info.

    ***************************************
    $GBPUSD Short Stop
    Position Average Price: 1.5364
    Stop Loss Ticks: 0.00291342494440044
    Stop Loss: 1.5393134249444
    Current Ask: 1.5365
    Current Bid: 1.5365
    Close: 1.5365
    2/16/2015 9:15:00 PM
    ***************************************



    I have attached a text file with my stop loss code.
    Attached Files

    #2
    Originally posted by rjb0333 View Post
    I'm having some stop loss orders rejected and I can't figure our why. Sometimes it works and sometimes it doesn't.

    2 message boxes pop up

    "buy stop or buy stop limit orders can't be placed below the market"

    and

    "2/16/2015 9:16:59 PM|1|32|Order='c393761ee8c1420cbf71e0d69f201441/Sim101' Name='Stop loss' New state=Rejected Instrument='$GBPUSD' Action=BuyToCover Limit price=0 Stop price=1.5263 Quantity=1 Type=Stop Filled=0 Fill price=0 Error=OrderRejected Native error='Buy stop or buy stop limit orders can't be placed below the market.'"

    I had the strategy output the following info.

    ***************************************
    $GBPUSD Short Stop
    Position Average Price: 1.5364
    Stop Loss Ticks: 0.00291342494440044
    Stop Loss: 1.5393134249444
    Current Ask: 1.5365
    Current Bid: 1.5365
    Close: 1.5365
    2/16/2015 9:15:00 PM
    ***************************************



    I have attached a text file with my stop loss code.
    See what I have market in red? Your Limit Price must be at least equal to your Stop Price, and MUST be above the Ask. Adjust your code to make the correct order.

    Comment


      #3
      rjb0333, welcome to our forums - the buy stop you try to place is not valid, your stop price 1.5263, while the current ask is two pips higher, we would expect a rejection in this case.

      It looks like you second SetStopLoss call might be the issue, I would print Position.AvgPrice - 30 * TickSize as well to doublecheck.

      Comment


        #4
        Originally posted by koganam View Post
        See what I have market in red? Your Limit Price must be at least equal to your Stop Price, and MUST be above the Ask. Adjust your code to make the correct order.
        Thank you for the prompt response koganam, it would appear I grabbed the wrong variable for my stop loss price.
        Last edited by rjb0333; 02-17-2015, 04:55 PM.

        Comment


          #5
          Originally posted by NinjaTrader_Bertrand View Post
          rjb0333, welcome to our forums - the buy stop you try to place is not valid, your stop price 1.5263, while the current ask is two pips higher, we would expect a rejection in this case.

          It looks like you second SetStopLoss call might be the issue, I would print Position.AvgPrice - 30 * TickSize as well to doublecheck.

          Thank you for your reply NinjaTrader_Bertrand, it would appear I grabbed the wrong variable for my stop loss price.
          Last edited by rjb0333; 02-17-2015, 04:56 PM.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by CarlTrading, 03-31-2026, 09:41 PM
          1 response
          153 views
          1 like
          Last Post NinjaTrader_ChelseaB  
          Started by CarlTrading, 04-01-2026, 02:41 AM
          0 responses
          89 views
          1 like
          Last Post CarlTrading  
          Started by CaptainJack, 03-31-2026, 11:44 PM
          0 responses
          133 views
          2 likes
          Last Post CaptainJack  
          Started by CarlTrading, 03-30-2026, 11:51 AM
          0 responses
          128 views
          1 like
          Last Post CarlTrading  
          Started by CarlTrading, 03-30-2026, 11:48 AM
          0 responses
          107 views
          0 likes
          Last Post CarlTrading  
          Working...
          X