عرض مشاركة واحدة
قديم 09-11-2007, 12:10 AM   #11
JEHANoo
متداول جديد
 
تاريخ التسجيل: Jun 2007
المشاركات: 76

 
افتراضي

اقتباس:
المشاركة الأصلية كتبت بواسطة ابو فنجان
وين المعادله لو تكرمت
مؤشر دكتور جو السابق هذه معادلته نسيت ان ادرجها ... تفضل
كود:
var Bar: integer;

var lrBar1, lrBar2: integer;
var lrPrice1, lrPrice2: float;
var sd: float;

lrBar1 := BarCount - 66;
lrBar2 := BarCount - 1;
lrPrice2 := LinearReg (BarCount - 1, #close, 65);
lrPrice1 := lrPrice2 - (65 * LinearRegSlope (BarCount - 1, #close, 65));

sd := stddev (BarCount - 1, #close, 65);

DrawLine (lrBar1,lrPrice1,lrBar2,lrPrice2,0, #Red, #solid);
DrawLine (lrBar1,lrPrice1+(1.5*sd),lrBar2,lrPrice2+(1.5*sd),0, #Blue, #solid);
DrawLine (lrBar1,lrPrice1-(1.5*sd),lrBar2,lrPrice2-(1.5*sd),0, #Blue, #solid);
DrawLine (lrBar1,lrPrice1+(3*sd),lrBar2,lrPrice2+(3*sd),0, #Green, #solid);
DrawLine (lrBar1,lrPrice1-(3*sd),lrBar2,lrPrice2-(3*sd),0, #Green, #solid);

print (floattostr (lrPrice2+(3*sd)));
print (floattostr (lrPrice2+(1.5*sd)));
print (floattostr (lrPrice2));
print (floattostr (lrPrice2-(1.5*sd)));
print (floattostr (lrPrice2-(3*sd)));

AnnotateChart ('LR', 0, BarCount - 66, lrPrice1, #blue, 12);
AnnotateChart ('1.5SD', 0, BarCount - 66, lrPrice1+(1.5*sd), #blue, 12);
AnnotateChart ('1.5SD', 0, BarCount - 66, lrPrice1-(1.5*sd), #blue, 12);
AnnotateChart ('3SD', 0, BarCount - 66, lrPrice1+(3*sd), #blue, 12);
AnnotateChart ('3SD', 0, BarCount - 66, lrPrice1-(3*sd), #blue, 12);
JEHANoo غير متواجد حالياً