moving high and low

 

hi everybody :

please i want a help in writing certain code

i want to write a code that get me the highest price and the lowest price of a certain determined number of candles to complete my strategy

note :iam on my very beginning steps in mql4 programing

thanks a lot

 
int Period = 14; // how many bars from Start to look back 
int Start = 0;   // 0 = current bar

// Highest High
double HH = iHigh(NULL, 0, iHighest(NULL, 0, MODE_HIGH, Period, Start));
// Lowest Low
double LL = iLow(NULL, 0, iLowest(NULL, 0, MODE_LOW, Period, Start));
you may use this as base
 
fx1.net:
you may use this as base


i appriciate this very much,

thank u a lot

but i have one little question,

the period 14 works for different time frame or i have to determine a certain timw frame for this code

 

u can't use Period as a var

 
fx1.net:
you may use this as base


int period = 14; gives me error (variable expected )

is there any missing thing

 
qjol:

u can't use Period as a var

 
qjol:


yeeeeeeeeees i understood now

so, what is the solution

i want to determine certain number of bars for my program to get the highest high and the lowest low

do u have a solution please, iam very biginner in mql4

thank u

 

use any word or char. u like instead

 
qjol:

use any word or char. u like instead


instead of what

i thought that (period) counts for me the required bar i want to use if i use any char it will be just a variable without count any thing

may be i didnt explain well

i want to write a code or a loop or any thing to get the highest high or lowest low from last 6 four hour bars to calculate a non constant pivot (the pivot changes with the close of the 4 hour bar)

thank u for ur time

 

i strongly reccomend u to read the mql4 book before

 

i have a better idea

can anyone advise to a certain pdf books to download to be proffisional in programing

Reason: