Download MetaTrader 5
To add comments, please log in or register
Develop trading robots to order. Make profit with Freelance service!
Dua Yong Rew
5399
Dua Yong Rew 2014.05.19 15:08 

I want to do something like this

if period current is H1 then entry period should be m5

I tried this but not working

int OnInit()
  {
//---

   if(PERIOD_CURRENT == PERIOD_H1) MTA_Entry = PERIOD_M5;

   h_MA    = iDEMA(Symbol(), MTA_Entry, 3, 0, PRICE_CLOSE);
   h_Bands = iBands(Symbol(), 0, BB_Prd, 0, BB_Dev, PRICE_CLOSE);
Alain Verleyen
Moderator
30297
Alain Verleyen 2014.05.19 18:22  
doshur:

I want to do something like this

if period current is H1 then entry period should be m5

I tried this but not working

PERIOD_CURRENT can't never be equal to PERIOD_H1. These are predefined constants.

   if(Period() == PERIOD_H1) MTA_Entry = PERIOD_M5;
Dua Yong Rew
5399
Dua Yong Rew 2014.05.20 01:22  
Thank you
/
To add comments, please log in or register