下载MetaTrader 5
要添加评论,请登录注册
追踪市场的顶尖卖家!
gget
410
gget 2008.06.30 20:54 

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 !

tuzi
63
tuzi 2008.07.01 06:17  

sell a buy position is at its bid price

use Bid-buysl

tuzi
63
tuzi 2008.07.01 06:19  
but buysl=170, there shoud not be an error.haha
Rashid Umarov
管理员
6605
Rashid Umarov 2008.07.01 11:13  

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().

gget
410
gget 2008.07.01 14:52  
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
410
gget 2008.07.03 06:36  
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 !

Rashid Umarov
管理员
6605
Rashid Umarov 2008.07.03 11:52  

ticket = OrderSend(....);

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

/
要添加评论,请登录注册