/*谁能帮我看看这个自定义函数库有什么问题吗?编译没问题,运行的时候不起作用为什么?有没有人给我指导一下,有愿意平时帮我解答一些问题的请与我联系,价格可以商量*/
void 户口检查()
{
double 历史总下单量=0;
double 历史总盈亏=0;
double 历史下单量=0;
double 历史盈亏=0;
int mbbo=0,mbbprofito=0,msso=0,mssprofito=0,bb=0,bbprofit=0,ss=0,ssprofit=0,bb1=0,bbprofitl=0,ssl=0,ssprofitl=0,
mosl=0,mobs=0,mobl=0,profitmm=0,TOTALLOTS=0,TLOTSS=0,s=0,
ossa=0,osla=0,obsa=0,obla=0,Twbs=0,Twin=0,T1bs=0,Tloss=0,
SLOTS=0,mbb=0,mbbprofit=0,BLOTS=0,mss=0,mssprofit=0,moss=0,
sprofit=0,LastPricebuy=0,LastPricesell=0,tlotsb=0,b=0,
SLASTLOTS=0,bprofit=0,TLOTS=0,oss=0,osl=0,obs=0,obl=0,BLASTLOTS=0;
for (int i=0; i<OrdersHistoryTotal(); i++) //OrdersHistoryTotal历史已平仓订单的数量
{
if(OrderSelect(i,SELECT_BY_POS,MODE_HISTORY)==true)
{
if(OrderType()==OP_BUY || OrderType()==OP_SELL)
{
历史总下单量+=OrderLots();
历史总盈亏+=OrderProfit()+OrderCommission()+OrderSwap();
}
if(OrderSymbol()==货币对)
{
历史下单量+=OrderLots();
历史盈亏+=OrderProfit()+OrderCommission()+OrderSwap();
if(OrderType()==OP_BUY)
{
mbbo++;
mbbprofito+=OrderProfit()+OrderSwap()+OrderCommission();}
if (OrderType() == OP_SELL)
{
msso++;
mssprofito+=OrderProfit()+OrderSwap()+OrderCommission();}
}
}
}
for (int cnt=0; cnt<OrdersTotal(); cnt++)
{
if(OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES)==true)
{
if (OrderType()==OP_BUY&&OrderMagicNumber()==MAGIC)
{
bb++;
bbprofit+=OrderProfit()+OrderSwap()+OrderCommission();
}
if(OrderType()==OP_SELL&&OrderMagicNumber()==MAGIC)
{
ss++;
ssprofit+=OrderProfit()+OrderSwap()+OrderCommission();
}
if(OrderType()==OP_BUY)
{bb1++;
bbprofitl+=OrderProfit()+OrderSwap()+OrderCommission();
}
if(OrderType()==OP_SELL)
{ssl++;
ssprofitl+=OrderProfit()+OrderSwap()+OrderCommission();
}
if(OrderType()==OP_SELLSTOP){ossa++;}
if(OrderType()==OP_SELLLIMIT){osla++;}
if(OrderType()==OP_BUYSTOP){obsa++;}
if(OrderType()==OP_BUYLIMIT){obla++;}
if((OrderType()==OP_BUY || OrderType()==OP_SELL)&&(OrderProfit()+OrderSwap()+OrderCommission())>0)
{
Twbs++;Twin+=OrderProfit()+OrderSwap()+OrderCommission();}
if((OrderType()==OP_BUY || OrderType()==OP_SELL)&&(OrderProfit()+OrderSwap()+OrderCommission())<0)
{T1bs++;Tloss+=OrderProfit()+OrderSwap()+OrderCommission();}
if((OrderType()==OP_BUY || OrderType()==OP_SELL))
{TOTALLOTS+=OrderLots();}
if(OrderSymbol()==货币对)
{
if(OrderType()==OP_BUY)
{
BLOTS+=OrderLots();mbb++;
mbbprofit+=OrderProfit()+OrderSwap()+OrderCommission();}
if (OrderType()==OP_SELL)
{
SLOTS+=OrderLots();mss++;
mssprofit+=OrderProfit()+OrderSwap()+OrderCommission();
}
if(OrderType()==OP_SELLSTOP){moss++;}
if(OrderType()==OP_SELLLIMIT){mosl++;}
if(OrderType()==OP_BUYSTOP){mobs++;}
if(OrderType()==OP_BUYLIMIT){mobl++;}
profitmm+=OrderProfit()+OrderSwap()+OrderCommission();
}
if(OrderSymbol()==货币对&&OrderMagicNumber()==MAGIC)
{
if(OrderType()==OP_SELL)
{
TLOTSS+=OrderLots();
s++;SLASTLOTS=OrderLots();
sprofit+=OrderProfit()+OrderSwap()+OrderCommission();
LastPricesell=OrderOpenPrice();
}
if(OrderType()-OP_BUY)
{
tlotsb+=OrderLots();b++;BLASTLOTS=OrderLots();
bprofit+=OrderProfit()+OrderSwap()+OrderCommission();
LastPricebuy=OrderOpenPrice();
}
if(OrderType()==OP_SELL || OrderType()==OP_BUY)
{TLOTS+=OrderLots();}
if(OrderType()==OP_SELLSTOP){oss++;}
if(OrderType()==OP_SELLLIMIT){osl++;}
if(OrderType()==OP_BUYSTOP){obs++;}
if(OrderType()==OP_BUYLIMIT){obl++;}
}
}
}
} |