Dear Dukascopy and all: I test the EA on jforex platform, while it is all ok on a MT4 platform , but on jforex , it will always pops up many orders of the same price, which will occur many margins. so I want to ask how to solve this problem ?
below is the codes in MT4 to check the same Price order, which is OK in MT4 :
//--------------------------------------------------
int IsPosition(double ad_0, double ad_8, int ai_16) {// check if there is a same postion int l_cmd_20; int l_ord_total_24 = OrdersTotal(); for (int l_pos_28 = 0; l_pos_28 < l_ord_total_24; l_pos_28++) { OrderSelect(l_pos_28, SELECT_BY_POS); if (OrderSymbol() == Symbol() && OrderMagicNumber() == uniqueGridMagic || OrderComment() == gs_grid_280) { l_cmd_20 = OrderType(); if (MathAbs(OrderOpenPrice() - ad_0) < 0.9 * ad_8)// 表示价格和已经开仓价格小于判断的ad_8来判断是否已经有价格重复,这里用 0.9 * ad_8。 if ((ai_16 && l_cmd_20 == OP_BUY || l_cmd_20 == OP_BUYLIMIT || l_cmd_20 == OP_BUYSTOP) || (!ai_16 && l_cmd_20 == OP_SELL || l_cmd_20 == OP_SELLLIMIT || l_cmd_20 == OP_SELLSTOP)) return (1); } } return (0); }
//--------------------------------------------------
Attachments: |
Chart_USD_JPY_5 Mins_snapshot_ManySamePricesProblem.PNG [29.44 KiB]
Downloaded 369 times
|
DISCLAIMER: Dukascopy Bank SA's waiver of responsability - Documents, data or information available on
this webpage may be posted by third parties without Dukascopy Bank SA being obliged to make any control
on their content. Anyone accessing this webpage and downloading or otherwise making use of any document,
data or information found on this webpage shall do it on his/her own risks without any recourse against
Dukascopy Bank SA in relation thereto or for any consequences arising to him/her or any third party from
the use and/or reliance on any document, data or information found on this webpage.
|
|