Download MetaTrader 5

User Defined Timeframe in Indicator

To add comments, please log in or register
How to use MQL5.community messages editor? Find out in the article!
sergiodv
283
sergiodv 2016.03.25 07:55 

Can some please help with the following.

I want change an indicator so that the indicator timeframe is user defined.

For example if I I may choose to use the value of the 15 min of an indicator on a 5 min chart in the iCustom part I will use PERIOD_M15 instead of PERIOD_CURRENT

But how do I make this user defined with a dropdown menu so that I can choose to alter this from the indicatpr input.

Thanks

sergiodv
283
sergiodv 2016.03.25 08:59  

It's OK I worked it out

Use


extern ENUM_TIMEFRAMES TimeFrame1 = 5;

which means 5 min TF but also gives the user a dropdown menu

Khurram Mustafa
28166
Khurram Mustafa 2016.03.25 09:28  
sergiodv:

Can some please help with the following.

I want change an indicator so that the indicator timeframe is user defined.

For example if I I may choose to use the value of the 15 min of an indicator on a 5 min chart in the iCustom part I will use PERIOD_M15 instead of PERIOD_CURRENT

But how do I make this user defined with a dropdown menu so that I can choose to alter this from the indicatpr input.

Thanks

extern ENUM_TIMEFRAMES (All time frames will shown in drop menu)
sergiodv
283
sergiodv 2016.03.25 10:07  

Thanks Khurram

Khurram Mustafa
28166
Khurram Mustafa 2016.03.25 12:33  
sergiodv:

Thanks Khurram

You are Welcome :)
To add comments, please log in or register