Download MetaTrader 5

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

To add comments, please log in or register
tazosmr
64
tazosmr  

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 )

tazosmr
64
tazosmr  

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

Mohammad Soubra
33379
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???? 

Siti Latifah
12360
Siti Latifah  
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);
Marco vd Heijden
Moderator
6151
Marco vd Heijden  

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