# How to get PERIOD's (high/low/close/open) values?

To add comments, please log in or register
64

On 15 minute (or 10 min)  chart,  how to plot the WEEKLY (OR 4HR  OR DAILY or whatever timeframe i choose)   HIGH / LOW lines?

(this code onle detects DAILY lines - http://pastebin.com/raw.php?i=QFgWLcmU )

64

the only way I have found so far (TO Detect when NEW period Starts : High/low prices of that chosen timeframe):

http://pastebin.com/raw.php?i=23sx6KEK

33379

try to use:

close[0]

high[0]

low[0]

or

....

open[0]

u can replace the zero by the candle shift

this enough answer????

12360

Mohammad Soubra:

try to use:

close[0]

high[0]

low[0]

or

....

open[0]

u can replace the zero by the candle shift

this enough answer????

```int TF=10080; //weekly or 1440(daily)

double HighWeek=iHigh(Symbol(),TF,0);
double LowWeek=iLow(Symbol(),TF,0);```
Moderator
6151

can also use direct ENUM_TIMEFRAMES

```int TF=PERIOD_D1; //weekly or 1440(daily)

double HighWeek=iHigh(Symbol(),TF,0);
double LowWeek=iLow(Symbol(),TF,0);
```

or switchable on chart.

```int TF=PERIOD_CURRENT; //weekly or 1440(daily)

double HighWeek=iHigh(Symbol(),TF,0);
double LowWeek=iLow(Symbol(),TF,0);```

but can be combined there is no need to declare int TF.

```double HighWeek=iHigh(Symbol(),PERIOD_CURRENT,0);
double LowWeek=iLow(Symbol(),PERIOD_CURRENT,0);```
To add comments, please log in or register