# 怎么确认刚刚平掉的单子是赢是亏？？

74

int i,hstTotal=OrdersHistoryTotal();
for(i=0;i<hstTotal;i++)
{

OrderSelect(i, SELECT_BY_POS,MODE_HISTORY)；

if(OrderProfit（）>0)

....................

1637

74

DxdCn 写道 >>

OrderSelect(OrdersHistoryTotal()-1, SELECT_BY_POS,MODE_HISTORY);

if(OrderProfit()>0) lots-=zuixiaoshou;
if(OrderProfit()<0) lots+=zuixiaoshou;
if(lots<0.1) lots=0.1;
if(lots>100) lots=100;

1637

OrderSelect(OrdersHistoryTotal()-1, SELECT_BY_POS,MODE_HISTORY);

if(OrderProfit()>0) lots-=zuixiaoshou;
if(OrderProfit()<0) lots+=zuixiaoshou;

Print(OrderProfit()," ot ",TimeToString(OrderOpentTime()), " ct ", TimeToString(OrderCloseTime()), " l ",lots, " at ", TimeToString(iTime(NULL, Period_M1,0)));
if(lots<0.1) lots=0.1;
if(lots>100) lots=100;

74

DxdCn 写道 >>

OrderSelect(OrdersHistoryTotal()-1, SELECT_BY_POS,MODE_HISTORY);

if(OrderProfit()>0) lots-=zuixiaoshou;
if(OrderProfit()<0) lots+=zuixiaoshou;

Print(OrderProfit()," ot ",TimeToString(OrderOpentTime()), " ct ", TimeToString(OrderCloseTime()), " l ",lots, " at ", TimeToString(iTime(NULL, Period_M1,0)));
if(lots<0.1) lots=0.1;
if(lots>100) lots=100;