下载MetaTrader 5

为什么会多次执行呢?

要添加评论,请登录注册
glennking
87
glennking  
int start()
{
int LARGENUMBER = 100000;
int _orderIdBuy = -1;
int _orderIdSell = -1;

//step1
OrderSend(Symbol(), OP_BUYSTOP, _number, Bid + _pendingPoint * Point, 0, Bid + _pendingPoint * Point - _lossPoint * Point, Bid + _pendingPoint * Point + _getPoint * Point, "some comment", 16384, 0, Green);
OrderSend(Symbol(), OP_SELLSTOP, _number, Ask - _pendingPoint * Point, 0, Ask - _pendingPoint * Point + _lossPoint * Point, Ask + _pendingPoint * Point - _getPoint * Point, "some comment", 16384, 0, Green);
//step2


}
okwh
1635
okwh  

使用如下代码保证没个周期最多交易一次(start()一次)

datetime lasttime=NULL;
int start()
{
if (Time[0] == lasttime ) return(0);
lasttime = Time[0] ;

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

要添加评论,请登录注册