Attachments forums

List of attachments posted on this forum.


All files on forums: 138326

Re: HMA - Hull Moving Average Indicators MT4

krikil86, Fri Jan 24, 2020 2:51 pm

i have create EA for this indicator Here the EA code.

Code: Select all

extern ENUM_TIMEFRAMES   TimeFrame             = PERIOD_H4;        // Time frame
extern int               HMAPeriod             = 15;               // Hma Period to use
input enPrices           HMAPrice              = pr_close;         // Price to use
input enMaTypes          HMAMethod             = ma_lwma;          // Hma average type
input double             HMASpeed              = 1.8;              // Hma Speed
input int                HistoWidth            = 3;                // Histogram bars width
input color              UpHistoColor          = clrLimeGreen;     // Up histogram color
input color              DnHistoColor          = clrRed;           // Down histogram color
input bool               alertsOn              = false;            // Turn alerts on?
input bool               alertsOnCurrent       = false;            // Alerts on still open bar?
input bool               alertsMessage         = false;            // Alerts should show popup message?
input bool               alertsSound           = false;            // Alerts should play a sound?
input bool               alertsEmail           = false;            // Alerts should send email?
input bool               alertsPushNotif       = false;            // Alerts should send notification?
input bool               verticalLinesVisible  = false;            // Show vertical lines
input bool               linesOnNewest         = false;            // Vertical lines drawn on newest bar of higher time frame bar?
input string             verticalLinesID       = "hma Lines";      // Lines ID
input color              verticalLinesUpColor  = clrDeepSkyBlue;   // Lines up color 
input color              verticalLinesDnColor  = clrPaleVioletRed; // Lines down color
input ENUM_LINE_STYLE    verticalLinesStyle    = STYLE_DOT;        // Lines style
input int                verticalLinesWidth    = 0;                // lines width

double Value01     = iCustom(Symbol(), 0, "HMA Histo 1.01 (mtf + alerts + lines)", TimeFrame, HMAPeriod, HMAPrice, HMAMethod, HMASpeed, HistoWidth, UpHistoColor, DnHistoColor, alertsOn, alertsOnCurrent, alertsMessage, alertsSound, alertsEmail, alertsPushNotif, verticalLinesVisible, linesOnNewest, verticalLinesID, verticalLinesUpColor, verticalLinesDnColor, verticalLinesStyle, verticalLinesWidth, 0, 1);
double Value11     = iCustom(Symbol(), 0, "HMA Histo 1.01 (mtf + alerts + lines)", TimeFrame, HMAPeriod, HMAPrice, HMAMethod, HMASpeed, HistoWidth, UpHistoColor, DnHistoColor, alertsOn, alertsOnCurrent, alertsMessage, alertsSound, alertsEmail, alertsPushNotif, verticalLinesVisible, linesOnNewest, verticalLinesID, verticalLinesUpColor, verticalLinesDnColor, verticalLinesStyle, verticalLinesWidth, 1, 1);
   
double Value02     = iCustom(Symbol(), 0, "HMA Histo 1.01 (mtf + alerts + lines)", TimeFrame, HMAPeriod, HMAPrice, HMAMethod, HMASpeed, HistoWidth, UpHistoColor, DnHistoColor, alertsOn, alertsOnCurrent, alertsMessage, alertsSound, alertsEmail, alertsPushNotif, verticalLinesVisible, linesOnNewest, verticalLinesID, verticalLinesUpColor, verticalLinesDnColor, verticalLinesStyle, verticalLinesWidth, 0, 2);
double Value12     = iCustom(Symbol(), 0, "HMA Histo 1.01 (mtf + alerts + lines)", TimeFrame, HMAPeriod, HMAPrice, HMAMethod, HMASpeed, HistoWidth, UpHistoColor, DnHistoColor, alertsOn, alertsOnCurrent, alertsMessage, alertsSound, alertsEmail, alertsPushNotif, verticalLinesVisible, linesOnNewest, verticalLinesID, verticalLinesUpColor, verticalLinesDnColor, verticalLinesStyle, verticalLinesWidth, 1, 2);
   
         if (Value01 != EMPTY_VALUE && Value11 == EMPTY_VALUE && Value02 == EMPTY_VALUE && Value12 != EMPTY_VALUE)
         {
            return "BUY";
         }

         if (Value01 == EMPTY_VALUE && Value11 != EMPTY_VALUE && Value02 != EMPTY_VALUE && Value12 == EMPTY_VALUE)
         {
            return "SELL";
         }
when i backtest on EURUSD M30 and setting EA TimeFrame H4 EA OP BUY even though the indicator has not issued a BUY signal (marked X in red). when i forward test on EURUSD M30 and setting EA TimeFrame H4 EA OP BUY even though the indicator has not issued a BUY signal (marked X in red). but if i backtest on EURUSD M30 and setting EA TimeFrame current everything works fine. can anyone help?
All files in topic