- void FilterBuyClose () {
- int son_in_1[30][2];
-
- //----------------------------
- int temp_in_4;
- int temp_in_5;
- int temp_in_6;
-
- if ( Ask >= iMA(NULL,0,20,0,MODE_SMA,PRICE_MEDIAN,0) ) return;
- if ( Ask - Bid <= MaxSpread * all_do_1 * Point() ) {
- temp_in_4 = OrdersTotal();
- temp_in_5 = 0;
- for (temp_in_6 = 0 ; temp_in_6 < temp_in_4 ; temp_in_6=temp_in_6 + 1) {
- if ( ( !(OrderSelect(temp_in_6,SELECT_BY_POS,MODE_TRADES)) || (OrderType() == 1 && OrderSymbol() == Symbol() && OrderMagicNumber() == 2) ) ) {
- son_in_1[temp_in_5][0] = OrderOpenTime();
- son_in_1[temp_in_5][1] = OrderTicket();
- temp_in_5=temp_in_5 + 1;
- }
- }
- if ( temp_in_5 > 1 ) {
- ArrayResize(son_in_1,temp_in_5,0);
- ArraySort(son_in_1,0,0,1);
- }
- for (temp_in_6 = 0 ; temp_in_6 < temp_in_5 ; temp_in_6=temp_in_6 + 1) {
- if ( OrderSelect(son_in_1[temp_in_6][1],SELECT_BY_TICKET,MODE_TRADES) == true && OrderClose(OrderTicket(),OrderLots(),OrderClosePrice(),MaxSlippage,Red) == false ) {
- Print("OrderClose() error - ",ErrorDescription(GetLastError()));
- }
- }
- }
- ArrayFree(son_in_1);
- }
复制代码
这个代码 这里是不是错了
if ( Ask >= iMA(NULL,0,20,0,MODE_SMA,PRICE_MEDIAN,0) ) return;
按照策略 是多单在布林带中轨 平仓,但是代码 在这里却退出了 |