// it is important to enter the market correctly, // but it is more important to exit it correctly... for( cnt=0; cnt< total; cnt++){OrderSelect( cnt, SELECT_BY_POS, MODE_TRADES);if(OrderType()<=OP_SELL&&// check for opened position OrderSymbol()==Symbol())// check for symbol{OrderSend(if(OrderType()==OP_BUY)// long position is opened{// should it be closed?if( ma_close< ma_open && ma_close_pr> ma_open_pr && low_n< low){OrderClose(OrderTicket(),OrderLots(),Bid,3,Violet);// close positionreturn(0);// exit}// check for trailing stopif( TrailingStop>0){if(Bid-OrderOpenPrice()>Point* TrailingStop){if(OrderStopLoss()<Bid-Point* TrailingStop){OrderModify(OrderTicket(),OrderOpenPrice(),Bid-Point* TrailingStop,OrderTakeProfit(),0,Green);return(0);}}}}else// go to short position{// should it be closed?if( ma_close> ma_open && ma_close_pr< ma_open_pr && high_n> high){OrderClose(OrderTicket(),OrderLots(),Ask,3,Violet);// close positionreturn(0);// exit}// check for trailing stopif( TrailingStop>0){if((OrderOpenPrice()-Ask)>(Point* TrailingStop)){if((OrderStopLoss()>(Ask+Point* TrailingStop))||(OrderStopLoss()==0)){OrderModify(OrderTicket(),OrderOpenPrice(),Ask+Point* TrailingStop,OrderTakeProfit(),0,Red);return(0);}}}}}}return(0);}// the end.
谢谢你!在这里 又找到了一些,也许有人会需要它。去完成圣杯:)
Если массив double а нужен int? Я правильно понял?
不,我在写MT4通过套接字与其他应用程序链接。Socket函数返回int数组。
我把这个dll导入EA。然而,要调用这个函数,需要在Expert Advisor中声明。
上面的声明可能不正确--来自dll的函数返回一个数组,而在Expert Advisor中声明的函数将返回一个单一的int。
如何在专家顾问中声明它,使其返回一个数组,而不是一个单一的数字?
谁知道呢?
如何以指定的精度格式指定一个可变的双数,而不对数字进行四舍五入,例如指定Bid=1.3988为Bid=1.398?
Кто знает?
Как указать переменную double в указаном формате точности без округление числа, к примеру Bid=1.3988 указать как Bid=1.398 ???
像这样?
全部整理好了,答案在这里:https://forum.mql4.com/ru/25945
请帮助...
\end_of_program' - 不平衡的左括号
第二部分。
Necron скобку где то не закрыл, ищи...
你把附录放在正确的代码中了吗?