Hello I am a newbie, trying to create a simple system that buys when the slope of the Hull average changes from falling or flat to up. I have done this but I am sure there must be a simple way that in facts works.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Hello I am a newbie, trying to create a simple system that buys when the slope of the Hull average changes from falling or flat to up. I have done this but I am sure there must be a simple way that in facts works.
If anyone can help I will appreciate, regards.
double WMA1 = iMA(NULL, 0, N1, 0, MODE_LWMA, PRICE_CLOSE, Current + 0);
double WMA1_1 = 2 * iMA(NULL, 0, (N1/2), 0, MODE_LWMA, PRICE_CLOSE, Current + 0);
double WMA1_2 = iMA(NULL, 0, N1, 0, MODE_LWMA, MathMod((WMA1_1-WMA1),(1/N1)), Current +0);
double WMA11 = iMA(NULL, 0, N1, 0, MODE_LWMA, PRICE_CLOSE, Current + 1);
double WMA1_11 = 2 * iMA(NULL, 0, (N1/2), 0, MODE_LWMA, PRICE_CLOSE, Current + 1);
double WMA1_21 = iMA(NULL, 0, N1, 0, MODE_LWMA, MathMod ((WMA1_11-WMA11),(1/N1)), Current + 1);
double WMA111 = iMA(NULL, 0, N1, 0, MODE_LWMA, PRICE_CLOSE, Current + 2);
double WMA1_111 = 2 * iMA(NULL, 0, N1/2, 0, MODE_LWMA, PRICE_CLOSE, Current + 2);
double WMA1_211 = iMA(NULL, 0, N1, 0, MODE_LWMA, MathMod((WMA1_111-WMA111),(1/N1)), Current + 2);
double Buy1 = WMA1_2 > WMA1_21 > WMA1_211;
double Buy2 = WMA1_2 <= WMA1_21 <= WMA1_211
if ( Buy1 && Buy2) Order = SIGNAL_BUY;