Both indicator handles use the fast-period inputs. The declared slow-period settings are not passed to the second handle.
Hull Moving Average: Turning Points
Combines a moving-average direction condition with a faster turning-point pattern and percentage exits.
How the source is structured
- Create two handles for the custom HMA indicator.
- On a new H1 bar, compare the slower slope with a three-value turning pattern in the faster buffer.
- Attempt a fixed-volume long or short with percentage-based exit prices.
Default inputs
| Volume | 0.1 lot |
|---|---|
| Declared fast / slow periods | 7 / 50 |
| Stop / target inputs | 0.5% / 0.5% |
| Indicator period | H1 |
Source-review notes
These observations come from reading this uploaded version. They are not compiler output or a complete code audit. The download retains the source as supplied.
The buy take-profit is calculated below the ask, in the same direction as the buy stop loss.
Indicator-handle validity and CopyBuffer results are not checked.
Dependencies
Market\HMA Color with Alerts MT5.ex5 is required and was not supplied. The referenced custom indicator is not part of this download.
Source & attribution
The original filename includes 'Rene'; the source contains no author or license declaration.
Included in the Edge Quant source collection with existing notices preserved. Free download does not imply a new license grant.
Inspect the original source
The browser preview is decoded for reading; the download keeps the original file bytes.
Expand full MQL5 source · 70 lines
#include <Trade/Trade.mqh>input double Lots = 0.1;input double TpPercent = 0.5;input double SlPercent = 0.5;input ENUM_TIMEFRAMES HmaTimeframe = PERIOD_H1;input int HmaFastPeriod = 7;input ENUM_MA_METHOD HmaFastMethod = MODE_LWMA;input ENUM_APPLIED_PRICE HmaFastAppPrice = PRICE_CLOSE;input int HmaSlowPeriod = 50;input ENUM_MA_METHOD HmaSlowMethod = MODE_LWMA;input ENUM_APPLIED_PRICE HmaSlowtAppPrice = PRICE_CLOSE;int hmaHandleFast;int hmaHandleSlow;datetime timestamp;CTrade trade;int OnInit(){ hmaHandleFast = iCustom(_Symbol,HmaTimeframe,"Market\\HMA Color with Alerts MT5.ex5","",HmaFastPeriod,HmaFastMethod,HmaFastAppPrice,"",false,false,false,false,"","",false,false); hmaHandleSlow = iCustom(_Symbol,HmaTimeframe,"Market\\HMA Color with Alerts MT5.ex5","",HmaFastPeriod,HmaFastMethod,HmaFastAppPrice,"",false,false,false,false,"","",false,false); return(INIT_SUCCEEDED); }void OnDeinit(const int reason){ }void OnTick(){ datetime time0 = iTime(_Symbol,HmaTimeframe,0); if(timestamp != time0){ timestamp = time0; double hmaFast[],hmaSlow[]; CopyBuffer(hmaHandleFast,MAIN_LINE,1,3,hmaFast); CopyBuffer(hmaHandleSlow,MAIN_LINE,1,2,hmaSlow); double ask = SymbolInfoDouble(_Symbol,SYMBOL_ASK); double bid = SymbolInfoDouble(_Symbol,SYMBOL_BID); if(hmaSlow[1] > hmaSlow[0]){ if(hmaFast[2] > hmaFast[1] && hmaFast[1] < hmaFast[0]){ double sl = ask - ask*SlPercent/100; double tp = ask - ask*TpPercent/100; trade.Buy(Lots,_Symbol,ask,sl,tp); } }else if (hmaSlow[1] < hmaSlow[0]){ if (hmaFast[2] < hmaFast[1] && hmaFast[1] > hmaFast[0]){ double sl = bid + bid*SlPercent/100; double tp = bid - bid*TpPercent/100; trade.Sell(Lots,_Symbol,bid,sl,tp); } } } }Educational source material, not investment advice. No profitability, execution quality or live-readiness claim is made for this upload.