Correct way for stochastic oscillator

Back to topics list To post a new topic, please log in or register
avatar
1
HarryYeah 2016.03.24 00: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 :)

Back to topics list  

To add comments, please log in or register