{
datetime last time = D ' 2015.01.01 00:00 ';
雙倍利潤=-1.0;
if(ordershistortotal()= = 0)返回利潤;
for(int I = ordershistortotal()-1;我& gt=0;我- ){
if (OrderSelect(i,SELECT_BY_POS,MODE_HISTORY)==true)
{
If (OrderSymbol() == Symbol() ){ //只統計當前對應的貨幣對。
if(order type()= = OP _ BUY | | order type()= = OP _ SELL){
if(OrderCloseTime()& gt;上次){
last time = OrderCloseTime();
利潤= order profit();
}
}
}
}
}
回報利潤;
}