Dear Mr. Rosh,Please help me,Thanks

 

Mr Rosh,

I met a problem

The terminal log said: "2008.07.01 02:29:11 AA_SMLTv5 EURUSD,H1: Error opening BUY order : 130"

But I check the EA that I don't find why it said "Error 130"(ERR_INVALID_STOPS)?

The program like this:

..............

double buysl=170;

..............

ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,Ask-buysl*Point,0,"SMLTv8",1234,0,Green);

........

If I replace "Ask-buysl*Point" with 0,it's ok !

I think the "Ask-buysl*Point" is not wromg.

To be wacky ! the EA was passed doing the back test and only has the problem with the demo test

Please help me !

Thank you in advance !

 

sell a buy position is at its bid price

use Bid-buysl

 
but buysl=170, there shoud not be an error.haha
 

Check what mode of order execution you broker provides - instant execution or market execution?

If mode is "market execution" then you must open an order in two stages:

1. Open an order by OrderSend() without StopLoss and TakeProfit;

2. After the order is opened set SL and/or TP levels by function OrderModify().

 
Rosh >>

Check what mode of order execution you broker provides - instant execution or market execution?

If mode is "market execution" then you must open an order in two stages:

1. Open an order by OrderSend() without StopLoss and TakeProfit;

2. After the order is opened set SL and/or TP levels by function OrderModify().

Thank you for reply !

Question two :

1. Somebody told me that the market execution is only for futures not for Forex

Where can I get the meanings of both "instant execution" and "market execution"

2. Now I have to do two stages to finish one open order :

The OrderSend() and the OrderModify()

Do you think I need to insert sleep(int x); between the two stages ?

To avoid the OrderSend() is not accepted by the broker's server ?

Or may be you have some better suggestions ?

Thank you again !

 
gget >>

To avoid the OrderSend() is not accepted by the broker's server ?

Or may be you have some better suggestions ?

Thank you again !

Mr Rosh

Please give me some suggestions

How to make sure the server accepted the ask(OrderSend()) stably ?

Or how to find the server not accepted and how to send the ask again ?

I found the EA was passed during back testing,but for demo testing using OrderSend() is not so good !

The broker's server sometime ignore the signal !

 

ticket = OrderSend(....);

if (ticket < 0 ) Print("OrderSend failed wint error=",GetLastError());

原因: