OK I GIVE UP WHY WON'T THIS WORK

 

Can't get this order send to work, keep getting error 130 invalid stops

OrderSend(Symbol(),OP_BUY,lots, High[1],3, NormalizeDouble(High[1]-SL*Point,Digits),
NormalizeDouble(High[1] + TP*Point,Digits),"manage",703,0,Blue);

Print out values and I get:2009.06.03 12:17:50 2009.05.22 00:00 MANAGER EURUSD,H4: SL = 1.38943 TP = 1.39343 ENTRY = 1.39143

Clearly it is a buy, the Sl is well below the spread, the TP is well above the spread, the digits are correct.

Out of frustration I deleted the SL and TP and made them 0, when I do that I get 138 requote error.

I don't really know what that means, I had assumed it was a change in price which made the Order Send parameters out of

range that doesn't seem to be the case here since the orders are sent at the open of new candles based on the close of the previous candle so variance should be nil.

Any ideas, thoughts, suggestions, and/or correct answer deeply appreciated.

Keith

 
kminler:

Can't get this order send to work, keep getting error 130 invalid stops

OrderSend(Symbol(),OP_BUY,lots, High[1],3, NormalizeDouble(High[1]-SL*Point,Digits),
NormalizeDouble(High[1] + TP*Point,Digits),"manage",703,0,Blue);

Print out values and I get:2009.06.03 12:17:50 2009.05.22 00:00 MANAGER EURUSD,H4: SL = 1.38943 TP = 1.39343 ENTRY = 1.39143

Clearly it is a buy, the Sl is well below the spread, the TP is well above the spread, the digits are correct.

Out of frustration I deleted the SL and TP and made them 0, when I do that I get 138 requote error.

I don't really know what that means, I had assumed it was a change in price which made the Order Send parameters out of

range that doesn't seem to be the case here since the orders are sent at the open of new candles based on the close of the previous candle so variance should be nil.

Any ideas, thoughts, suggestions, and/or correct answer deeply appreciated.

Keith

You cannot execute a buy with High[1] quote price. Replace it with Ask or make it a pending order.

 
kminler wrote >>

Can't get this order send to work, keep getting error 130 invalid stops

OrderSend(Symbol(),OP_BUY,lots, High[1],3, NormalizeDouble(High[1]-SL*Point,Digits),
NormalizeDouble(High[1] + TP*Point,Digits),"manage",703,0,Blue);

Print out values and I get:2009.06.03 12:17:50 2009.05.22 00:00 MANAGER EURUSD,H4: SL = 1.38943 TP = 1.39343 ENTRY = 1.39143

Clearly it is a buy, the Sl is well below the spread, the TP is well above the spread, the digits are correct.

Out of frustration I deleted the SL and TP and made them 0, when I do that I get 138 requote error.

I don't really know what that means, I had assumed it was a change in price which made the Order Send parameters out of

range that doesn't seem to be the case here since the orders are sent at the open of new candles based on the close of the previous candle so variance should be nil.

Any ideas, thoughts, suggestions, and/or correct answer deeply appreciated.

Keith

Why do you use High[1] as an open price for order? you should use current price (Ask) + slippage at max. I think this is wrong.

Hope that helps.

 
robofx.org wrote >>

You cannot execute a buy with High[1] quote price. Replace it with Ask or make it a pending order.

Duh -- of course needs to be a pending order---knew I was going to feel dumb after this!!!

Many Thanks

Keith

Reason: