Profile Picture

Stop loss order rejected

Posted By jcd77ehq 9 Years Ago
Message
Posted Tuesday May 20 2008
I'm using Live System to trade through Interactive Brokers and I'm having a bit of a problem with the stop-loss orders.  The market order to buy gets filled and the stop-limit order for my profit target goes through but the stop-loss order always comes back "Stop loss order rejected: the price does not conform to the minimum price variation for this contract."

I've searched the forum but I don't seem to see this problem mentioned.  Any help is appreciated.  Thanks. 

Posted Tuesday May 20 2008
I don't trade IB, but the first questions that come to my mind are:

Is there a minimum stop distance?
How close is your stop?

HTH,
Mark
Posted Tuesday May 20 2008
What instrument are you trading?
Posted Tuesday May 20 2008
Mark,

My stops are defined in RightEdge at .6% of the closing price of the last 5-minute bar so for the stocks I trade they tend to be .30 to .60 points, which has never been a problem before when I enter them manually into IB's trading platform.  I kind of figured it might have something to do with how RightEdge sends a bracket order of both stop-limit and stop but I haven't come across anything on IB or RightEdge's side.

I also forgot to mention that IB does receive the stop order it just doesn't transmit it to the exchange.  It hangs in the pending window until I transmit it.  But doing so then confuses RightEdge because it believes the stop order has been rejected.

Anyway, hope that isn't just confusing the issue.

John

Posted Tuesday May 20 2008
billb (5/20/2008)
What instrument are you trading?

I'm trading NYSE and Nasdaq equities.  I mentioned this in another post but I've entered similar stop orders manually into IB's platform and haven't had a problem so I'm having trouble figuring where things are going wrong.

Posted Tuesday May 20 2008
Are you using the discresionary trading features or doing this from a system?

If from a system, could we see the code snippet of the line where you are placing the order?

Posted Tuesday May 20 2008
young (5/20/2008)
Are you using the discresionary trading features or doing this from a system?

If from a system, could we see the code snippet of the line where you are placing the order?

It is from a system, not discretionary.  You'll have to bare with me because I just starting using the program so I'll have to figure out how to view and copy the code.  I just built the system by dragging elements from the 'system components' window.

DoQ
Supreme Being (12,693 reputation)Supreme Being (12,693 reputation)Supreme Being (12,693 reputation)Supreme Being (12,693 reputation)Supreme Being (12,693 reputation)Supreme Being (12,693 reputation)Supreme Being (12,693 reputation)Supreme Being (12,693 reputation)Supreme Being (12,693 reputation)
Posted Tuesday May 20 2008
jcd77ehq (5/20/2008)
I'm using Live System to trade through Interactive Brokers and I'm having a bit of a problem with the stop-loss orders.  The market order to buy gets filled and the stop-limit order for my profit target goes through but the stop-loss order always comes back "Stop loss order rejected: the price does not conform to the minimum price variation for this contract."

I've searched the forum but I don't seem to see this problem mentioned.  Any help is appreciated.  Thanks. 

 

I've seen this trading YM when I used a percentage stop loss. The actual price when converted was decimal  which is a fraction of the minimum tick size of the contract. IB would fire the error and then round/trunc the price and leave it in the window untransmitted. You must make sure that the stop, once converted to a price is an increment of minimum tick size.

i.e. YM is trading at 12800:

A) Send order to buy at LIM 12801 [order accepted and filled]

B) Send 0.005% STP Loss order [Accepted if based on 12800 (64pt stop -12736 ) but rejected if based on 12801 (64.005 pt stop 12736.995)

note YM tick size = 1

 

hope this helps


DoQ_Indicators
"better is the enemy of good enough"
Posted Tuesday May 20 2008
DoQ (5/20/2008)
I've seen this trading YM when I used a percentage stop loss. The actual price when converted was decimal  which is a fraction of the minimum tick size of the contract. IB would fire the error and then round/trunc the price and leave it in the window untransmitted. You must make sure that the stop, once converted to a price is an increment of minimum tick size.

i.e. YM is trading at 12800:

A) Send order to buy at LIM 12801 [order accepted and filled]

B) Send 0.005% STP Loss order [Accepted if based on 12800 (64pt stop -12736 ) but rejected if based on 12801 (64.005 pt stop 12736.995)

note YM tick size = 1

 

hope this helps

That sounds like it may be the problem.  I'll have to look into it and see how the stop order is being transmitted.  Thanks for the tip.

John

phg
Supreme Being (48,657 reputation)Supreme Being (48,657 reputation)Supreme Being (48,657 reputation)Supreme Being (48,657 reputation)Supreme Being (48,657 reputation)Supreme Being (48,657 reputation)Supreme Being (48,657 reputation)Supreme Being (48,657 reputation)Supreme Being (48,657 reputation)
Posted Wednesday May 21 2008
Futures have varying increments. Here's (very inefficient) C# code to figure it out:

// Compute the trailing stop offset. Does rounding and sets intergral number of increments.

// (Could be done more efficiently.)

private double RoundIncrement(double rawAmount)

{

double w = rawAmount; // Start.

double x = w + tradeIncrement*0.499; // Add round up/down control, conservative.

x = Math.Round(w,2); // Round to 2 decimal places.

double y = Math.Floor(x); // Get integer part.

double z = (x - y); // Get fractional part.

double n = Math.Floor(z/tradeIncrement); // How many integral trade increments in the fraction?

double r = Math.Round(y + n*tradeIncrement,2); // Attach increments to integer part.

string msg = string.Format("Trail: submitted={0:F3} raw={1:F3} n={2}", r, w, n);

OutputMessage(msg);

return r;

}

rawAmount is the amount to be rounded. tradeIncrement is whatever is appropriate for the instrument. YM is 1. ES and NQ are 0.25. Stocks are .01.



-Pete

See also Yahoo group about applying RE.



Similar Topics


Reading This Topic


2005-2017 © RightEdge Systems