我正在使用正在使用正向測試運行的EA,但我一直遇到問題。我不能在不同的圖表上同時有活動訂單(每個圖表代表不同的一對)。

我每次都進行符號檢查,但似乎無法找到為什麼不應用多個不同貨幣的訂單。確實發生了不同配對的交易,但每次只有一對。我希望有多對具有有效訂單,每對一次只能有一個訂單。但我有一個訂單發生一次所有對。

以下是觸發訂單的關鍵代碼。我錯過了什麼嗎?

感謝您的幫助。

碼:

Quote Originally Posted by ;
int start()
{
int count;

if(Barslt; 100){打印(小於100);返回(0); }

總= OrdersTotal();

if(trend!= 0){last_trend = trend; }
趨勢= MACD_Direction();
強度= trend_strength();

if(pending_timegt; 0)last_pending_time = pending_time;

為(計數= 0; countlt;總;計數 )GT;
{
OrderSelect(count,SELECT_BY_POS,MODE_TRADES);
if(OrderType()lt; = OP_SELL OrderSymbol()== Symbol())
{
if(OrderType()== OP_BUY find_highest)
{
trailing_stop(1);
if(Close [0] gt; = OrderOpenPrice() Point * 5){pending_time = 0; revival_attempts = 0; opposite_trend_duration = 0; opp_trend_period = 0; }
if(Close [0] lt; orderopenprice() point * 5){= pending_time = last_loss = OrderOpenPrice() Point * 5-Close [0]; opp_trend_period = 0;} LT; BRGT; if(strengthlt; = - 0.95 * MACD_level)opp_trend_period ;
if(best_deal()gt; 0)ClosePending();
}
else if(OrderType()== OP_SELL find_lowest)
{
trailing_stop(2);
if(Close [0] lt; = OrderOpenPrice() - Point * 5){pending_time = 0; revival_attempts = 0; opp_trend_period = 0; }
if(Close [0] gt; OrderOpenPrice() - Point * 5)pending_time ;
if(strengthgt; = 0.95 * MACD_level)opp_trend_period ;
if(best_deal()gt; 0)ClosePending();
}
}
}

if(trendgt; 0 strengthgt; = 0.95 * MACD_level){buy_flag = true; sell_flag = FALSE; last_trend =趨勢; }
if(trendlt; 0 strengthlt; = - 0.95 * MACD_level){sell_flag = true; buy_flag = FALSE; last_trend =趨勢; }

if((sell_flag == true || buy_flag == true)total == 0 trend!= 0)
{
if(buy_flag == true)do_order(1);
if(sell_flag == true)do_order(2);
}
}
LT;orderopenprice() 點* 5)GT; LT總;計數 )GT;