المشاركة الأصلية كتبت بواسطة 77777
بعد اذن الاخت الكريمه مولي تفضل اخي الطائفي
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);