Open Long order at (HullMovingAverage(Main chart,HullMovingAvrPrd2, PRICE_OPEN)[HullMovingAverageShf] - (PriceEntryMult * ATR(Main chart,ATRPeriod)[ATRShift])) Limit;
Open Long order at (DEMA(Main chart,DEMAPeriod,DEMAAppliedPrice) [DEMAShift] - (PriceEntryMult * ATR(Main chart,ATRPeriod)[ATRShift])) Limit;
Subject changed from [B135] Different results between SQX <-> MT5 with tick data if using HMA for pending order prices to [B135] Different results between SQX <-> MT5 with tick data if using HMA or DEMA for pending order prices
Description changed:
Open Long order at (HullMovingAverage(Main chart,HullMovingAvrPrd2, PRICE_OPEN)[HullMovingAverageShf] - (PriceEntryMult * ATR(Main chart,ATRPeriod)[ATRShift])) Limit;
Open Long order at (DEMA(Main chart,DEMAPeriod,DEMAAppliedPrice) [DEMAShift] - (PriceEntryMult * ATR(Main chart,ATRPeriod)[ATRShift])) Limit;
Description changed:
Open Long order at (HullMovingAverage(Main chart,HullMovingAvrPrd2, PRICE_OPEN)[HullMovingAverageShf] - (PriceEntryMult * ATR(Main chart,ATRPeriod)[ATRShift])) Limit;
Open Long order at (DEMA(Main chart,DEMAPeriod,DEMAAppliedPrice) [DEMAShift] - (PriceEntryMult * ATR(Main chart,ATRPeriod)[ATRShift])) Limit;
Description changed:
Open Long order at (HullMovingAverage(Main chart,HullMovingAvrPrd2, PRICE_OPEN)[HullMovingAverageShf] - (PriceEntryMult * ATR(Main chart,ATRPeriod)[ATRShift])) Limit;
Open Long order at (DEMA(Main chart,DEMAPeriod,DEMAAppliedPrice) [DEMAShift] - (PriceEntryMult * ATR(Main chart,ATRPeriod)[ATRShift])) Limit;
Description changed:
Open Long order at (HullMovingAverage(Main chart,HullMovingAvrPrd2, PRICE_OPEN)[HullMovingAverageShf] - (PriceEntryMult * ATR(Main chart,ATRPeriod)[ATRShift])) Limit;
Open Long order at (DEMA(Main chart,DEMAPeriod,DEMAAppliedPrice) [DEMAShift] - (PriceEntryMult * ATR(Main chart,ATRPeriod)[ATRShift])) Limit;
Description changed:
Open Long order at (HullMovingAverage(Main chart,HullMovingAvrPrd2, PRICE_OPEN)[HullMovingAverageShf] - (PriceEntryMult * ATR(Main chart,ATRPeriod)[ATRShift])) Limit;
Open Long order at (DEMA(Main chart,DEMAPeriod,DEMAAppliedPrice) [DEMAShift] - (PriceEntryMult * ATR(Main chart,ATRPeriod)[ATRShift])) Limit;
Attachment SqHullMovingAverage.mq5 added
Just a little update, using DEMA the problem persists, it´s calculated slightly differently in SQX and MT5. If using it as a profit target (TP), it´s easiest to see that DEMA is always off by about 0.3 to 1 pip between SQX and MT5.
The HMA I´ve fixed in MT5 (see attachment above), is all good now, everything matches.
indicatorHandles[DEMA_1] = iCustom(NULL,0, "SqDEMA", DEMAPeriod, 2);
I´ve tried replacing it with "iDEMA(NULL, 0, DEMAPeriod, 2, PRICE_HIGH)" in the MQL5 code, to assign the correct PRICE enumeration like the SQX strategy that I use uses it (HIGH), but even then the backtests don´t match while they do if using other MA indicators in SQX. There must be more issues between how this is implemented between SQX and MT5, but I am giving up for now and hope this get´s addressed by your coders. Thanks a lot.
P.S.: Additionally, here is one more bug: if 2 DEMA´s are used in one strategy in SQX, the variable DEMAAppliedPrice is always the same for all DEMA´s, it´s not being enumerated like the DEMAPeriod (e.g. DEMAPeriod2), etc.
Attachment SqHullMovingAverage.mq5 added
Here is a fixed version of indicator SqHullMovingAverage.mq5
Attachment Untitled.png added
Unfortunately, the DEMA is still completely wrong calculated between SQX and MT5. Only the HMA has been fixed. Please fix the DEMA as well. Thanks.
P.S.: I´ve attached a screenshot of a strategy that uses DEMA for the entry price of LIMIT orders. There is no match between SQX and MT5 using the exact same tick-data / time range. If exchanging DEMA for EMA, HMA, etc., the backtests match up perfectly.
Attachment Untitled.png added
Anything that uses the DEMA indicator leads to incorrect backtests in MT5. The results between your DEMA implementation in SQX and MT5 are not coherent. It's calculated differently in SQX than in the MT5 implementation. Hence no backtest will match between SQX and MT5 if the DEMA indicator is used somewhere in a strategy. This applies for all strategies.
The same problem existed for the HMA indicator which was also part of this bug report. But the HMA was fixed and the bug closed. Someone forgot to also fix the DEMA issue.
Status changed from In progress to Waiting for information
Attachment Capture.jpg added
I have checked our SQX and couldn't find DEMA.
If you could provide me where you download and import the DEMA. I can check it.
Thanks.