My deepest thanks for you Mr. Tools, a great work as usual.

My deepest thanks for you Mr. Tools, a great work as usual.
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";
}
Maybe trykrikil86 wrote: Fri Jan 24, 2020 2:57 pm i have create EA for this indicator
HMA Histo 1.01 (mtf + alerts + lines).mq4
Here the EA code.
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).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"; }
1e8aaa4e-2536-4cfb-b022-6a82441eb2e7.jpg
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).
72b0b294-1c63-4df3-83fe-7caabfe6094f.jpg
but if i backtest on EURUSD M30 and setting EA TimeFrame current everything works fine.
97790bf8-192d-47e6-86bf-ec08316d5c9e.jpg
can anyone help?
Code: Select all
double Value01 = iCustom(_Symbol,TimeFrame,"HMA Histo 1.01 (mtf + alerts + lines)", 0, 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,TimeFrame,"HMA Histo 1.01 (mtf + alerts + lines)", 0, 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,TimeFrame,"HMA Histo 1.01 (mtf + alerts + lines)", 0, 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,TimeFrame,"HMA Histo 1.01 (mtf + alerts + lines)", 0, HMAPeriod, HMAPrice, HMAMethod, HMASpeed, HistoWidth, UpHistoColor, DnHistoColor, alertsOn, alertsOnCurrent, alertsMessage, alertsSound, alertsEmail, alertsPushNotif, verticalLinesVisible, linesOnNewest, verticalLinesID, verticalLinesUpColor, verticalLinesDnColor, verticalLinesStyle, verticalLinesWidth, 1, 2);
I have try your code, here the result when i backtest on EURUSD M30 and setting EA TimeFrame H4 [br] if I use the code you gave, EA OP Buy or Sell 8 candles after the Buy signal or Sell signal appears and this happens in all OP. but if i backtest on EURUSD M30 and setting EA TimeFrame current everything works fine. anyone can help?mrtools wrote: Sat Jan 25, 2020 4:07 am Maybe try
Code: Select all
double Value01 = iCustom(_Symbol,TimeFrame,"HMA Histo 1.01 (mtf + alerts + lines)", 0, 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,TimeFrame,"HMA Histo 1.01 (mtf + alerts + lines)", 0, 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,TimeFrame,"HMA Histo 1.01 (mtf + alerts + lines)", 0, 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,TimeFrame,"HMA Histo 1.01 (mtf + alerts + lines)", 0, HMAPeriod, HMAPrice, HMAMethod, HMASpeed, HistoWidth, UpHistoColor, DnHistoColor, alertsOn, alertsOnCurrent, alertsMessage, alertsSound, alertsEmail, alertsPushNotif, verticalLinesVisible, linesOnNewest, verticalLinesID, verticalLinesUpColor, verticalLinesDnColor, verticalLinesStyle, verticalLinesWidth, 1, 2);
Far as I can tell it is working correctly it takes 8, 30 minute bars to make a 4 hr bar, that's how the mtf works.krikil86 wrote: Sat Jan 25, 2020 11:00 am
I have try your code, here the result when i backtest on EURUSD M30 and setting EA TimeFrame H4
2020_01_25_06_49_37_5907133_Alpari_ECN1_EURUSD_M30_.png
[br]
2020_01_25_06_50_36_5907133_Alpari_ECN1_EURUSD_M30_.png
if I use the code you gave, EA OP Buy or Sell 8 candles after the Buy signal or Sell signal appears and this happens in all OP.
2020_01_25_06_47_58_5907133_Alpari_ECN1_EURUSD_M30_.png
but if i backtest on EURUSD M30 and setting EA TimeFrame current everything works fine.
2020_01_25_06_56_55_5907133_Alpari_ECN1_EURUSD_M30_.png
anyone can help?
About the HMA bars indicator:mntiwana wrote: Mon Jun 05, 2017 7:09 am HMA
The version with usual prices and Hull methods
_________________________________________________
HMA bars
This HMA bar version same usual prices and hull method option
Dear Jimmy, dear MrTools,Jimmy wrote: Mon Apr 22, 2019 12:24 am I've tried to find this one on our forum but it's not here yet so I'll post it in this thread. This is the Hull Moving Average Slope (Histogram) by Mladen.
This indicator comes with Multi-timeframe + Interpolation, Alerts, Arrows and more.
Are you asking for the gray line to be colored according to slope or for the histo to change color according to slope?josi wrote: Fri Mar 27, 2020 12:16 am
Dear Jimmy, dear MrTools,
this is a really great indicator but - at least in my mind - it would be even better if the histo-colour wouldn't change when 0 is crossed but
when the slope of the grey margin changes from up to down and vice versa.
So - could you - PLEASE - change the histo colour whenever the slope of the (grey) margin changes direction?
I'd be very grateful.
P.S.: you're are doing terrific work.
Well - at first I thought to change the histo colouring would be a good idea but now I'm not so sure.mrtools wrote: Fri Mar 27, 2020 5:47 am
Are you asking for the gray line to be colored according to slope or for the histo to change color according to slope?