Defining variables using if else on global scope, MQL5

Viewed 11

I am trying to get this code to work. The applied price should be UMA or LMA, but to get these I have to use the if else function but you can't use these on a global scale. Is there anyway around this?

input ENUM_APPLIED_PRICE   UMAX=    UMA;
input ENUM_APPLIED_PRICE   LMAX=    LMA;

   double UMA, LMA;
   if(close>open) {UMA=high-close; LMA=low-open;}
   else {UMA=high-open; LMA=low-close;}

Thanks in advance!

0 Answers
Related