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 Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          558 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          324 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          101 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          545 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          547 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X