Download MetaTrader 5
To add comments, please log in or register
Are you used to trading from your smartphone? Mobile version of MetaTrader 5 will suit you best!
HarryYeah
4
HarryYeah 2016.03.23 23:05 

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 :)

/
To add comments, please log in or register