You are on page 1of 3

Fibonacci Retracement

‫معادلة تستخد فى برمجه فيبوناتشى اوتوماتيك بدل من الرسم يدوى‬

N := Input("Number of Days",1,1000,100);
f0 := Input("Level 0",0,100,0);
f1 := Input("Level 1",0,100,38);
f2 := Input("Level 2",0,100,50);
f3 := Input("Level 3",0,100,68);
f4 := Input("Level 4",0,100,100);
lowPoiont := LLV(LOW,N);
highPoint := HHV(HIGH,N);
diff := LastValue(highPoint) - LastValue(lowPoiont);
v0:=LastValue(lowPoiont) + diff * f0 /100;
v1:=LastValue(lowPoiont) + diff * f1 /100;
v2:=LastValue(lowPoiont) + diff * f2 /100;
v3:=LastValue(lowPoiont) + diff * f3 /100;
v4:=LastValue(lowPoiont) + diff * f4 /100;
currentCum := Cum(CLOSE/CLOSE);
lastCum := LastValue(currentCum - N);
line0:=ValueWhen(1,currentCum>=lastCum,v0);
line1:=ValueWhen(1,currentCum>=lastCum,v1);
line2:=ValueWhen(1,currentCum>=lastCum,v2);
line3:=ValueWhen(1,currentCum>=lastCum,v3);
line4:=ValueWhen(1,currentCum>=lastCum,v4);
 

line0;line1;line2;line3;line4;

FillRegion(line0,1,line1,line0);

FillRegion(line1,1,line2,line1);

FillRegion(line2,1,line3,line2);

FillRegion(line3,1,line4,line3);

You might also like