有您的持续关注
我们会做得更好

EA计算仓中订单的总量的函数模块



计算你仓中订单的总量的函数模块
double GetOrderLot(){
for (int i=0; i<OrdersTotal(); i++){
if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)){double lot = OrderLots();}}
if(lot==0){lot=Lots;}else{lot=lot+Lots;}
return(lot);}
以此可以计算你的亏损的多单的张数
int CheckOpenBUYPositions()
{
int cnt, NumPositions;
int NumBuyTrades, NumSellTrades; // Number of buy and sell trades in this symbol
NumBuyTrades = 0;
NumSellTrades = 0;
for(cnt=OrdersTotal()-1;cnt>=0;cnt–)
{
OrderSelect (cnt, SELECT_BY_POS, MODE_TRADES);
if ( OrderSymbol() != Symbol()) continue;
if ( OrderMagicNumber() != QQ) continue;
if(OrderType() == OP_BUY &&OrderProfit() < 0)
{
NumBuyTrades++;
}
return (NumBuyTrades);
}
}

如您喜欢此文章请点下面分享按钮↴峰汇在线 » EA计算仓中订单的总量的函数模块
上一篇:
下一篇:
分享到:更多 ()