Page 1 of 1

Referencing the chart's resolution inside of a conditional statement?

Posted: Mon Dec 07, 2020 11:12 am
by sk123
here is an example of what I am trying to do.

If chart's resolution is 15minutes, then use 0.1 value for an indicator.
If chart's resolution is 30 minutes, then use 0.2 value.
If charts resolution is 1h, then use xyz value...

etc.

Re: Referencing the chart's resolution inside of a conditional statement?

Posted: Thu Dec 10, 2020 4:01 am
by Matthew
Hi sk123! You need to use the inbuilt variable timeframe.period to do this.

Here's a script you might find interesting that uses a boatload of conditional statements with the chart resolution:

https://zenandtheartoftrading.com/indic ... l-by-time/