constant expected, MQL5

Viewed 15

How do I get it to stop giving the error 'openGC' - constant expected. It says this for openGC, closeGC, openGC15, closeGC15.

// defining OCHL from the 3 minute period
double      open =            iOpen("EURUSD",PERIOD_M3,1);
double      close =           iClose("EURUSD",PERIOD_M3,1);
double      high =            iHigh("EURUSD",PERIOD_M3,1);
double      low =             iLow("EURUSD",PERIOD_M3,1);
// defining OCHL from the 15 minute period
double      open15 =          iOpen("EURUSD",PERIOD_M15,1);
double      close15 =         iClose("EURUSD",PERIOD_M15,1);
double      high15 =          iHigh("EURUSD",PERIOD_M15,1);
double      low15 =           iLow("EURUSD",PERIOD_M15,1);
//--- input calculations 
double      greenCandle =     close > open;
// taking the open and close of only the green candles
double      openGC =          greenCandle ? open : 0;
double      closeGC =         greenCandle ? close : 0;
double      openGC15 =        greenCandle ? open15 : 0;
double      closeGC15 =       greenCandle ? close15 : 0;
//--- input parameters 
input bool                 AsSeries=true;
input int                  period=100;
input ENUM_MA_METHOD       smootMode=MODE_EMA;
input ENUM_APPLIED_PRICE   UMAX= UMA;
input ENUM_APPLIED_PRICE   LMAX= LMA;
input ENUM_APPLIED_PRICE   price1= openGC; 
input ENUM_APPLIED_PRICE   price2= closeGC;
input ENUM_APPLIED_PRICE   price3= openGC15;
input ENUM_APPLIED_PRICE   price4= closeGC15; 
input int                  shift=1;

0 Answers
Related