Thread: How to code?
View Single Post
  #1055 (permalink)  
Old 06-30-2008, 07:05 AM
Devil2000 Devil2000 is offline
Senior Member
 
Join Date: Dec 2005
Location: In front of my trading desk
Posts: 348
Devil2000 is on a distinguished road
Hello,

You can try this :

Code:
....

int highest=0, lowest=0, bar=WindowBarsPerChart();

for(int shift=0;shift<bar;shift++)
 {
    double indie=iCustom(.........,shift);

    if(highest<indie) highest=indie;

    if(lowest==0) lowest=indie;
    if(lowest>indie) lowest=indie;
 } 

.....
note: this code calculating the current open candle too, if you want to calculate the closed candle only, use shift=1.

Hope this helps,
Ardie
__________________
Need a professional MQL4 programmer? PM me
Reply With Quote