int HistoryTotal( ) 返回历史数据的数量// retrieving info from trade history int i, hstTotal=HistoryTotal(); for(i=0;i< } to break; ---- check selection result if (OrderSelect(i,SELECT_BY_POS,MODE_HISTORY)="=false)" Print(?Access his tory failed error (?,GetLastError(),?)?); some work with order> bool OrderClose( int ticket, double lots, double price, int slippage, color Color=CLR_NONE) 对订单进行平仓操作。:: 输入参数 ticket - 订单编号 lot s- 手数 price - 平仓价格 slippage - 最高划点数 Color - 标记颜色示例: if(iRSI(NU LL,0,14,PRICE_CLOSE,0)>75) { OrderClose(order_id,1,Ask,3,Red); return(0); } bool OrderCloseBy( int ticket, int opposite, color Color=CLR_NON E) 对订单进行平仓操作。:: 输入参数 ticket - 订单编号 opposite - 相对订单编号 Col or- 标记颜色示例: if(iRSI(NULL,0,14,PRICE_CLOSE,0)>75) { OrderCloseBy(o rder_id,opposite_id); return(0); } double OrderClosePrice( ) 返回订单的平仓价示例: if(OrderSelect(ticket,SEL ECT_BY_POS)==true) Print("Close price for the order ",ticket," = ",OrderCl osePrice()); else Print("OrderSelect failed error code is",GetLastError()); datetime OrderCloseTime( ) 返回订单的平仓时间示例: if(OrderSelect(10,SE LECT_BY_POS,MODE_HISTORY)==true) { datetime ctm=OrderOpenTime(); if(ctm>0) Print("Open time for the order 10 ", ctm); ctm=OrderCloseTime (); if(ctm>0) Print("Close time for the order 10 ", ctm); } else Print("Orde rSelect failed error code is",GetLastError()); string ment( ) 返回订单的注释示例: ment; if(OrderSel ect(10,SELECT_BY_TICKET)==false) { Print("OrderSelect failed error code i s",GetLastError()); return(0); } comment = ment(); // ... double mission( ) 返回订单的佣金数示例: if(OrderSelect(10,SELE CT_BY_POS)==true) Print("Commission for the order 10 ",missio n()); else Print("OrderSelect failed error code is",GetLastError()); bool OrderDelete( int ticket) 删除未启用的订单:: 输入参数 ticket - 订单编号示例: if(Ask>var1) { OrderDelete(order_ticket); return(0); } datetime OrderExpiration( ) 返回代办订单的有效日期示例: if(OrderSelect(10, SELECT_BY_TICKET)==true) Print("Order expiration for the order #10 is ", OrderExpiration()); else Print("OrderSelect failed error code is",GetLas
MT4交易解释分析报告 来自淘豆网m.daumloan.com转载请标明出处.