How know which Time Frame current chart is on?

Created at 27 Feb 2019, 05:03
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
fxwisdom1@gmail.com's avatar

fxwisdom1@gmail.com

Joined 18.05.2018

How know which Time Frame current chart is on?
27 Feb 2019, 05:03


I wanted to make an indi that only available to particular TF i.e. H1.

If the indi changes to higher/lower TF, it will not be run...

How can it identify which TF it is on now?

 

Thank you!


@fxwisdom1@gmail.com
Replies

lec0456
27 Feb 2019, 10:19

RE:

fxwisdom1@gmail.com said:

I wanted to make an indi that only available to particular TF i.e. H1.

If the indi changes to higher/lower TF, it will not be run...

How can it identify which TF it is on now?

 

Thank you!

its just TimeFrame you can do something like this.and just calculate on a specific time frame only

switch (Convert.ToString(TimeFrame))
            {
                case "Minute":
                    PeriodDivisor = 1;
                    break;
                case "Minute5":
                    PeriodDivisor = 5;
                    break;
                case "Minute10":
                    PeriodDivisor = 10;
                    break;
                case "Minute15":
                    PeriodDivisor = 15;
                    break;
                case "Minute30":
                    PeriodDivisor = 30;
                    break;
                case "Hour":
                    PeriodDivisor = 60;
                    break;
                default:
                    PeriodDivisor = 120;
                    break;
            }


@lec0456

fxwisdom1@gmail.com
28 Feb 2019, 07:12

Thank you very much for your help!


@fxwisdom1@gmail.com