ID all 指的是同品种一起执行相关平仓指令; 最后一步的close all if,指的是整体的盈亏,可以用百分比,也可以用具体值,两个填一个就可以,填完点击OFF,会变成ON,也会自动计算另一个的值,然后不要去点旁边的L,点击L会自动清零,这是这个版本的bug,L指的是line,也就是在图表上展示对应盈亏的位置。
// 平仓指定持仓boolinvokeClosePositionSendAction(MqlTradeResult&resultReference,ulongticketPosition){if(!PositionSelectByTicket(ticketPosition)){Print("持仓订单:"+(string)ticketPosition+" 不存在!");returnfalse;}stringsymbol=PositionGetString(POSITION_SYMBOL);doublelots=PositionGetDouble(POSITION_VOLUME);int...
All pending orders are set to Good till cancel by default. If you want to set an expiration date, pass the date in timestamp format to expiration param. rep = api.construct_and_send(action="TRADE", actionType="ORDER_TYPE_SELL_LIMIT", symbol="EURUSD", "volume"=0.1, "price"=1.2, "...
The simplest and most effective way would be to equip each instance of a model with its own table of orders, which would consider all of the orders - both, pending, and those initiated by a deal or deleted. Extensive information on orders is stored on the trading server. Knowing the tick...
Stop limit orders Drawing of chart objects Installation Install ZeroMQ for MQL5https://github.com/dingmaotu/mql-zmq Put the following files from this repo to your MetaEditor Iinclude` directory Include/Json.mqh Include/controlerrors.mqh
b. the Buystop_steplower is the value in which aPENDING orderis triggered at your stopupper value. c. The trend line you draw is not the actual entry point, unless you change the "step" values to 0. d. IF buy order opens then closes due to sl or tp, and if Pr...
如果交易者想要所有订单平仓,那么只需单击 “Close All Orders” 按钮,所有持仓将被平仓。 3. 所有订单获利平仓 如果交易者想把所有盈利订单平仓,那么只需单击 “Close All Orders Profit” 按钮即可 把所有盈利持仓都平仓。 5. 管理订单和品种图表。
---+ bool DeletePending() { bool marker=false; //--- check all pending orders for(int i=OrdersTotal()-1; i>=0; i--) { if(myorder.Select(OrderGetTicket(i))) { if(myorder.Magic()==EA_Magic && myorder.Symbol()==_Symbol) { //--- check if order has stayed more than two...
函数 DeleteAllPendingOrders() 就是为此编写的,它删除所有指定品种的挂单: //+---+ //| Deletes all pending orders | //+---+ void DeleteAllPendingOrders(int symbol_number) { int total_orders =0; // Total number of pending orders ulong order_ticket =0; // Order ticket //--- Get the...
It works by: OnInit: Calls CloseAllOrders to shut down all market and pending orders. OnDeinit: Only logs deinitialization. OnTick: No action needed as orders are closed on start. CloseAllOrders: Loops from last to first order, retries up to 3 times to close/delete orders with error ...