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,
Im new to coding in MQL, i was was wondering if this was the correct way to work out if the stochastic was over 80 (sell) and under 20(buy)
and another question when should you use a { after an if statement and should i use one with the code below?
CODE
double current_K = iStochastic(NULL,0 , 5, 3, 3, 0, 0,MODE_MAIN,1);
double current_D = iStochastic(NULL,0 , 5, 3, 3, 0, 0,MODE_SIGNAL,1);
double previous_K = iStochastic(NULL,0 , 5, 3, 3, 0, 0,MODE_MAIN,2);
double previous_D = iStochastic(NULL,0 , 5, 3, 3, 0, 0,MODE_SIGNAL,2);
if(previous_K > 80)if( previous_K > previous_D && current_K < previous_D)
printf("Sell");
if(previous_K < 80)
if( previous_K < previous_D && current_K > previous_D)
printf("Buy");
**is there any IRC channels that i could goto for help with MQL?**
Thanks for your help in advance
Harry :)