Custom period PERIOD_Y1

To add comments, please log in or register
Jose Luis Lominchar
747
Jose Luis Lominchar  

Hi,

I want to ask you how I can use a custom period that is not present in ENUM_TIMEFRAMES, for example PERIOD_Y1 (= 1 Year), in calls to indicators like MACD:

 

iMACD(NULL, PERIOD_Y1, 12, 26, 9, PRICE_CLOSE, MODE_MAIN, 1);
Marco vd Heijden
Moderator
12729
Marco vd Heijden  
No but you can take 12 * MN1 and calculate Y1 
Jose Luis Lominchar
747
Jose Luis Lominchar  
static int PERIOD_Y1 = 518400; //43200 * 12

(something like this)

Marco vd Heijden
Moderator
12729
Marco vd Heijden  

No i meant call the indicator 12 times each for every month and then process the result to see where it's at after those 12 months.

Or depending on the indicator used and the data you are looking for it can sometimes suffice to call at the starting point once and once at the end point and then calculate the difference.

Jose Luis Lominchar
747
Jose Luis Lominchar  
Ok, thank you.
To add comments, please log in or register