قديم 26-10-2014, 10:13 AM
  المشاركه #121

عضو هوامير المميز

تاريخ التسجيل: Oct 2013
المشاركات: 503
DABL@ غير متواجد حالياً  

يسعد صباحك يا ابو محمد






/*
VierBox ver 0.1. Messy programming, rough plotting, barely usable :D
ver 0.2. * Parameter VierBox per saham bisa di save. Tidak perlu lagi memakai
Draw Rectangle. Big time saver :D
* Plot yang lebih halus
* fitur untuk menampilkan/menyembunyikan VierBox
* fitur untuk menampilkan/menyembunyikan garis vertikal
* fitur untuk menampilkan dan merubah warna VierBox (masih sangat sederhana)
* fitur untuk merubah warna garis
* Bagian Title akan memberikan informasi jika ada parameter yang berubah sejak
disave dan memberi rekomendasi apa yang hrs dilakukan.

Cara penggunaan: Klik "RESET ALL" untuk menampilkan parameter yang telah disave
atau
Klik "SAVE" untuk menyimpan parameter yang telah ubah

Technical stuff: parameter setiap saham disimpan di ectory c:\amibroker\vierbox\namasaham.txt

Saran, usul dan komentar dipersilahkan.

*/

_SECTION_BEGIN("Save Parameter Vierbox");
save=ParamTrigger( "Save Parameter VierBox?", "KLIK DISINI UNTUK SAVE") ;
_SECTION_END();

_SECTION_BEGIN("Display VierBox");
DisplayVierBox=ParamToggle("Display VierBox?","Yes|No",0);
_SECTION_END();



_SECTION_BEGIN("VierBox by DF");


//tampilanVierBox=ParamToggle("VierBox yang Ditampilkan","Permanen|Setup",0);
//jumlahBarDiBox = Param("Jumlah Bar di Box", 15, 5, 20);
//Offset= Param("Start mundur berapa bar",75,1,200);
//LineColor = ParamColor("Warna Garis", colorGreen);
//ColorBox1 = ParamColor("Warna Box 1",colorLightYellow);
//ColorBox2 = ParamColor("Warna Box 2",colorAqua);
//DisplayBoxColor=ParamToggle("Display Box Color","Yes|No",0);
//displayVerLine=ParamToggle("Display Vertical Line","Yes|No",0);


SetChartOptions(0,chartShowArrows|chartShowDates);
Plot(C,"C",colorBlack,styleCandle);
SetBarsRequired(100000, 100000);
EnableTextOutput(False);

if (displayVierBox==0) //section vierbox by DF hanya akan ditampilkan kalau displayVierBox==0
{

//Buka file
input_file=Name()+".txt";
input_folder="vierbox";
fh=fopen(input_folder+"\\"+input_file,"r");
if(fh)
{
strFile=fgets(fh);
fclose(fh);

strStartBar=StrExtract(strfile,0);
strJumlahBarDiBox=StrExtract(strFile,1);
strdisplayVerLine=StrExtract(strFile,2);
strDisplayBoxColor=StrExtract(strFile,3);
strlineColor=StrExtract(strFile,4);
strColorBox1=StrExtract(strFile,5);
strColorBox2=StrExtract(strFile,6);

startBar=StrToNum(strStartBar);
lastBar = LastValue(BarIndex()); //value jumlah total bar
Offset=Lastbar-startBar; //box mulai di sini. Nilai offset keluar cuma sekali di sini!
Offset= Param("Start Mundur Berapa Bar?",Offset,1,200);
startBar=LastBar-Offset;
jumlahBarDiBox=StrToNum(strJumlahBarDiBox);

jumlahBarDiBox = Param("Jumlah Bar di Box", StrToNum(strJumlahBarDiBox), 5, 20);
displayVerLine=ParamToggle("Display Vertical Line","Yes|No",StrToNum(strdisplayVerLine));
DisplayBoxColor=ParamToggle("Display Box Color","Yes|No",StrToNum(strDisplayBoxColor));
ColorBox1 = ParamColor("Warna Box 1",StrToNum(strColorBox1));
ColorBox2 = ParamColor("Warna Box 2",StrToNum(strColorBox2));
lineColor = ParamColor("Warna Garis", StrToNum(strLineColor));

}
else //jika file yang mau dibuka gak ada, bikin jadi default dan save
{
printf("error open file");
Offset= Param("Start Mundur Berapa Bar?",75,1,200);
lastBar = LastValue(BarIndex());
startBar=Lastbar-Offset;

jumlahBarDiBox = Param("Jumlah Bar di Box", 15, 5, 20);
displayVerLine=ParamToggle("Display Vertical Line","Yes|No",0);
DisplayBoxColor=ParamToggle("Display Box Color","Yes|No",1);
ColorBox1 = ParamColor("Warna Box 1",colorLightYellow);
ColorBox2 = ParamColor("Warna Box 2",colorAqua);
LineColor = ParamColor("Warna Garis", colorGreen);

//save
Output_file=Name()+".txt";
Output_folder="vierbox";
fmk(Output_folder);
fh=fopen(Output_folder+"\\"+Output_file,"w");
fputs(NumToStr(startBar,1.0,False)+","+NumToStr(jumlahBarDiBox,1.0,False)+","+
NumToStr(displayVerLine,1.0,False)+","+ NumToStr(displayBoxColor,1.0,False)+","+
NumToStr(Linecolor,1.0,False)+","+NumToStr(ColorBox1,1.0,False)+","+
NumToStr(ColorBox2,1.0,False) , fh);
fclose(fh); fclose(fh);
}; //end if fh

lastBar = LastValue(BarIndex()); //value jumlah total bar
//startBar=Lastbar-Offset; //box mulai di sini. Nilai offset keluar cuma sekali di sini!
lArray=LLV( Low, jumlahBardiBox); //cari Low terendah di box awal
hArray=HHV(High,jumlahBardiBox); //cari High tertinggi di box awal

VierL=Larray[startBar-1];//convert lArray jadi value
VierH=Harray[startBar-1];//convert hArray jadi value
range=VierH-VierL;//hitung tinggi box awal


//cari baseline box, sedekat mungkin dengan harga 0
//berguna agar box-box di depan selalu berada dekat bar-bar harga
baselineBoxGenap=VierL-int(VierL/range)*range;
baselineBoxGanjil=VierL-int(VierL/range)*range-range/2;

//start Buat box awal
x0=-jumlahBarDiBox+startBar;
x1=startBar;
garisBawah=LineArray(x0,VierL,x1,VierL,0);
garisAtas=LineArray(x0,VierH,x1,VierH,0);
Plot(garisBawah,"", LineColor);//garis bawah box
displace=5;

Plot(garisAtas,"", LineColor);//garis atas box
//selesai buat box awal

//hitung harus buat berapa box ke depan(horisontal dan vertikal)
jumlahBoxH=int((LastBar-startBar)/jumlahBarDiBox)+1;//jumlah box ke depan yang akan dibuat

//Plot Vertical Line
if (displayVerLine==0)
{
for (k=0;k<jumlahBoxH+1;k++)
{
x0=-jumlahBarDiBox+startBar+k*jumlahBarDiBox;
Plot( BarIndex()==x0, "", LineColor, styleOwnScale |styleHistogram );
} //end for
}
if (displayBoxColor==0)PlotOHLC(Null,garisAtas,garisBawah,Null,"",ColorBox1,style Cloud+styleNoLabel);

for (k=1;k<jumlahBoxH;k++) //mulai buat box didepan sebanyak jumlahBoxH
{
testGanjil=int(k/2)-k/2;//genap jika nilainya 0
boxNo=k;
boxL=lArray[startBar-1 + boxNo*jumlahBarDiBox];
boxH=hArray[startBar-1 + boxNo*jumlahBarDiBox];
jumlahBoxV=int(boxH/range)+1;

//kalau box genap
if (testGanjil==0)
{
//di box yang genap ke depan, buat plot
for (j=1;j<=jumlahBoxV;j++)
{
if ((baselineBoxGenap+j*range)>boxL) //buat plot hanya kalau dekat dengan bar
{
x0=-jumlahBarDiBox+startBar+boxNo*jumlahBarDiBox;
x1= startBar+boxNo*jumlahBarDiBox;
y=baselineBoxGenap+(j-1)*range;
garisBawah=LineArray(x0,y,x1,y,0);
garisAtas=LineArray(x0,y+range,x1,y+range,0);
Plot(garisBawah,"", LineColor);
Plot(garisatas,"", LineColor);
if (displayBoxColor==0) PlotOHLC(Null,garisAtas,garisBawah,Null,"",ColorBox1,styleCloud+styleNoLabel);
};//end if
};//end for
}
else //kalau box ganjil
{
//di box yang ganjil ke depan, buat plot
for (j=1;j<=jumlahBoxV;j++)
{
if ((baselineBoxGanjil+j*range)>boxL) //buat plot hanya kalau dekat dengan bar
{
x0=-jumlahBarDiBox+startBar+boxNo*jumlahBarDiBox;
x1= startBar+boxNo*jumlahBarDiBox;
y=baselineBoxGanjil+(j-1)*range;
garisBawah=LineArray(x0,y,x1,y,0);
garisAtas=LineArray(x0,y+range,x1,y+range,0);
Plot(garisBawah,"", LineColor);
Plot(garisAtas,"", LineColor);
if (displayBoxColor==0) PlotOHLC(Null,garisAtas,garisBawah,Null,"",ColorBox2,styleCloud+styleNoLabel);
};//end if
}; //end for

};
};


//sekarang plot khusus di box paling kanan. Like I said, messy :(
k=jumlahBoxH;
testGanjil=int(k/2)-k/2;//genap jika nilainya 0
boxNo=jumlahBoxH; //no box yang paling kanan
boxL=LastValue(Larray);
boxH=LastValue(hArray);
jumlahBoxV=int(boxH/range)+1;
if (testGanjil==0) //kalau box genap
{

//di box yang genap ke depan, buat plot
for (j=1;j<=jumlahBoxV;j++)
{
if ((baselineBoxGenap+j*range)>boxL) //buat plot hanya kalau dekat dengan bar
{
x0=-jumlahBarDiBox+startBar+boxNo*jumlahBarDiBox;
x1= startBar+boxNo*jumlahBarDiBox;
y=baselineBoxGenap+(j-1)*range;
garisBawah=LineArray(x0,y,x1,y,0);
garisAtas=LineArray(x0,y+range,x1,y+range,0);
displace=jumlahBarDiBox-(LastBar-x0);
//printf("\ndisplace="+displace);
Plot(Ref(garisbawah,displace),"", LineColor,styleLine , 0,0,displace);//garis bawah box
Plot(Ref(garisAtas,displace),"", LineColor,styleLine , 0,0,displace);//garis atas box
if (displayBoxColor==0) PlotOHLC(Null,Ref(garisbawah,displace),Ref(garisAtas,displace),Null,"",ColorBo x1,styleCloud+styleNoLabel,0,0,displace);

};//end if
};//end for
}
else //kalau box ganjil
{
//di box yang ganjil ke depan, buat plot
for (j=1;j<=jumlahBoxV;j++)
{
if ((baselineBoxGanjil+j*range)>boxL) //buat plot hanya kalau dekat dengan bar
{
x0=-jumlahBarDiBox+startBar+boxNo*jumlahBarDiBox;
x1= startBar+boxNo*jumlahBarDiBox;
//printf("\nx0="+x0);
//printf("\nx1="+x1);
y=baselineBoxGanjil+(j-1)*range;
garisBawah=LineArray(x0,y,x1,y,0);
garisAtas=LineArray(x0,y+range,x1,y+range,0);
displace=jumlahBarDiBox-(LastBar-x0);
Plot(Ref(garisbawah,displace),"", LineColor,styleLine , 0,0,displace);//garis bawah box
Plot(Ref(garisAtas,displace),"", LineColor,styleLine , 0,0,displace);//garis bawah box
if (displayBoxColor==0) PlotOHLC(Null,Ref(garisbawah,displace),Ref(garisAtas,displace),Null,"",ColorBo x2,styleCloud+styleNoLabel,0,0,displace);
};//end if
}; //end for
};



stringVierBox=WriteIf(jumlahBarDiBox!=StrToNum(strJumlahBarDiBox) OR
startBar!=StrToNum(strStartBar) OR
displayVerLine!=StrToNum(strdisplayVerLine) OR
displayBoxColor!=StrToNum(strDisplayBoxColor) OR
Linecolor!=StrToNum(strLineColor) OR
colorBox1!=StrToNum(strColorBox1) OR
colorBox2!=StrToNum(strColorBox2),
EncodeColor(colorRed)+"VierBox "+Name()+" belum disimpan. Di menu Parameters, klik SAVE untuk menyimpan VierBox ini atau klik RESET ALL untuk kembali.",
EncodeColor(colorBlue)+"VierBox "+Name()+" sudah disimpan");



Title =

stringVierBox+"\n\n"+
Date()+
" "+Name()+
EncodeColor(colorBlue)+" O "+EncodeColor(colorBlack)+"= "+O+
EncodeColor(colorBlue)+" H "+EncodeColor(colorBlack)+"= "+H+
EncodeColor(colorBlue)+" L "+EncodeColor(colorBlack)+"= "+L+
EncodeColor(colorBlue)+" C "+EncodeColor(colorBlack)+"= "+C+
EncodeColor(colorBlue)+" V "+EncodeColor(colorBlack)+"= "+ WriteVal(Volume,0);

if (save==1)
{
Output_file=Name()+".txt";
Output_folder="vierbox";
fmk(Output_folder);
fh=fopen(Output_folder+"\\"+Output_file,"w");
fputs(NumToStr(startBar,1.0,False)+","+NumToStr(jumlahBarDiBox,1.0,False)+","+
NumToStr(displayVerLine,1.0,False)+","+ NumToStr(displayBoxColor,1.0,False)+","+
NumToStr(Linecolor,1.0,False)+","+NumToStr(ColorBox1,1.0,False)+","+
NumToStr(ColorBox2,1.0,False) , fh);
fclose(fh);
} //end if

} //end if displayVierBox

_SECTION_END();




امسح المسافه اذ كانت فيه و عندك الخيارات -115 لزم تقدمها في بعض الاسهم



رد مع اقتباس
 
 

قديم 26-10-2014, 10:21 AM
  المشاركه #122

محلل فني

تاريخ التسجيل: Jul 2007
المشاركات: 2,069
JLocIg JLo غير متواجد حالياً  

بانتظارك لا هنت


رد مع اقتباس
قديم 26-10-2014, 10:25 AM
  المشاركه #123

عضو هوامير المميز

تاريخ التسجيل: Oct 2013
المشاركات: 503
DABL@ غير متواجد حالياً  

اقتباس:
المشاركة الأصلية كتبت بواسطة douplexx مشاهدة المشاركة
الاخ الداب300 يسعد مسائك بالخير و الرضا ان شاء الله




شوف نفس طلبك او لا و اي تعديل قول لي ان شاء الله انها صح





_section_begin("harmonic patterns");
//abdulkareem alghamdi - june 2012
percentage = param("percentage", 5, 1, 100, 0.1);
showtarget = paramlist("show target from:", "off|c-d|a-d |x-a|b-c");
showtargetext = paramtoggle("show target extensions?", "no|yes");
back = param("look back", 1, 1, 100, 1);
currection = param("currection:", 50, 5, 100,1);
//----------------------------------------------------------------------------------------
ax = bx = cx = dx = xx= 0;
ay = by = cy = dy = xy = 0;
bcon = scon = xcon = 0;
//----------------------------------------------------------------------------------------
procedure setuppattern(per, back)
{
backl = lastvalue(troughbars(l, per, back ));
backh = lastvalue(peakbars(h, per, back ));
backl2 = lastvalue(troughbars(l, per, back +1));
backh2 = lastvalue(peakbars(h, per, back+1));
backl3 = lastvalue(troughbars(l, per, back +2));
backh3 = lastvalue(peakbars(h, per, back +2));

if(backl < backh)
{
if(backl2 < backh)
for(i=back+1; backl2 < backh and i < back+currection; i++)
backl2 = lastvalue(troughbars(l, per, back + i));
if(backh2 < backl2)
for(i=back+1; backh2 < backl2 and i < back+currection; i++)
backh2 = lastvalue(peakbars(h, per, back + i));
if(backl3 < backh2)
for(i=back+2; backl3 < backh2 and i < back+currection; i++)
backl3 = lastvalue(troughbars(l, per, back + i));
if(backh3 < backl3)
for(i=back+2; backh3 < backl3 and i < back+currection; i++)
backh3 = lastvalue(peakbars(h, per, back + i));
}
else
{
if(backh2 < backl)
for(i=back+1; backh2 < backl and i < back+currection; i++)
backh2 = lastvalue(peakbars(h, per, back + i));
if(backl2 < backh2)
for(i=back+1; backl2 < backh2 and i < back+currection; i++)
backl2 = lastvalue(troughbars(l, per, back + i));
if(backh3 < backl2)
for(i=back+2; backh3 < backl2 and i < back+currection; i++)
backh3 = lastvalue(peakbars(h, per, back + i));
if(backl3 < backh3)
for(i=back+2; backl3 < backh3 and i < back+currection; i++)
backl3 = lastvalue(troughbars(l, per, back + i));
}
ax = barcount-1-lastvalue(max(backh2, backl2));
bx = barcount-1-lastvalue(min(backl2, backh2));
cx = barcount-1-lastvalue(max(backh, backl));
dx = barcount-1-lastvalue(min(backl, backh));

if(backl > backh)
{
ay = lastvalue((ref(l, -backl2)));
by = lastvalue((ref(h, -backh2)));
cy = lastvalue((ref(l, -backl)));
dy = lastvalue((ref(h, -backh)));
xy = lastvalue((ref(h, -backh3)));
xx = barcount-1-backh3;
xcon = xy > by and backh3 > backl2;
con = ((by-cy)/(by-ay)) > 0.3 and ((by-cy)/(by-ay)) < 0.8;
con = con and (ax < bx) and (bx < cx) and (cx < dx) and (ay < cy) and (cy <
by) and (by < dy);
con = con and backl2 > backh2 and backl > backh;
con = con and ((by-cy)/(by-ay)) >=0.3 and ((dy-cy)/(by-cy))>=1;
scon = con and ((dy-cy)/(xy-ay)) >=0.5 and ((by-ay)/(xy-ay))>=0.3;
}
else
{
ay = lastvalue((ref(h, -backh2)));
by = lastvalue((ref(l, -backl2)));
cy = lastvalue((ref(h, -backh)));
dy = lastvalue((ref(l, -backl)));
xy = lastvalue((ref(l, -backl3)));
xx = barcount-1-backl3;
xcon = xy < by and backl3 > backh2;
con = ((cy-by)/(ay-by)) > 0.5 and ((cy-by)/(ay-by)) < 0.8;
con = con and (ax < bx) and (bx < cx) and (cx < dx) and (ay > cy) and (cy >
by) and (by > dy);
con = con and backl2 < backh2 and backl < backh;
con = con and ((cy-dy)/(ay-xy))>=0.3 and ((ay-by)/(ay-xy)) >=0.3;
bcon = con and ((cy-dy)/(ay-by)) >=0.3 and ((cy-dy)/(cy-by)) >=1;
}
}
//----------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------
setuppattern(percentage, back) ;
color = iif(bcon, colorgold, colorred);
//----------------------------------------------------------------------------------------
if(bcon or scon)
{
plot(linearray(ax, ay, bx, by), "", color);//ab
plot(linearray(bx, by, cx, cy), "", color);//bc
plot(linearray(cx, cy, bx, by), "", color);//xb
plot(linearray(ax,ay,cx,cy,back),"ac ",paramcolor( "ac", colorred ),styleline,null, null );
plot(linearray(xx,xy,bx,by,back),"xb ",paramcolor( "xb", colorred ),styleline,null, null );
plot(linearray(cx, cy, ax, ay), "", color);//ca
plot(linearray(cx, cy, dx, dy), "", color);//cd
plot(linearray(ax, ay, cx, cy),"", color, styledashed);//ac
plot(linearray(bx, by, dx, dy),"", color, styledashed);//bd
plottext("a"+strformat("=%.2f", ay), ax, ay, colorwhite);
plottext("b"+strformat("=%.2f", by), bx, by, colorwhite);
plottext("c"+strformat("=%.2f", cy), cx, cy, colorwhite);
plottext("d"+strformat("=%.2f", dy), dx, dy, colorwhite);
plottext(strformat("%.3f", abs((cy-by)/(ay-by))), (ax+cx)/2, (ay+cy)/2,
colorwhite);
plottext(strformat("%.3f", abs((dy-cy)/(by-cy))), (bx+dx)/2, (by+dy)/2,
colorwhite);
if(xcon)
{
plot(linearray(xx, xy, ax, ay), "", color);
plottext("x"+strformat("=%.2f", xy), xx, xy, colorwhite);
plot(linearray(xx, xy, bx, by),"", color, styledashed);
plot(linearray(xx, xy, dx, dy),"", color, styledashed);
plottext(strformat("%.3f", (ay-by)/(ay-xy)), (xx+bx)/2, (xy+by)/2,
colorwhite);
plottext(strformat("%.3f", (cy-dy)/(ay-xy)), (xx+dx)/2, (xy+dy)/2,
colorwhite);
}
if(showtarget!="off")
{
if(showtarget=="c-d")
{
farx = cx;
fary = cy;
}
else
{
farx = ax;
fary = ay;
}

nearx = dx;
neary = dy;
if(showtarget=="x-a")
{
farx = xx;
fary = xy;

nearx = ax;
neary = ay;
}
if(showtarget=="b-c")
{
farx = bx;
fary = by;

nearx = cx;
neary = cy;
}
rangex = farx-nearx;
rangey = fary-neary;
plot(linearray(farx, fary, nearx, neary), "", colorgreen, styledashed);
plot(linearray(nearx+(rangex*0.236),neary+(rangey*0.236),barcount-1,neary+(rangey*0.236)),
"", colorgreen, styledashed|stylenolabel);
plottext(strformat("%.2f",neary+(rangey*0.236))
,barcount,neary+(rangey*0.236), colorwhite);
plot(linearray(nearx+(rangex*0.382),neary+(rangey*0.382),barcount-1,neary+(rangey*0.382)),
"", colorgreen, styledashed|stylenolabel);
plottext(strformat("%.2f",neary+(rangey*0.382))
,barcount,neary+(rangey*0.382), colorwhite);
plot(linearray(nearx+(rangex*0.5),neary+(rangey*0.5),barcount-1,neary+(rangey*0.5)),
"", colorgreen, styledashed|stylenolabel);
plottext(strformat("%.2f",neary+(rangey*0.5)) ,barcount,neary+(rangey*0.5),
colorwhite);
plot(linearray(nearx+(rangex*0.618),neary+(rangey*0.618),barcount-1,neary+(rangey*0.618)),
"", colorgreen, styledashed|stylenolabel);
plottext(strformat("%.2f",neary+(rangey*0.618))
,barcount,neary+(rangey*0.618), colorwhite);
plot(linearray(nearx+(rangex*0.786),neary+(rangey*0.786),barcount-1,neary+(rangey*0.786)),
"", colorgreen, styledashed|stylenolabel);
plottext(strformat("%.2f",neary+(rangey*0.786))
,barcount,neary+(rangey*0.786), colorwhite);
plot(linearray(farx,fary,barcount-1,fary), "", colorgreen,
styledashed|stylenolabel);
plottext(strformat("%.2f",fary) ,barcount,fary, colorwhite);
plot(linearray(nearx,neary,barcount-1,neary), "", colorgreen,
styledashed|stylenolabel);
plottext(strformat("%.2f",neary) ,barcount,neary, colorwhite);
if(showtargetext)
{
plot(linearray(farx,neary+(rangey*1.27),barcount-1,neary+(rangey*1.27)), "",
colorgreen, styledashed|stylenolabel);
plottext(strformat("%.2f",neary+(rangey*01.27))
,barcount,neary+(rangey*1.27), colorwhite);
plot(linearray(farx,neary+(rangey*1.618),barcount-1,neary+(rangey*1.618)),
"", colorgreen, styledashed|stylenolabel);
plottext(strformat("%.2f",neary+(rangey*01.618))
,barcount,neary+(rangey*1.618), colorwhite);
}
}
}
//----------------------------------------------------------------------------------------
plot(c, "", iif(o>c, colorred, colorgreen), paramstyle("price
style",stylebar,maskprice));
title = name()+" - "+interval(2)+" - "+"{{date}} - "+strformat("open=%.2f,
high=%.2f, low=%.2f, close=%.2f", o, h, l, c)+strformat(" (%.2f %.2f%%)",
c-ref(c, -1), selectedvalue(roc(c, 1)));
_section_end();

filter=bcon;

addtextcolumn ( fullname(), "full__________name", 1.2 );

addcolumn(bcon , "_____", 1.2 );




حياك الداب300 هذا مو نفس طلبك او لا

الله يسعدك



رد مع اقتباس
قديم 26-10-2014, 10:46 AM
  المشاركه #124

محلل فني

تاريخ التسجيل: Jul 2007
المشاركات: 2,069
JLocIg JLo غير متواجد حالياً  

اقتباس:
المشاركة الأصلية كتبت بواسطة douplexx مشاهدة المشاركة
حياك الداب300 هذا مو نفس طلبك او لا

الله يسعدك
بيض الله وجهك
طلب اخير ابي خط رسم النموذج والترند يكون غليظ وكذلك الفيبو ناتشي



رد مع اقتباس
قديم 26-10-2014, 10:57 AM
  المشاركه #125

عضو هوامير المميز

تاريخ التسجيل: Oct 2013
المشاركات: 503
DABL@ غير متواجد حالياً  

شوف كذا تمام





_section_begin("harmonic patterns");
//abdulkareem alghamdi - june 2012
percentage = param("percentage", 5, 1, 100, 0.1);
showtarget = paramlist("show target from:", "off|c-d|a-d |x-a|b-c");
showtargetext = paramtoggle("show target extensions?", "no|yes");
back = param("look back", 1, 1, 100, 1);
currection = param("currection:", 50, 5, 100,1);
//----------------------------------------------------------------------------------------
ax = bx = cx = dx = xx= 0;
ay = by = cy = dy = xy = 0;
bcon = scon = xcon = 0;
//----------------------------------------------------------------------------------------
procedure setuppattern(per, back)
{
backl = lastvalue(troughbars(l, per, back ));
backh = lastvalue(peakbars(h, per, back ));
backl2 = lastvalue(troughbars(l, per, back +1));
backh2 = lastvalue(peakbars(h, per, back+1));
backl3 = lastvalue(troughbars(l, per, back +2));
backh3 = lastvalue(peakbars(h, per, back +2));

if(backl < backh)
{
if(backl2 < backh)
for(i=back+1; backl2 < backh and i < back+currection; i++)
backl2 = lastvalue(troughbars(l, per, back + i));
if(backh2 < backl2)
for(i=back+1; backh2 < backl2 and i < back+currection; i++)
backh2 = lastvalue(peakbars(h, per, back + i));
if(backl3 < backh2)
for(i=back+2; backl3 < backh2 and i < back+currection; i++)
backl3 = lastvalue(troughbars(l, per, back + i));
if(backh3 < backl3)
for(i=back+2; backh3 < backl3 and i < back+currection; i++)
backh3 = lastvalue(peakbars(h, per, back + i));
}
else
{
if(backh2 < backl)
for(i=back+1; backh2 < backl and i < back+currection; i++)
backh2 = lastvalue(peakbars(h, per, back + i));
if(backl2 < backh2)
for(i=back+1; backl2 < backh2 and i < back+currection; i++)
backl2 = lastvalue(troughbars(l, per, back + i));
if(backh3 < backl2)
for(i=back+2; backh3 < backl2 and i < back+currection; i++)
backh3 = lastvalue(peakbars(h, per, back + i));
if(backl3 < backh3)
for(i=back+2; backl3 < backh3 and i < back+currection; i++)
backl3 = lastvalue(troughbars(l, per, back + i));
}
ax = barcount-1-lastvalue(max(backh2, backl2));
bx = barcount-1-lastvalue(min(backl2, backh2));
cx = barcount-1-lastvalue(max(backh, backl));
dx = barcount-1-lastvalue(min(backl, backh));

if(backl > backh)
{
ay = lastvalue((ref(l, -backl2)));
by = lastvalue((ref(h, -backh2)));
cy = lastvalue((ref(l, -backl)));
dy = lastvalue((ref(h, -backh)));
xy = lastvalue((ref(h, -backh3)));
xx = barcount-1-backh3;
xcon = xy > by and backh3 > backl2;
con = ((by-cy)/(by-ay)) > 0.3 and ((by-cy)/(by-ay)) < 0.8;
con = con and (ax < bx) and (bx < cx) and (cx < dx) and (ay < cy) and (cy <
by) and (by < dy);
con = con and backl2 > backh2 and backl > backh;
con = con and ((by-cy)/(by-ay)) >=0.3 and ((dy-cy)/(by-cy))>=1;
scon = con and ((dy-cy)/(xy-ay)) >=0.5 and ((by-ay)/(xy-ay))>=0.3;
}
else
{
ay = lastvalue((ref(h, -backh2)));
by = lastvalue((ref(l, -backl2)));
cy = lastvalue((ref(h, -backh)));
dy = lastvalue((ref(l, -backl)));
xy = lastvalue((ref(l, -backl3)));
xx = barcount-1-backl3;
xcon = xy < by and backl3 > backh2;
con = ((cy-by)/(ay-by)) > 0.5 and ((cy-by)/(ay-by)) < 0.8;
con = con and (ax < bx) and (bx < cx) and (cx < dx) and (ay > cy) and (cy >
by) and (by > dy);
con = con and backl2 < backh2 and backl < backh;
con = con and ((cy-dy)/(ay-xy))>=0.3 and ((ay-by)/(ay-xy)) >=0.3;
bcon = con and ((cy-dy)/(ay-by)) >=0.3 and ((cy-dy)/(cy-by)) >=1;
}
}
//----------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------
setuppattern(percentage, back) ;
color = iif(bcon, colorgold, colorred);
//----------------------------------------------------------------------------------------
if(bcon or scon)
{
plot(linearray(ax, ay, bx, by), "", color,4);//ab
plot(linearray(bx, by, cx, cy), "", color,4);//bc
plot(linearray(cx, cy, bx, by), "", color,4);//xb
plot(linearray(ax,ay,cx,cy,back),"ac ",paramcolor( "ac", colorred ),styleLine+4,null, null );
plot(linearray(xx,xy,bx,by,back),"xb ",paramcolor( "xb", colorred ),styleLine+4,null, null );
plot(linearray(cx, cy, ax, ay), "", color,4);//ca
plot(linearray(cx, cy, dx, dy), "", color,4);//cd
plot(linearray(ax, ay, cx, cy),"", color , styleDashed );//ac
plot(linearray(bx, by, dx, dy),"", color , styleDashed );//bd
plottext("a"+strformat("=%.2f", ay), ax, ay, colorWhite );
plottext("b"+strformat("=%.2f", by), bx, by, colorWhite );
plottext("c"+strformat("=%.2f", cy), cx, cy, colorWhite );
plottext("d"+strformat("=%.2f", dy), dx, dy, colorWhite );
plottext(strformat("%.3f", abs((cy-by)/(ay-by))), (ax+cx)/2, (ay+cy)/2,
colorwhite);
plottext(strformat("%.3f", abs((dy-cy)/(by-cy))), (bx+dx)/2, (by+dy)/2,
colorwhite);
if(xcon)
{
plot(linearray(xx, xy, ax, ay), "", color,4);
plottext("x"+strformat("=%.2f", xy), xx, xy, colorWhite );
plot(linearray(xx, xy, bx, by),"", color, styleDashed );
plot(linearray(xx, xy, dx, dy),"", color, styleDashed );
plottext(strformat("%.3f", (ay-by)/(ay-xy)), (xx+bx)/2, (xy+by)/2,
colorwhite);
plottext(strformat("%.3f", (cy-dy)/(ay-xy)), (xx+dx)/2, (xy+dy)/2,
colorwhite);
}
if(showtarget!="off")
{
if(showtarget=="c-d")
{
farx = cx;
fary = cy;
}
else
{
farx = ax;
fary = ay;
}

nearx = dx;
neary = dy;
if(showtarget=="x-a")
{
farx = xx;
fary = xy;

nearx = ax;
neary = ay;
}
if(showtarget=="b-c")
{
farx = bx;
fary = by;

nearx = cx;
neary = cy;
}
rangex = farx-nearx;
rangey = fary-neary;
plot(linearray(farx, fary, nearx, neary), "", colorgreen, styledashed);
plot(linearray(nearx+(rangex*0.236),neary+(rangey*0.236),barcount-1,neary+(rangey*0.236)),
"", colorgreen, styledashed|stylenolabel);
plottext(strformat("%.2f",neary+(rangey*0.236))
,barcount,neary+(rangey*0.236), colorwhite);
plot(linearray(nearx+(rangex*0.382),neary+(rangey*0.382),barcount-1,neary+(rangey*0.382)),
"", colorgreen, styledashed|stylenolabel);
plottext(strformat("%.2f",neary+(rangey*0.382))
,barcount,neary+(rangey*0.382), colorwhite);
plot(linearray(nearx+(rangex*0.5),neary+(rangey*0.5),barcount-1,neary+(rangey*0.5)),
"", colorgreen, styledashed|stylenolabel);
plottext(strformat("%.2f",neary+(rangey*0.5)) ,barcount,neary+(rangey*0.5),
colorwhite);
plot(linearray(nearx+(rangex*0.618),neary+(rangey*0.618),barcount-1,neary+(rangey*0.618)),
"", colorgreen, styledashed|stylenolabel);
plottext(strformat("%.2f",neary+(rangey*0.618))
,barcount,neary+(rangey*0.618), colorwhite);
plot(linearray(nearx+(rangex*0.786),neary+(rangey*0.786),barcount-1,neary+(rangey*0.786)),
"", colorgreen, styledashed|stylenolabel);
plottext(strformat("%.2f",neary+(rangey*0.786))
,barcount,neary+(rangey*0.786), colorwhite);
plot(linearray(farx,fary,barcount-1,fary), "", colorgreen,
styledashed|stylenolabel);
plottext(strformat("%.2f",fary) ,barcount,fary, colorwhite);
plot(linearray(nearx,neary,barcount-1,neary), "", colorgreen,
styledashed|stylenolabel);
plottext(strformat("%.2f",neary) ,barcount,neary, colorwhite);
if(showtargetext)
{
plot(linearray(farx,neary+(rangey*1.27),barcount-1,neary+(rangey*1.27)), "",
colorgreen, styledashed|stylenolabel);
plottext(strformat("%.2f",neary+(rangey*01.27))
,barcount,neary+(rangey*1.27), colorwhite);
plot(linearray(farx,neary+(rangey*1.618),barcount-1,neary+(rangey*1.618)),
"", colorgreen, styledashed|stylenolabel);
plottext(strformat("%.2f",neary+(rangey*01.618))
,barcount,neary+(rangey*1.618), colorwhite);
}
}
}
//----------------------------------------------------------------------------------------
plot(c, "", iif(o>c, colorred, colorgreen), paramstyle("price
style",stylebar,maskprice));
title = name()+" - "+interval(2)+" - "+"{{date}} - "+strformat("open=%.2f,
high=%.2f, low=%.2f, close=%.2f", o, h, l, c)+strformat(" (%.2f %.2f%%)",
c-ref(c, -1), selectedvalue(roc(c, 1)));
_section_end();

filter=bcon;

addtextcolumn ( fullname(), "full__________name", 1.2 );

addcolumn(bcon , "_____", 1.2 );



رد مع اقتباس
قديم 26-10-2014, 11:00 AM
  المشاركه #126

محلل فني

تاريخ التسجيل: Jul 2007
المشاركات: 2,069
JLocIg JLo غير متواجد حالياً  

اقتباس:
المشاركة الأصلية كتبت بواسطة douplexx مشاهدة المشاركة
شوف كذا تمام





_section_begin("harmonic patterns");
//abdulkareem alghamdi - june 2012
percentage = param("percentage", 5, 1, 100, 0.1);
showtarget = paramlist("show target from:", "off|c-d|a-d |x-a|b-c");
showtargetext = paramtoggle("show target extensions?", "no|yes");
back = param("look back", 1, 1, 100, 1);
currection = param("currection:", 50, 5, 100,1);
//----------------------------------------------------------------------------------------
ax = bx = cx = dx = xx= 0;
ay = by = cy = dy = xy = 0;
bcon = scon = xcon = 0;
//----------------------------------------------------------------------------------------
procedure setuppattern(per, back)
{
backl = lastvalue(troughbars(l, per, back ));
backh = lastvalue(peakbars(h, per, back ));
backl2 = lastvalue(troughbars(l, per, back +1));
backh2 = lastvalue(peakbars(h, per, back+1));
backl3 = lastvalue(troughbars(l, per, back +2));
backh3 = lastvalue(peakbars(h, per, back +2));

if(backl < backh)
{
if(backl2 < backh)
for(i=back+1; backl2 < backh and i < back+currection; i++)
backl2 = lastvalue(troughbars(l, per, back + i));
if(backh2 < backl2)
for(i=back+1; backh2 < backl2 and i < back+currection; i++)
backh2 = lastvalue(peakbars(h, per, back + i));
if(backl3 < backh2)
for(i=back+2; backl3 < backh2 and i < back+currection; i++)
backl3 = lastvalue(troughbars(l, per, back + i));
if(backh3 < backl3)
for(i=back+2; backh3 < backl3 and i < back+currection; i++)
backh3 = lastvalue(peakbars(h, per, back + i));
}
else
{
if(backh2 < backl)
for(i=back+1; backh2 < backl and i < back+currection; i++)
backh2 = lastvalue(peakbars(h, per, back + i));
if(backl2 < backh2)
for(i=back+1; backl2 < backh2 and i < back+currection; i++)
backl2 = lastvalue(troughbars(l, per, back + i));
if(backh3 < backl2)
for(i=back+2; backh3 < backl2 and i < back+currection; i++)
backh3 = lastvalue(peakbars(h, per, back + i));
if(backl3 < backh3)
for(i=back+2; backl3 < backh3 and i < back+currection; i++)
backl3 = lastvalue(troughbars(l, per, back + i));
}
ax = barcount-1-lastvalue(max(backh2, backl2));
bx = barcount-1-lastvalue(min(backl2, backh2));
cx = barcount-1-lastvalue(max(backh, backl));
dx = barcount-1-lastvalue(min(backl, backh));

if(backl > backh)
{
ay = lastvalue((ref(l, -backl2)));
by = lastvalue((ref(h, -backh2)));
cy = lastvalue((ref(l, -backl)));
dy = lastvalue((ref(h, -backh)));
xy = lastvalue((ref(h, -backh3)));
xx = barcount-1-backh3;
xcon = xy > by and backh3 > backl2;
con = ((by-cy)/(by-ay)) > 0.3 and ((by-cy)/(by-ay)) < 0.8;
con = con and (ax < bx) and (bx < cx) and (cx < dx) and (ay < cy) and (cy <
by) and (by < dy);
con = con and backl2 > backh2 and backl > backh;
con = con and ((by-cy)/(by-ay)) >=0.3 and ((dy-cy)/(by-cy))>=1;
scon = con and ((dy-cy)/(xy-ay)) >=0.5 and ((by-ay)/(xy-ay))>=0.3;
}
else
{
ay = lastvalue((ref(h, -backh2)));
by = lastvalue((ref(l, -backl2)));
cy = lastvalue((ref(h, -backh)));
dy = lastvalue((ref(l, -backl)));
xy = lastvalue((ref(l, -backl3)));
xx = barcount-1-backl3;
xcon = xy < by and backl3 > backh2;
con = ((cy-by)/(ay-by)) > 0.5 and ((cy-by)/(ay-by)) < 0.8;
con = con and (ax < bx) and (bx < cx) and (cx < dx) and (ay > cy) and (cy >
by) and (by > dy);
con = con and backl2 < backh2 and backl < backh;
con = con and ((cy-dy)/(ay-xy))>=0.3 and ((ay-by)/(ay-xy)) >=0.3;
bcon = con and ((cy-dy)/(ay-by)) >=0.3 and ((cy-dy)/(cy-by)) >=1;
}
}
//----------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------
setuppattern(percentage, back) ;
color = iif(bcon, colorgold, colorred);
//----------------------------------------------------------------------------------------
if(bcon or scon)
{
plot(linearray(ax, ay, bx, by), "", color,4);//ab
plot(linearray(bx, by, cx, cy), "", color,4);//bc
plot(linearray(cx, cy, bx, by), "", color,4);//xb
plot(linearray(ax,ay,cx,cy,back),"ac ",paramcolor( "ac", colorred ),styleline+4,null, null );
plot(linearray(xx,xy,bx,by,back),"xb ",paramcolor( "xb", colorred ),styleline+4,null, null );
plot(linearray(cx, cy, ax, ay), "", color,4);//ca
plot(linearray(cx, cy, dx, dy), "", color,4);//cd
plot(linearray(ax, ay, cx, cy),"", color , styledashed );//ac
plot(linearray(bx, by, dx, dy),"", color , styledashed );//bd
plottext("a"+strformat("=%.2f", ay), ax, ay, colorwhite );
plottext("b"+strformat("=%.2f", by), bx, by, colorwhite );
plottext("c"+strformat("=%.2f", cy), cx, cy, colorwhite );
plottext("d"+strformat("=%.2f", dy), dx, dy, colorwhite );
plottext(strformat("%.3f", abs((cy-by)/(ay-by))), (ax+cx)/2, (ay+cy)/2,
colorwhite);
plottext(strformat("%.3f", abs((dy-cy)/(by-cy))), (bx+dx)/2, (by+dy)/2,
colorwhite);
if(xcon)
{
plot(linearray(xx, xy, ax, ay), "", color,4);
plottext("x"+strformat("=%.2f", xy), xx, xy, colorwhite );
plot(linearray(xx, xy, bx, by),"", color, styledashed );
plot(linearray(xx, xy, dx, dy),"", color, styledashed );
plottext(strformat("%.3f", (ay-by)/(ay-xy)), (xx+bx)/2, (xy+by)/2,
colorwhite);
plottext(strformat("%.3f", (cy-dy)/(ay-xy)), (xx+dx)/2, (xy+dy)/2,
colorwhite);
}
if(showtarget!="off")
{
if(showtarget=="c-d")
{
farx = cx;
fary = cy;
}
else
{
farx = ax;
fary = ay;
}

nearx = dx;
neary = dy;
if(showtarget=="x-a")
{
farx = xx;
fary = xy;

nearx = ax;
neary = ay;
}
if(showtarget=="b-c")
{
farx = bx;
fary = by;

nearx = cx;
neary = cy;
}
rangex = farx-nearx;
rangey = fary-neary;
plot(linearray(farx, fary, nearx, neary), "", colorgreen, styledashed);
plot(linearray(nearx+(rangex*0.236),neary+(rangey*0.236),barcount-1,neary+(rangey*0.236)),
"", colorgreen, styledashed|stylenolabel);
plottext(strformat("%.2f",neary+(rangey*0.236))
,barcount,neary+(rangey*0.236), colorwhite);
plot(linearray(nearx+(rangex*0.382),neary+(rangey*0.382),barcount-1,neary+(rangey*0.382)),
"", colorgreen, styledashed|stylenolabel);
plottext(strformat("%.2f",neary+(rangey*0.382))
,barcount,neary+(rangey*0.382), colorwhite);
plot(linearray(nearx+(rangex*0.5),neary+(rangey*0.5),barcount-1,neary+(rangey*0.5)),
"", colorgreen, styledashed|stylenolabel);
plottext(strformat("%.2f",neary+(rangey*0.5)) ,barcount,neary+(rangey*0.5),
colorwhite);
plot(linearray(nearx+(rangex*0.618),neary+(rangey*0.618),barcount-1,neary+(rangey*0.618)),
"", colorgreen, styledashed|stylenolabel);
plottext(strformat("%.2f",neary+(rangey*0.618))
,barcount,neary+(rangey*0.618), colorwhite);
plot(linearray(nearx+(rangex*0.786),neary+(rangey*0.786),barcount-1,neary+(rangey*0.786)),
"", colorgreen, styledashed|stylenolabel);
plottext(strformat("%.2f",neary+(rangey*0.786))
,barcount,neary+(rangey*0.786), colorwhite);
plot(linearray(farx,fary,barcount-1,fary), "", colorgreen,
styledashed|stylenolabel);
plottext(strformat("%.2f",fary) ,barcount,fary, colorwhite);
plot(linearray(nearx,neary,barcount-1,neary), "", colorgreen,
styledashed|stylenolabel);
plottext(strformat("%.2f",neary) ,barcount,neary, colorwhite);
if(showtargetext)
{
plot(linearray(farx,neary+(rangey*1.27),barcount-1,neary+(rangey*1.27)), "",
colorgreen, styledashed|stylenolabel);
plottext(strformat("%.2f",neary+(rangey*01.27))
,barcount,neary+(rangey*1.27), colorwhite);
plot(linearray(farx,neary+(rangey*1.618),barcount-1,neary+(rangey*1.618)),
"", colorgreen, styledashed|stylenolabel);
plottext(strformat("%.2f",neary+(rangey*01.618))
,barcount,neary+(rangey*1.618), colorwhite);
}
}
}
//----------------------------------------------------------------------------------------
plot(c, "", iif(o>c, colorred, colorgreen), paramstyle("price
style",stylebar,maskprice));
title = name()+" - "+interval(2)+" - "+"{{date}} - "+strformat("open=%.2f,
high=%.2f, low=%.2f, close=%.2f", o, h, l, c)+strformat(" (%.2f %.2f%%)",
c-ref(c, -1), selectedvalue(roc(c, 1)));
_section_end();

filter=bcon;

addtextcolumn ( fullname(), "full__________name", 1.2 );

addcolumn(bcon , "_____", 1.2 );
مبدع وفقك الله
طلب ما قبل الاخير ههههههههه
ابي قيم فيبو ناتشي تكون ظاهره مثلا 50% و 61%



رد مع اقتباس
قديم 26-10-2014, 11:02 AM
  المشاركه #127

عضو هوامير المؤسس

تاريخ التسجيل: Jul 2005
المشاركات: 2,316
almasdar غير متواجد حالياً  

يصبحك بالنور والسرور

للاسف ماضبط معي



رد مع اقتباس
قديم 26-10-2014, 11:29 AM
  المشاركه #128

عضو هوامير المميز

تاريخ التسجيل: Oct 2013
المشاركات: 503
DABL@ غير متواجد حالياً  

الله يسعدك اخوي الداب 300




_section_begin("harmonic patterns");
//abdulkareem alghamdi - june 2012
percentage = param("percentage", 5, 1, 100, 0.1);
showtarget = paramlist("show target from:", "off|c-d|a-d |x-a|b-c");
showtargetext = paramtoggle("show target extensions?", "no|yes");
back = param("look back", 1, 1, 100, 1);
currection = param("currection:", 50, 5, 100,1);
//----------------------------------------------------------------------------------------
ax = bx = cx = dx = xx= 0;
ay = by = cy = dy = xy = 0;
bcon = scon = xcon = 0;
//----------------------------------------------------------------------------------------
procedure setuppattern(per, back)
{
backl = lastvalue(troughbars(l, per, back ));
backh = lastvalue(peakbars(h, per, back ));
backl2 = lastvalue(troughbars(l, per, back +1));
backh2 = lastvalue(peakbars(h, per, back+1));
backl3 = lastvalue(troughbars(l, per, back +2));
backh3 = lastvalue(peakbars(h, per, back +2));

if(backl < backh)
{
if(backl2 < backh)
for(i=back+1; backl2 < backh and i < back+currection; i++)
backl2 = lastvalue(troughbars(l, per, back + i));
if(backh2 < backl2)
for(i=back+1; backh2 < backl2 and i < back+currection; i++)
backh2 = lastvalue(peakbars(h, per, back + i));
if(backl3 < backh2)
for(i=back+2; backl3 < backh2 and i < back+currection; i++)
backl3 = lastvalue(troughbars(l, per, back + i));
if(backh3 < backl3)
for(i=back+2; backh3 < backl3 and i < back+currection; i++)
backh3 = lastvalue(peakbars(h, per, back + i));
}
else
{
if(backh2 < backl)
for(i=back+1; backh2 < backl and i < back+currection; i++)
backh2 = lastvalue(peakbars(h, per, back + i));
if(backl2 < backh2)
for(i=back+1; backl2 < backh2 and i < back+currection; i++)
backl2 = lastvalue(troughbars(l, per, back + i));
if(backh3 < backl2)
for(i=back+2; backh3 < backl2 and i < back+currection; i++)
backh3 = lastvalue(peakbars(h, per, back + i));
if(backl3 < backh3)
for(i=back+2; backl3 < backh3 and i < back+currection; i++)
backl3 = lastvalue(troughbars(l, per, back + i));
}
ax = barcount-1-lastvalue(max(backh2, backl2));
bx = barcount-1-lastvalue(min(backl2, backh2));
cx = barcount-1-lastvalue(max(backh, backl));
dx = barcount-1-lastvalue(min(backl, backh));

if(backl > backh)
{
ay = lastvalue((ref(l, -backl2)));
by = lastvalue((ref(h, -backh2)));
cy = lastvalue((ref(l, -backl)));
dy = lastvalue((ref(h, -backh)));
xy = lastvalue((ref(h, -backh3)));
xx = barcount-1-backh3;
xcon = xy > by and backh3 > backl2;
con = ((by-cy)/(by-ay)) > 0.3 and ((by-cy)/(by-ay)) < 0.8;
con = con and (ax < bx) and (bx < cx) and (cx < dx) and (ay < cy) and (cy <
by) and (by < dy);
con = con and backl2 > backh2 and backl > backh;
con = con and ((by-cy)/(by-ay)) >=0.3 and ((dy-cy)/(by-cy))>=1;
scon = con and ((dy-cy)/(xy-ay)) >=0.5 and ((by-ay)/(xy-ay))>=0.3;
}
else
{
ay = lastvalue((ref(h, -backh2)));
by = lastvalue((ref(l, -backl2)));
cy = lastvalue((ref(h, -backh)));
dy = lastvalue((ref(l, -backl)));
xy = lastvalue((ref(l, -backl3)));
xx = barcount-1-backl3;
xcon = xy < by and backl3 > backh2;
con = ((cy-by)/(ay-by)) > 0.5 and ((cy-by)/(ay-by)) < 0.8;
con = con and (ax < bx) and (bx < cx) and (cx < dx) and (ay > cy) and (cy >
by) and (by > dy);
con = con and backl2 < backh2 and backl < backh;
con = con and ((cy-dy)/(ay-xy))>=0.3 and ((ay-by)/(ay-xy)) >=0.3;
bcon = con and ((cy-dy)/(ay-by)) >=0.3 and ((cy-dy)/(cy-by)) >=1;
}
}
//----------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------
setuppattern(percentage, back) ;
color = iif(bcon, colorgold, colorred);
//----------------------------------------------------------------------------------------
if(bcon or scon)
{
plot(linearray(ax, ay, bx, by), "", color);//ab
plot(linearray(bx, by, cx, cy), "", color);//bc
plot(linearray(cx, cy, bx, by), "", color);//xb
plot(linearray(ax,ay,cx,cy,back),"ac ",paramcolor( "ac", colorred ),styleline,null, null );
plot(linearray(xx,xy,bx,by,back),"xb ",paramcolor( "xb", colorred ),styleline,null, null );
plot(linearray(cx, cy, ax, ay), "", color);//ca
plot(linearray(cx, cy, dx, dy), "", color);//cd
plot(linearray(ax, ay, cx, cy),"", color, styledashed);//ac
plot(linearray(bx, by, dx, dy),"", color, styledashed);//bd
plottext("a"+strformat("=%.2f", ay), ax, ay, colorwhite);
plottext("b"+strformat("=%.2f", by), bx, by, colorwhite);
plottext("c"+strformat("=%.2f", cy), cx, cy, colorwhite);
plottext("d"+strformat("=%.2f", dy), dx, dy, colorwhite);
plottext(strformat("%.3f", abs((cy-by)/(ay-by))), (ax+cx)/2, (ay+cy)/2,
colorwhite);
plottext(strformat("%.3f", abs((dy-cy)/(by-cy))), (bx+dx)/2, (by+dy)/2,
colorwhite);
if(xcon)
{
plot(linearray(xx, xy, ax, ay), "", color);
plottext("x"+strformat("=%.2f", xy), xx, xy, colorwhite);
plot(linearray(xx, xy, bx, by),"", color, styledashed);
plot(linearray(xx, xy, dx, dy),"", color, styledashed);
plottext(strformat("%.3f", (ay-by)/(ay-xy)), (xx+bx)/2, (xy+by)/2,
colorwhite);
plottext(strformat("%.3f", (cy-dy)/(ay-xy)), (xx+dx)/2, (xy+dy)/2,
colorwhite);
}
if(showtarget!="off")
{
if(showtarget=="c-d")
{
farx = cx;
fary = cy;
}
else
{
farx = ax;
fary = ay;
}

nearx = dx;
neary = dy;
if(showtarget=="x-a")
{
farx = xx;
fary = xy;

nearx = ax;
neary = ay;
}
if(showtarget=="b-c")
{
farx = bx;
fary = by;

nearx = cx;
neary = cy;
}
rangex = farx-nearx;
rangey = fary-neary;
plot(linearray(farx, fary, nearx, neary), "", colorgreen, styledashed);
plot(linearray(nearx+(rangex*0.236),neary+(rangey*0.236),barcount-1,neary+(rangey*0.236)),
"", colorgreen, styledashed|stylenolabel);
plottext(strformat("%.2f",neary+(rangey*0.236))
,barcount,neary+(rangey*0.236), colorwhite);
plot(linearray(nearx+(rangex*0.382),neary+(rangey*0.382),barcount-1,neary+(rangey*0.382)),
"", colorgreen, styledashed|stylenolabel);
plottext(strformat("%.2f",neary+(rangey*0.382))
,barcount,neary+(rangey*0.382), colorwhite);
plot(linearray(nearx+(rangex*0.5),neary+(rangey*0.5),barcount-1,neary+(rangey*0.5)),
"", colorgreen, styledashed|stylenolabel);
plottext(strformat("%.2f",neary+(rangey*0.5)) ,barcount,neary+(rangey*0.5),
colorwhite);
plot(linearray(nearx+(rangex*0.618),neary+(rangey*0.618),barcount-1,neary+(rangey*0.618)),
"", colorgreen, styledashed|stylenolabel);
plottext(strformat("%.2f",neary+(rangey*0.618))
,barcount,neary+(rangey*0.618), colorwhite);
plot(linearray(nearx+(rangex*0.786),neary+(rangey*0.786),barcount-1,neary+(rangey*0.786)),
"", colorgreen, styledashed|stylenolabel);
plottext(strformat("%.2f",neary+(rangey*0.786))
,barcount,neary+(rangey*0.786), colorwhite);
plot(linearray(farx,fary,barcount-1,fary), "", colorgreen,
styledashed|stylenolabel);
plottext(strformat("%.2f",fary) ,barcount,fary, colorwhite);
plot(linearray(nearx,neary,barcount-1,neary), "", colorgreen,
styledashed|stylenolabel);
plottext(strformat("%.2f",neary) ,barcount,neary, colorwhite);
if(showtargetext)
{
plot(linearray(farx,neary+(rangey*1.27),barcount-1,neary+(rangey*1.27)), "",
colorgreen, styledashed|stylenolabel);
plottext(strformat("%.2f",neary+(rangey*01.27))
,barcount,neary+(rangey*1.27), colorwhite);
plot(linearray(farx,neary+(rangey*1.618),barcount-1,neary+(rangey*1.618)),
"", colorgreen, styledashed|stylenolabel);
plottext(strformat("%.2f",neary+(rangey*01.618))
,barcount,neary+(rangey*1.618), colorwhite);
}
}
}
//----------------------------------------------------------------------------------------
plot(c, "", iif(o>c, colorred, colorgreen), paramstyle("price
style",stylebar,maskprice));
title = name()+" - "+interval(2)+" - "+"{{date}} - "+strformat("open=%.2f,
high=%.2f, low=%.2f, close=%.2f", o, h, l, c)+strformat(" (%.2f %.2f%%)",
c-ref(c, -1), selectedvalue(roc(c, 1)));
_section_end();

filter=bcon;

addtextcolumn ( fullname(), "full__________name", 1.2 );

addcolumn(bcon , "_____", 1.2 );


_SECTION_BEGIN("Fib Retracements");
nbar = Param("Term",5,2,9,1);
fibs = ParamToggle("Plot Fibs","Off|On",0);
Hlb = Param ("Hi LookBack",2,1,BarCount-1,1);
Llb = Param ("Lo LookBack",1,1,BarCount-1,1);
Back = Param ("Extend Left = 2",1,1,500,1);
Fwd = Param("Plot Forward", 0, 0, 500, 1);
text = ParamToggle("Plot Text","Off|On",1);
hts = Param ("Text Shift", -7.5,-50,50,0.10);
style =ParamStyle("Line Style",styleLine,styleNoLabel);

x = BarIndex();

pRp = H > Ref(HHV(H,nbar),-1) AND Ref(HHV(H,nbar),nbar) <= H; // fractals in place of peak
yRp0 = SelectedValue(ValueWhen( pRp,H,Hlb ));
xRp0 = SelectedValue(ValueWhen( pRp,x,Hlb));

pSp = L < Ref(LLV(L,nbar),-1) AND Ref(LLV(L,nbar),nbar) >= L; // fractals in place of trough
ySp0 = SelectedValue(ValueWhen( pSp, L,Llb));
xSp0 = SelectedValue(ValueWhen( pSp,x,Llb));

pkval=ValueWhen(pRp,H);
trval=ValueWhen(pSp,L);

UP = xRp0>xSp0;//upSwing
DN = xSp0>xRp0;//DownSwing

RT=IIf(UP,-100*(yRp0-L)/(yRp0-ySp0),100*(H-ySp0)/(yRp0-ySp0));

Delta = (yRp0 - ySp0) OR (ySp0-yRp0);

function fib(ret)
{
retval = (Delta * ret);
Fibval =
IIf(ret < 1.0 AND xSp0 < xRp0, yRp0 - retval,
IIf(ret < 1.0 AND xSp0 > xRp0, ySp0 + retval,
IIf(ret > 1.0 AND xSp0 < xRp0, yRp0 - retval,
IIf(ret > 1.0 AND xSp0 > xRp0, ySp0 + retval, Null))));
return FibVal;
}

x0 = Min(xSp0,xRp0)-Back;
x1 = (BarCount -1);

r236 = fib(0.236); r236I = LastValue (r236,1);
r382 = fib(0.382); r382I = LastValue (r382,1);
r050 = fib(0.50); r050I = LastValue (r050,1);
r618 = fib(0.618); r618I = LastValue (r618,1);
r786 = fib(0.786); r786I = LastValue (r786,1);
e127 = fib(1.27); e127I = LastValue (e127,1);
e162 = fib(1.62); e162I = LastValue (e162,1);
e200 = fib(2.00); e200I = LastValue (e200,1);
e262 = fib(2.62); e262I = LastValue (e262,1);
e324 = fib(3.24); e324I = LastValue (e324,1);
e424 = fib(4.24); e424I = LastValue (e424,1);

p00 = IIf(xSp0 > xRp0,ySp0,yRp0); p00I = LastValue (p00,1);
p100 = IIf(xSp0 < xRp0,ySp0,yRp0); p100I = LastValue (p100,1);


color00 =IIf(xSp0 > xRp0,colorLime,colorRed);
color100 =IIf(xSp0 < xRp0,colorLime,colorRed);


numbars = LastValue(Cum(Status("barvisible")));
fraction= IIf(StrRight(Name(),3) == "", 3.2, 3.2);

if(fibs==1)
{
Plot(LineArray(xRp0-Fwd,yRp0,x1,yRp0,Back),"res",31,9|styleNoRescale,Null,Null,Fwd);
Plot(LineArray(xSp0-Fwd,ySp0,x1,ySp0,Back),"sup",31,9|styleNoRescale,Null,Null,Fwd);
Plot(LineArray(x0-Fwd,r236,x1,r236,back),"",31,style|styleNoRescale, Null,Null,Fwd);
Plot(LineArray(x0-Fwd,r382,x1,r382,Back),"",31,style|styleNoRescale, Null,Null,Fwd);
Plot(LineArray(x0-Fwd,r050,x1,r050,Back),"",31,style|styleNoRescale, Null,Null,Fwd);
Plot(LineArray(x0-Fwd,r618,x1,r618,Back),"",31,style|styleNoRescale, Null,Null,Fwd);
Plot(LineArray(x0-Fwd,r786,x1,r786,Back),"",31,style|styleNoRescale, Null,Null,Fwd);
Plot(LineArray(x0-Fwd,e127,x1,e127,Back),"e127",31,style|styleNoRescale,Null,Null,Fwd);
Plot(LineArray(x0-Fwd,e162,x1,e162,Back),"e162",31,style|styleNoRescale,Null,Null,Fwd);
Plot(LineArray(x0-Fwd,e200,x1,e200,Back),"p200",31,8|styleNoRescale,Null,Null,Fwd);
Plot(LineArray(x0-Fwd,e262,x1,e262,Back),"p262",31,style|styleNoRescale,Null,Null,Fwd);
Plot(LineArray(x0-Fwd,e324,x1,e324,Back),"p324",31,style|styleNoRescale,Null,Null,Fwd);
Plot(LineArray(x0-Fwd,e424,x1,e424,Back),"p424",31,style|styleNoRescale,Null,Null,Fwd);
}

if(text==1)
{
PlotText(" 0% = " + WriteVal(p00,fraction),LastValue(BarIndex())-(numbars/hts), p00I + 0.05, color00);
PlotText("23% = " + WriteVal(r236,fraction),LastValue(BarIndex())-(numbars/hts), r236I + 0.05, 45);
PlotText("38% = " + WriteVal(r382,fraction),LastValue(BarIndex())-(numbars/hts), r382I + 0.05, 44);
PlotText("50% = " + WriteVal(r050,fraction),LastValue(BarIndex())-(numbars/hts), r050I + 0.05, 41);
PlotText("62% = " + WriteVal(r618,fraction),LastValue(BarIndex())-(numbars/hts), r618I + 0.05, 43);
PlotText("78% = " + WriteVal(r786,fraction),LastValue(BarIndex())-(numbars/hts), r786I + 0.05, 42);
PlotText("100% = " + WriteVal(p100,fraction),LastValue(BarIndex())-(numbars/hts),p100I + 0.05, color100);
PlotText("127% = " + WriteVal(e127,fraction),LastValue(BarIndex())-(numbars/hts),e127I + 0.05, 47);
PlotText("162% = " + WriteVal(e162,fraction),LastValue(BarIndex())-(numbars/hts),e162I + 0.05, 47);
PlotText("200% = " + WriteVal(e200,fraction),LastValue(BarIndex())-(numbars/hts),e200I + 0.05, 47);
PlotText("262% = " + WriteVal(e262,fraction),LastValue(BarIndex())-(numbars/hts),e262I + 0.05, 47);
PlotText("324% = " + WriteVal(e324,fraction),LastValue(BarIndex())-(numbars/hts),e324I + 0.05, 47);
PlotText("424% = " + WriteVal(e424,fraction),LastValue(BarIndex())-(numbars/hts),e424I + 0.05, 25);
}
_SECTION_END();

كذا تمام او بس تبغا نسبة 50 و 61 بس و خذ راحتك اطلب الله يوفقك



رد مع اقتباس
قديم 26-10-2014, 11:36 AM
  المشاركه #129

محلل فني

تاريخ التسجيل: Jul 2007
المشاركات: 2,069
JLocIg JLo غير متواجد حالياً  

اقتباس:
المشاركة الأصلية كتبت بواسطة douplexx مشاهدة المشاركة
الله يسعدك اخوي الداب 300




_section_begin("harmonic patterns");
//abdulkareem alghamdi - june 2012
percentage = param("percentage", 5, 1, 100, 0.1);
showtarget = paramlist("show target from:", "off|c-d|a-d |x-a|b-c");
showtargetext = paramtoggle("show target extensions?", "no|yes");
back = param("look back", 1, 1, 100, 1);
currection = param("currection:", 50, 5, 100,1);
//----------------------------------------------------------------------------------------
ax = bx = cx = dx = xx= 0;
ay = by = cy = dy = xy = 0;
bcon = scon = xcon = 0;
//----------------------------------------------------------------------------------------
procedure setuppattern(per, back)
{
backl = lastvalue(troughbars(l, per, back ));
backh = lastvalue(peakbars(h, per, back ));
backl2 = lastvalue(troughbars(l, per, back +1));
backh2 = lastvalue(peakbars(h, per, back+1));
backl3 = lastvalue(troughbars(l, per, back +2));
backh3 = lastvalue(peakbars(h, per, back +2));

if(backl < backh)
{
if(backl2 < backh)
for(i=back+1; backl2 < backh and i < back+currection; i++)
backl2 = lastvalue(troughbars(l, per, back + i));
if(backh2 < backl2)
for(i=back+1; backh2 < backl2 and i < back+currection; i++)
backh2 = lastvalue(peakbars(h, per, back + i));
if(backl3 < backh2)
for(i=back+2; backl3 < backh2 and i < back+currection; i++)
backl3 = lastvalue(troughbars(l, per, back + i));
if(backh3 < backl3)
for(i=back+2; backh3 < backl3 and i < back+currection; i++)
backh3 = lastvalue(peakbars(h, per, back + i));
}
else
{
if(backh2 < backl)
for(i=back+1; backh2 < backl and i < back+currection; i++)
backh2 = lastvalue(peakbars(h, per, back + i));
if(backl2 < backh2)
for(i=back+1; backl2 < backh2 and i < back+currection; i++)
backl2 = lastvalue(troughbars(l, per, back + i));
if(backh3 < backl2)
for(i=back+2; backh3 < backl2 and i < back+currection; i++)
backh3 = lastvalue(peakbars(h, per, back + i));
if(backl3 < backh3)
for(i=back+2; backl3 < backh3 and i < back+currection; i++)
backl3 = lastvalue(troughbars(l, per, back + i));
}
ax = barcount-1-lastvalue(max(backh2, backl2));
bx = barcount-1-lastvalue(min(backl2, backh2));
cx = barcount-1-lastvalue(max(backh, backl));
dx = barcount-1-lastvalue(min(backl, backh));

if(backl > backh)
{
ay = lastvalue((ref(l, -backl2)));
by = lastvalue((ref(h, -backh2)));
cy = lastvalue((ref(l, -backl)));
dy = lastvalue((ref(h, -backh)));
xy = lastvalue((ref(h, -backh3)));
xx = barcount-1-backh3;
xcon = xy > by and backh3 > backl2;
con = ((by-cy)/(by-ay)) > 0.3 and ((by-cy)/(by-ay)) < 0.8;
con = con and (ax < bx) and (bx < cx) and (cx < dx) and (ay < cy) and (cy <
by) and (by < dy);
con = con and backl2 > backh2 and backl > backh;
con = con and ((by-cy)/(by-ay)) >=0.3 and ((dy-cy)/(by-cy))>=1;
scon = con and ((dy-cy)/(xy-ay)) >=0.5 and ((by-ay)/(xy-ay))>=0.3;
}
else
{
ay = lastvalue((ref(h, -backh2)));
by = lastvalue((ref(l, -backl2)));
cy = lastvalue((ref(h, -backh)));
dy = lastvalue((ref(l, -backl)));
xy = lastvalue((ref(l, -backl3)));
xx = barcount-1-backl3;
xcon = xy < by and backl3 > backh2;
con = ((cy-by)/(ay-by)) > 0.5 and ((cy-by)/(ay-by)) < 0.8;
con = con and (ax < bx) and (bx < cx) and (cx < dx) and (ay > cy) and (cy >
by) and (by > dy);
con = con and backl2 < backh2 and backl < backh;
con = con and ((cy-dy)/(ay-xy))>=0.3 and ((ay-by)/(ay-xy)) >=0.3;
bcon = con and ((cy-dy)/(ay-by)) >=0.3 and ((cy-dy)/(cy-by)) >=1;
}
}
//----------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------
setuppattern(percentage, back) ;
color = iif(bcon, colorgold, colorred);
//----------------------------------------------------------------------------------------
if(bcon or scon)
{
plot(linearray(ax, ay, bx, by), "", color);//ab
plot(linearray(bx, by, cx, cy), "", color);//bc
plot(linearray(cx, cy, bx, by), "", color);//xb
plot(linearray(ax,ay,cx,cy,back),"ac ",paramcolor( "ac", colorred ),styleline,null, null );
plot(linearray(xx,xy,bx,by,back),"xb ",paramcolor( "xb", colorred ),styleline,null, null );
plot(linearray(cx, cy, ax, ay), "", color);//ca
plot(linearray(cx, cy, dx, dy), "", color);//cd
plot(linearray(ax, ay, cx, cy),"", color, styledashed);//ac
plot(linearray(bx, by, dx, dy),"", color, styledashed);//bd
plottext("a"+strformat("=%.2f", ay), ax, ay, colorwhite);
plottext("b"+strformat("=%.2f", by), bx, by, colorwhite);
plottext("c"+strformat("=%.2f", cy), cx, cy, colorwhite);
plottext("d"+strformat("=%.2f", dy), dx, dy, colorwhite);
plottext(strformat("%.3f", abs((cy-by)/(ay-by))), (ax+cx)/2, (ay+cy)/2,
colorwhite);
plottext(strformat("%.3f", abs((dy-cy)/(by-cy))), (bx+dx)/2, (by+dy)/2,
colorwhite);
if(xcon)
{
plot(linearray(xx, xy, ax, ay), "", color);
plottext("x"+strformat("=%.2f", xy), xx, xy, colorwhite);
plot(linearray(xx, xy, bx, by),"", color, styledashed);
plot(linearray(xx, xy, dx, dy),"", color, styledashed);
plottext(strformat("%.3f", (ay-by)/(ay-xy)), (xx+bx)/2, (xy+by)/2,
colorwhite);
plottext(strformat("%.3f", (cy-dy)/(ay-xy)), (xx+dx)/2, (xy+dy)/2,
colorwhite);
}
if(showtarget!="off")
{
if(showtarget=="c-d")
{
farx = cx;
fary = cy;
}
else
{
farx = ax;
fary = ay;
}

nearx = dx;
neary = dy;
if(showtarget=="x-a")
{
farx = xx;
fary = xy;

nearx = ax;
neary = ay;
}
if(showtarget=="b-c")
{
farx = bx;
fary = by;

nearx = cx;
neary = cy;
}
rangex = farx-nearx;
rangey = fary-neary;
plot(linearray(farx, fary, nearx, neary), "", colorgreen, styledashed);
plot(linearray(nearx+(rangex*0.236),neary+(rangey*0.236),barcount-1,neary+(rangey*0.236)),
"", colorgreen, styledashed|stylenolabel);
plottext(strformat("%.2f",neary+(rangey*0.236))
,barcount,neary+(rangey*0.236), colorwhite);
plot(linearray(nearx+(rangex*0.382),neary+(rangey*0.382),barcount-1,neary+(rangey*0.382)),
"", colorgreen, styledashed|stylenolabel);
plottext(strformat("%.2f",neary+(rangey*0.382))
,barcount,neary+(rangey*0.382), colorwhite);
plot(linearray(nearx+(rangex*0.5),neary+(rangey*0.5),barcount-1,neary+(rangey*0.5)),
"", colorgreen, styledashed|stylenolabel);
plottext(strformat("%.2f",neary+(rangey*0.5)) ,barcount,neary+(rangey*0.5),
colorwhite);
plot(linearray(nearx+(rangex*0.618),neary+(rangey*0.618),barcount-1,neary+(rangey*0.618)),
"", colorgreen, styledashed|stylenolabel);
plottext(strformat("%.2f",neary+(rangey*0.618))
,barcount,neary+(rangey*0.618), colorwhite);
plot(linearray(nearx+(rangex*0.786),neary+(rangey*0.786),barcount-1,neary+(rangey*0.786)),
"", colorgreen, styledashed|stylenolabel);
plottext(strformat("%.2f",neary+(rangey*0.786))
,barcount,neary+(rangey*0.786), colorwhite);
plot(linearray(farx,fary,barcount-1,fary), "", colorgreen,
styledashed|stylenolabel);
plottext(strformat("%.2f",fary) ,barcount,fary, colorwhite);
plot(linearray(nearx,neary,barcount-1,neary), "", colorgreen,
styledashed|stylenolabel);
plottext(strformat("%.2f",neary) ,barcount,neary, colorwhite);
if(showtargetext)
{
plot(linearray(farx,neary+(rangey*1.27),barcount-1,neary+(rangey*1.27)), "",
colorgreen, styledashed|stylenolabel);
plottext(strformat("%.2f",neary+(rangey*01.27))
,barcount,neary+(rangey*1.27), colorwhite);
plot(linearray(farx,neary+(rangey*1.618),barcount-1,neary+(rangey*1.618)),
"", colorgreen, styledashed|stylenolabel);
plottext(strformat("%.2f",neary+(rangey*01.618))
,barcount,neary+(rangey*1.618), colorwhite);
}
}
}
//----------------------------------------------------------------------------------------
plot(c, "", iif(o>c, colorred, colorgreen), paramstyle("price
style",stylebar,maskprice));
title = name()+" - "+interval(2)+" - "+"{{date}} - "+strformat("open=%.2f,
high=%.2f, low=%.2f, close=%.2f", o, h, l, c)+strformat(" (%.2f %.2f%%)",
c-ref(c, -1), selectedvalue(roc(c, 1)));
_section_end();

filter=bcon;

addtextcolumn ( fullname(), "full__________name", 1.2 );

addcolumn(bcon , "_____", 1.2 );


_section_begin("fib retracements");
nbar = param("term",5,2,9,1);
fibs = paramtoggle("plot fibs","off|on",0);
hlb = param ("hi lookback",2,1,barcount-1,1);
llb = param ("lo lookback",1,1,barcount-1,1);
back = param ("extend left = 2",1,1,500,1);
fwd = param("plot forward", 0, 0, 500, 1);
text = paramtoggle("plot text","off|on",1);
hts = param ("text shift", -7.5,-50,50,0.10);
style =paramstyle("line style",styleline,stylenolabel);

x = barindex();

prp = h > ref(hhv(h,nbar),-1) and ref(hhv(h,nbar),nbar) <= h; // fractals in place of peak
yrp0 = selectedvalue(valuewhen( prp,h,hlb ));
xrp0 = selectedvalue(valuewhen( prp,x,hlb));

psp = l < ref(llv(l,nbar),-1) and ref(llv(l,nbar),nbar) >= l; // fractals in place of trough
ysp0 = selectedvalue(valuewhen( psp, l,llb));
xsp0 = selectedvalue(valuewhen( psp,x,llb));

pkval=valuewhen(prp,h);
trval=valuewhen(psp,l);

up = xrp0>xsp0;//upswing
dn = xsp0>xrp0;//downswing

rt=iif(up,-100*(yrp0-l)/(yrp0-ysp0),100*(h-ysp0)/(yrp0-ysp0));

delta = (yrp0 - ysp0) or (ysp0-yrp0);

function fib(ret)
{
retval = (delta * ret);
fibval =
iif(ret < 1.0 and xsp0 < xrp0, yrp0 - retval,
iif(ret < 1.0 and xsp0 > xrp0, ysp0 + retval,
iif(ret > 1.0 and xsp0 < xrp0, yrp0 - retval,
iif(ret > 1.0 and xsp0 > xrp0, ysp0 + retval, null))));
return fibval;
}

x0 = min(xsp0,xrp0)-back;
x1 = (barcount -1);

r236 = fib(0.236); r236i = lastvalue (r236,1);
r382 = fib(0.382); r382i = lastvalue (r382,1);
r050 = fib(0.50); r050i = lastvalue (r050,1);
r618 = fib(0.618); r618i = lastvalue (r618,1);
r786 = fib(0.786); r786i = lastvalue (r786,1);
e127 = fib(1.27); e127i = lastvalue (e127,1);
e162 = fib(1.62); e162i = lastvalue (e162,1);
e200 = fib(2.00); e200i = lastvalue (e200,1);
e262 = fib(2.62); e262i = lastvalue (e262,1);
e324 = fib(3.24); e324i = lastvalue (e324,1);
e424 = fib(4.24); e424i = lastvalue (e424,1);

p00 = iif(xsp0 > xrp0,ysp0,yrp0); p00i = lastvalue (p00,1);
p100 = iif(xsp0 < xrp0,ysp0,yrp0); p100i = lastvalue (p100,1);


color00 =iif(xsp0 > xrp0,colorlime,colorred);
color100 =iif(xsp0 < xrp0,colorlime,colorred);


numbars = lastvalue(cum(status("barvisible")));
fraction= iif(strright(name(),3) == "", 3.2, 3.2);

if(fibs==1)
{
plot(linearray(xrp0-fwd,yrp0,x1,yrp0,back),"res",31,9|stylenorescale,null,null,fwd);
plot(linearray(xsp0-fwd,ysp0,x1,ysp0,back),"sup",31,9|stylenorescale,null,null,fwd);
plot(linearray(x0-fwd,r236,x1,r236,back),"",31,style|stylenorescale, null,null,fwd);
plot(linearray(x0-fwd,r382,x1,r382,back),"",31,style|stylenorescale, null,null,fwd);
plot(linearray(x0-fwd,r050,x1,r050,back),"",31,style|stylenorescale, null,null,fwd);
plot(linearray(x0-fwd,r618,x1,r618,back),"",31,style|stylenorescale, null,null,fwd);
plot(linearray(x0-fwd,r786,x1,r786,back),"",31,style|stylenorescale, null,null,fwd);
plot(linearray(x0-fwd,e127,x1,e127,back),"e127",31,style|stylenorescale,null,null,fwd);
plot(linearray(x0-fwd,e162,x1,e162,back),"e162",31,style|stylenorescale,null,null,fwd);
plot(linearray(x0-fwd,e200,x1,e200,back),"p200",31,8|stylenorescale,null,null,fwd);
plot(linearray(x0-fwd,e262,x1,e262,back),"p262",31,style|stylenorescale,null,null,fwd);
plot(linearray(x0-fwd,e324,x1,e324,back),"p324",31,style|stylenorescale,null,null,fwd);
plot(linearray(x0-fwd,e424,x1,e424,back),"p424",31,style|stylenorescale,null,null,fwd);
}

if(text==1)
{
plottext(" 0% = " + writeval(p00,fraction),lastvalue(barindex())-(numbars/hts), p00i + 0.05, color00);
plottext("23% = " + writeval(r236,fraction),lastvalue(barindex())-(numbars/hts), r236i + 0.05, 45);
plottext("38% = " + writeval(r382,fraction),lastvalue(barindex())-(numbars/hts), r382i + 0.05, 44);
plottext("50% = " + writeval(r050,fraction),lastvalue(barindex())-(numbars/hts), r050i + 0.05, 41);
plottext("62% = " + writeval(r618,fraction),lastvalue(barindex())-(numbars/hts), r618i + 0.05, 43);
plottext("78% = " + writeval(r786,fraction),lastvalue(barindex())-(numbars/hts), r786i + 0.05, 42);
plottext("100% = " + writeval(p100,fraction),lastvalue(barindex())-(numbars/hts),p100i + 0.05, color100);
plottext("127% = " + writeval(e127,fraction),lastvalue(barindex())-(numbars/hts),e127i + 0.05, 47);
plottext("162% = " + writeval(e162,fraction),lastvalue(barindex())-(numbars/hts),e162i + 0.05, 47);
plottext("200% = " + writeval(e200,fraction),lastvalue(barindex())-(numbars/hts),e200i + 0.05, 47);
plottext("262% = " + writeval(e262,fraction),lastvalue(barindex())-(numbars/hts),e262i + 0.05, 47);
plottext("324% = " + writeval(e324,fraction),lastvalue(barindex())-(numbars/hts),e324i + 0.05, 47);
plottext("424% = " + writeval(e424,fraction),lastvalue(barindex())-(numbars/hts),e424i + 0.05, 25);
}
_section_end();

كذا تمام او بس تبغا نسبة 50 و 61 بس و خذ راحتك اطلب الله يوفقك
ليه ما تكون قيم الفيبو على اليسار افضل وبعدين رجع خط النموذج والترند دقيق رجعه غليظ



رد مع اقتباس
قديم 26-10-2014, 11:44 AM
  المشاركه #130

عضو هوامير المميز

تاريخ التسجيل: Oct 2013
المشاركات: 503
DABL@ غير متواجد حالياً  

اقتباس:
المشاركة الأصلية كتبت بواسطة almasdar مشاهدة المشاركة
يصبحك بالنور والسرور

للاسف ماضبط معي



يا عم ابو محمد كرر علي احفظ مرتين العلامة اللي زي المطرقه


/*
VierBox ver 0.1. Messy programming, rough plotting, barely usable :D
ver 0.2. * Parameter VierBox per saham bisa di save. Tidak perlu lagi memakai
Draw Rectangle. Big time saver :D
* Plot yang lebih halus
* fitur untuk menampilkan/menyembunyikan VierBox
* fitur untuk menampilkan/menyembunyikan garis vertikal
* fitur untuk menampilkan dan merubah warna VierBox (masih sangat sederhana)
* fitur untuk merubah warna garis
* Bagian Title akan memberikan informasi jika ada parameter yang berubah sejak
disave dan memberi rekomendasi apa yang hrs dilakukan.

Cara penggunaan: Klik "RESET ALL" untuk menampilkan parameter yang telah disave
atau
Klik "SAVE" untuk menyimpan parameter yang telah ubah

Technical stuff: parameter setiap saham disimpan di ectory c:\amibroker\vierbox\namasaham.txt

Saran, usul dan komentar dipersilahkan.

*/

_SECTION_BEGIN("Save Parameter Vierbox");
save=ParamTrigger( "Save Parameter VierBox?", "KLIK DISINI UNTUK SAVE") ;
_SECTION_END();

_SECTION_BEGIN("Display VierBox");
DisplayVierBox=ParamToggle("Display VierBox?","Yes|No",0);
_SECTION_END();



_SECTION_BEGIN("VierBox by DF");


//tampilanVierBox=ParamToggle("VierBox yang Ditampilkan","Permanen|Setup",0);
//jumlahBarDiBox = Param("Jumlah Bar di Box", 15, 5, 20);
//Offset= Param("Start mundur berapa bar",75,1,200);
//LineColor = ParamColor("Warna Garis", colorGreen);
//ColorBox1 = ParamColor("Warna Box 1",colorLightYellow);
//ColorBox2 = ParamColor("Warna Box 2",colorAqua);
//DisplayBoxColor=ParamToggle("Display Box Color","Yes|No",0);
//displayVerLine=ParamToggle("Display Vertical Line","Yes|No",0);


SetChartOptions(0,chartShowArrows|chartShowDates);
Plot(C,"C",colorBlack,styleCandle);
SetBarsRequired(100000, 100000);
EnableTextOutput(False);

if (displayVierBox==0) //section vierbox by DF hanya akan ditampilkan kalau displayVierBox==0
{

//Buka file
input_file=Name()+".txt";
input_folder="vierbox";
fh=fopen(input_folder+"\\"+input_file,"r");
if(fh)
{
strFile=fgets(fh);
fclose(fh);

strStartBar=StrExtract(strfile,0);
strJumlahBarDiBox=StrExtract(strFile,1);
strdisplayVerLine=StrExtract(strFile,2);
strDisplayBoxColor=StrExtract(strFile,3);
strlineColor=StrExtract(strFile,4);
strColorBox1=StrExtract(strFile,5);
strColorBox2=StrExtract(strFile,6);

startBar=StrToNum(strStartBar);
lastBar = LastValue(BarIndex()); //value jumlah total bar
Offset=Lastbar-startBar; //box mulai di sini. Nilai offset keluar cuma sekali di sini!
Offset= Param("Start Mundur Berapa Bar?",50,1,200);
startBar=LastBar-Offset;
jumlahBarDiBox=StrToNum(strJumlahBarDiBox);

jumlahBarDiBox = Param("Jumlah Bar di Box", StrToNum(strJumlahBarDiBox), 5, 20);
displayVerLine=ParamToggle("Display Vertical Line","Yes|No",StrToNum(strdisplayVerLine));
DisplayBoxColor=ParamToggle("Display Box Color","Yes|No",StrToNum(strDisplayBoxColor));
ColorBox1 = ParamColor("Warna Box 1",StrToNum(strColorBox1));
ColorBox2 = ParamColor("Warna Box 2",StrToNum(strColorBox2));
lineColor = ParamColor("Warna Garis", StrToNum(strLineColor));

}
else //jika file yang mau dibuka gak ada, bikin jadi default dan save
{
printf("error open file");
Offset= Param("Start Mundur Berapa Bar?",75,1,200);
lastBar = LastValue(BarIndex());
startBar=Lastbar-Offset;

jumlahBarDiBox = Param("Jumlah Bar di Box", 15, 5, 20);
displayVerLine=ParamToggle("Display Vertical Line","Yes|No",0);
DisplayBoxColor=ParamToggle("Display Box Color","Yes|No",1);
ColorBox1 = ParamColor("Warna Box 1",colorLightYellow);
ColorBox2 = ParamColor("Warna Box 2",colorAqua);
LineColor = ParamColor("Warna Garis", colorGreen);

//save
Output_file=Name()+".txt";
Output_folder="vierbox";
fmk(Output_folder);
fh=fopen(Output_folder+"\\"+Output_file,"w");
fputs(NumToStr(startBar,1.0,False)+","+NumToStr(jumlahBarDiBox,1.0,False)+","+
NumToStr(displayVerLine,1.0,False)+","+ NumToStr(displayBoxColor,1.0,False)+","+
NumToStr(Linecolor,1.0,False)+","+NumToStr(ColorBox1,1.0,False)+","+
NumToStr(ColorBox2,1.0,False) , fh);
fclose(fh); fclose(fh);
}; //end if fh

lastBar = LastValue(BarIndex()); //value jumlah total bar
//startBar=Lastbar-Offset; //box mulai di sini. Nilai offset keluar cuma sekali di sini!
lArray=LLV( Low, jumlahBardiBox); //cari Low terendah di box awal
hArray=HHV(High,jumlahBardiBox); //cari High tertinggi di box awal

VierL=Larray[startBar-1];//convert lArray jadi value
VierH=Harray[startBar-1];//convert hArray jadi value
range=VierH-VierL;//hitung tinggi box awal


//cari baseline box, sedekat mungkin dengan harga 0
//berguna agar box-box di depan selalu berada dekat bar-bar harga
baselineBoxGenap=VierL-int(VierL/range)*range;
baselineBoxGanjil=VierL-int(VierL/range)*range-range/2;

//start Buat box awal
x0=-jumlahBarDiBox+startBar;
x1=startBar;
garisBawah=LineArray(x0,VierL,x1,VierL,0);
garisAtas=LineArray(x0,VierH,x1,VierH,0);
Plot(garisBawah,"", LineColor);//garis bawah box
displace=5;

Plot(garisAtas,"", LineColor);//garis atas box
//selesai buat box awal

//hitung harus buat berapa box ke depan(horisontal dan vertikal)
jumlahBoxH=int((LastBar-startBar)/jumlahBarDiBox)+1;//jumlah box ke depan yang akan dibuat

//Plot Vertical Line
if (displayVerLine==0)
{
for (k=0;k<jumlahBoxH+1;k++)
{
x0=-jumlahBarDiBox+startBar+k*jumlahBarDiBox;
Plot( BarIndex()==x0, "", LineColor, styleOwnScale |styleHistogram );
} //end for
}
if (displayBoxColor==0)PlotOHLC(Null,garisAtas,garisBawah,Null,"",ColorBox1,style Cloud+styleNoLabel);

for (k=1;k<jumlahBoxH;k++) //mulai buat box didepan sebanyak jumlahBoxH
{
testGanjil=int(k/2)-k/2;//genap jika nilainya 0
boxNo=k;
boxL=lArray[startBar-1 + boxNo*jumlahBarDiBox];
boxH=hArray[startBar-1 + boxNo*jumlahBarDiBox];
jumlahBoxV=int(boxH/range)+1;

//kalau box genap
if (testGanjil==0)
{
//di box yang genap ke depan, buat plot
for (j=1;j<=jumlahBoxV;j++)
{
if ((baselineBoxGenap+j*range)>boxL) //buat plot hanya kalau dekat dengan bar
{
x0=-jumlahBarDiBox+startBar+boxNo*jumlahBarDiBox;
x1= startBar+boxNo*jumlahBarDiBox;
y=baselineBoxGenap+(j-1)*range;
garisBawah=LineArray(x0,y,x1,y,0);
garisAtas=LineArray(x0,y+range,x1,y+range,0);
Plot(garisBawah,"", LineColor);
Plot(garisatas,"", LineColor);
if (displayBoxColor==0) PlotOHLC(Null,garisAtas,garisBawah,Null,"",ColorBox1,styleCloud+styleNoLabel);
};//end if
};//end for
}
else //kalau box ganjil
{
//di box yang ganjil ke depan, buat plot
for (j=1;j<=jumlahBoxV;j++)
{
if ((baselineBoxGanjil+j*range)>boxL) //buat plot hanya kalau dekat dengan bar
{
x0=-jumlahBarDiBox+startBar+boxNo*jumlahBarDiBox;
x1= startBar+boxNo*jumlahBarDiBox;
y=baselineBoxGanjil+(j-1)*range;
garisBawah=LineArray(x0,y,x1,y,0);
garisAtas=LineArray(x0,y+range,x1,y+range,0);
Plot(garisBawah,"", LineColor);
Plot(garisAtas,"", LineColor);
if (displayBoxColor==0) PlotOHLC(Null,garisAtas,garisBawah,Null,"",ColorBox2,styleCloud+styleNoLabel);
};//end if
}; //end for

};
};


//sekarang plot khusus di box paling kanan. Like I said, messy :(
k=jumlahBoxH;
testGanjil=int(k/2)-k/2;//genap jika nilainya 0
boxNo=jumlahBoxH; //no box yang paling kanan
boxL=LastValue(Larray);
boxH=LastValue(hArray);
jumlahBoxV=int(boxH/range)+1;
if (testGanjil==0) //kalau box genap
{

//di box yang genap ke depan, buat plot
for (j=1;j<=jumlahBoxV;j++)
{
if ((baselineBoxGenap+j*range)>boxL) //buat plot hanya kalau dekat dengan bar
{
x0=-jumlahBarDiBox+startBar+boxNo*jumlahBarDiBox;
x1= startBar+boxNo*jumlahBarDiBox;
y=baselineBoxGenap+(j-1)*range;
garisBawah=LineArray(x0,y,x1,y,0);
garisAtas=LineArray(x0,y+range,x1,y+range,0);
displace=jumlahBarDiBox-(LastBar-x0);
//printf("\ndisplace="+displace);
Plot(Ref(garisbawah,displace),"", LineColor,styleLine , 0,0,displace);//garis bawah box
Plot(Ref(garisAtas,displace),"", LineColor,styleLine , 0,0,displace);//garis atas box
if (displayBoxColor==0) PlotOHLC(Null,Ref(garisbawah,displace),Ref(garisAtas,displace),Null,"",ColorBo x1,styleCloud+styleNoLabel,0,0,displace);

};//end if
};//end for
}
else //kalau box ganjil
{
//di box yang ganjil ke depan, buat plot
for (j=1;j<=jumlahBoxV;j++)
{
if ((baselineBoxGanjil+j*range)>boxL) //buat plot hanya kalau dekat dengan bar
{
x0=-jumlahBarDiBox+startBar+boxNo*jumlahBarDiBox;
x1= startBar+boxNo*jumlahBarDiBox;
//printf("\nx0="+x0);
//printf("\nx1="+x1);
y=baselineBoxGanjil+(j-1)*range;
garisBawah=LineArray(x0,y,x1,y,0);
garisAtas=LineArray(x0,y+range,x1,y+range,0);
displace=jumlahBarDiBox-(LastBar-x0);
Plot(Ref(garisbawah,displace),"", LineColor,styleLine , 0,0,displace);//garis bawah box
Plot(Ref(garisAtas,displace),"", LineColor,styleLine , 0,0,displace);//garis bawah box
if (displayBoxColor==0) PlotOHLC(Null,Ref(garisbawah,displace),Ref(garisAtas,displace),Null,"",ColorBo x2,styleCloud+styleNoLabel,0,0,displace);
};//end if
}; //end for
};



stringVierBox=WriteIf(jumlahBarDiBox!=StrToNum(strJumlahBarDiBox) OR
startBar!=StrToNum(strStartBar) OR
displayVerLine!=StrToNum(strdisplayVerLine) OR
displayBoxColor!=StrToNum(strDisplayBoxColor) OR
Linecolor!=StrToNum(strLineColor) OR
colorBox1!=StrToNum(strColorBox1) OR
colorBox2!=StrToNum(strColorBox2),
EncodeColor(colorRed)+"VierBox "+Name()+" belum disimpan. Di menu Parameters, klik SAVE untuk menyimpan VierBox ini atau klik RESET ALL untuk kembali.",
EncodeColor(colorBlue)+"VierBox "+Name()+" sudah disimpan");



Title =

stringVierBox+"\n\n"+
Date()+
" "+Name()+
EncodeColor(colorBlue)+" O "+EncodeColor(colorBlack)+"= "+O+
EncodeColor(colorBlue)+" H "+EncodeColor(colorBlack)+"= "+H+
EncodeColor(colorBlue)+" L "+EncodeColor(colorBlack)+"= "+L+
EncodeColor(colorBlue)+" C "+EncodeColor(colorBlack)+"= "+C+
EncodeColor(colorBlue)+" V "+EncodeColor(colorBlack)+"= "+ WriteVal(Volume,0);

if (save==1)
{
Output_file=Name()+".txt";
Output_folder="vierbox";
fmk(Output_folder);
fh=fopen(Output_folder+"\\"+Output_file,"w");
fputs(NumToStr(startBar,1.0,False)+","+NumToStr(jumlahBarDiBox,1.0,False)+","+
NumToStr(displayVerLine,1.0,False)+","+ NumToStr(displayBoxColor,1.0,False)+","+
NumToStr(Linecolor,1.0,False)+","+NumToStr(ColorBox1,1.0,False)+","+
NumToStr(ColorBox2,1.0,False) , fh);
fclose(fh);
} //end if

} //end if displayVierBox

_SECTION_END();





ان شاء الله تظبط معك عاد لا عمنا ابو محمد



رد مع اقتباس
قديم 26-10-2014, 12:01 PM
  المشاركه #131

عضو هوامير المميز

تاريخ التسجيل: Oct 2013
المشاركات: 503
DABL@ غير متواجد حالياً  

طيب كذا اخوي الداب 300 كيف





_section_begin("harmonic patterns");
//abdulkareem alghamdi - june 2012
percentage = param("percentage", 5, 1, 100, 0.1);
showtarget = paramlist("show target from:", "off|c-d|a-d |x-a|b-c");
showtargetext = paramtoggle("show target extensions?", "no|yes");
back = param("look back", 1, 1, 100, 1);
currection = param("currection:", 50, 5, 100,1);
//----------------------------------------------------------------------------------------
ax = bx = cx = dx = xx= 0;
ay = by = cy = dy = xy = 0;
bcon = scon = xcon = 0;
//----------------------------------------------------------------------------------------
procedure setuppattern(per, back)
{
backl = lastvalue(troughbars(l, per, back ));
backh = lastvalue(peakbars(h, per, back ));
backl2 = lastvalue(troughbars(l, per, back +1));
backh2 = lastvalue(peakbars(h, per, back+1));
backl3 = lastvalue(troughbars(l, per, back +2));
backh3 = lastvalue(peakbars(h, per, back +2));

if(backl < backh)
{
if(backl2 < backh)
for(i=back+1; backl2 < backh and i < back+currection; i++)
backl2 = lastvalue(troughbars(l, per, back + i));
if(backh2 < backl2)
for(i=back+1; backh2 < backl2 and i < back+currection; i++)
backh2 = lastvalue(peakbars(h, per, back + i));
if(backl3 < backh2)
for(i=back+2; backl3 < backh2 and i < back+currection; i++)
backl3 = lastvalue(troughbars(l, per, back + i));
if(backh3 < backl3)
for(i=back+2; backh3 < backl3 and i < back+currection; i++)
backh3 = lastvalue(peakbars(h, per, back + i));
}
else
{
if(backh2 < backl)
for(i=back+1; backh2 < backl and i < back+currection; i++)
backh2 = lastvalue(peakbars(h, per, back + i));
if(backl2 < backh2)
for(i=back+1; backl2 < backh2 and i < back+currection; i++)
backl2 = lastvalue(troughbars(l, per, back + i));
if(backh3 < backl2)
for(i=back+2; backh3 < backl2 and i < back+currection; i++)
backh3 = lastvalue(peakbars(h, per, back + i));
if(backl3 < backh3)
for(i=back+2; backl3 < backh3 and i < back+currection; i++)
backl3 = lastvalue(troughbars(l, per, back + i));
}
ax = barcount-1-lastvalue(max(backh2, backl2));
bx = barcount-1-lastvalue(min(backl2, backh2));
cx = barcount-1-lastvalue(max(backh, backl));
dx = barcount-1-lastvalue(min(backl, backh));

if(backl > backh)
{
ay = lastvalue((ref(l, -backl2)));
by = lastvalue((ref(h, -backh2)));
cy = lastvalue((ref(l, -backl)));
dy = lastvalue((ref(h, -backh)));
xy = lastvalue((ref(h, -backh3)));
xx = barcount-1-backh3;
xcon = xy > by and backh3 > backl2;
con = ((by-cy)/(by-ay)) > 0.3 and ((by-cy)/(by-ay)) < 0.8;
con = con and (ax < bx) and (bx < cx) and (cx < dx) and (ay < cy) and (cy <
by) and (by < dy);
con = con and backl2 > backh2 and backl > backh;
con = con and ((by-cy)/(by-ay)) >=0.3 and ((dy-cy)/(by-cy))>=1;
scon = con and ((dy-cy)/(xy-ay)) >=0.5 and ((by-ay)/(xy-ay))>=0.3;
}
else
{
ay = lastvalue((ref(h, -backh2)));
by = lastvalue((ref(l, -backl2)));
cy = lastvalue((ref(h, -backh)));
dy = lastvalue((ref(l, -backl)));
xy = lastvalue((ref(l, -backl3)));
xx = barcount-1-backl3;
xcon = xy < by and backl3 > backh2;
con = ((cy-by)/(ay-by)) > 0.5 and ((cy-by)/(ay-by)) < 0.8;
con = con and (ax < bx) and (bx < cx) and (cx < dx) and (ay > cy) and (cy >
by) and (by > dy);
con = con and backl2 < backh2 and backl < backh;
con = con and ((cy-dy)/(ay-xy))>=0.3 and ((ay-by)/(ay-xy)) >=0.3;
bcon = con and ((cy-dy)/(ay-by)) >=0.3 and ((cy-dy)/(cy-by)) >=1;
}
}
//----------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------
setuppattern(percentage, back) ;
color = iif(bcon, colorgold, colorred);
//----------------------------------------------------------------------------------------
if(bcon or scon)
{
plot(linearray(ax, ay, bx, by), "", color,4);//ab
plot(linearray(bx, by, cx, cy), "", color,4);//bc
plot(linearray(cx, cy, bx, by), "", color,4);//xb
plot(linearray(ax,ay,cx,cy,back),"ac ",paramcolor( "ac", colorred ),styleLine+4,null, null );
plot(linearray(xx,xy,bx,by,back),"xb ",paramcolor( "xb", colorred ),styleLine+4,null, null );
plot(linearray(cx, cy, ax, ay), "", color,4);//ca
plot(linearray(cx, cy, dx, dy), "", color,4);//cd
plot(linearray(ax, ay, cx, cy),"", color , styleDashed );//ac
plot(linearray(bx, by, dx, dy),"", color , styleDashed );//bd
plottext("a"+strformat("=%.2f", ay), ax, ay, colorWhite );
plottext("b"+strformat("=%.2f", by), bx, by, colorWhite );
plottext("c"+strformat("=%.2f", cy), cx, cy, colorWhite );
plottext("d"+strformat("=%.2f", dy), dx, dy, colorWhite );
plottext(strformat("%.3f", abs((cy-by)/(ay-by))), (ax+cx)/2, (ay+cy)/2,
colorwhite);
plottext(strformat("%.3f", abs((dy-cy)/(by-cy))), (bx+dx)/2, (by+dy)/2,
colorwhite);
if(xcon)
{
plot(linearray(xx, xy, ax, ay), "", color,4);
plottext("x"+strformat("=%.2f", xy), xx, xy, colorWhite );
plot(linearray(xx, xy, bx, by),"", color, styleDashed );
plot(linearray(xx, xy, dx, dy),"", color, styleDashed );
plottext(strformat("%.3f", (ay-by)/(ay-xy)), (xx+bx)/2, (xy+by)/2,
colorwhite);
plottext(strformat("%.3f", (cy-dy)/(ay-xy)), (xx+dx)/2, (xy+dy)/2,
colorwhite);
}
if(showtarget!="off")
{
if(showtarget=="c-d")
{
farx = cx;
fary = cy;
}
else
{
farx = ax;
fary = ay;
}

nearx = dx;
neary = dy;
if(showtarget=="x-a")
{
farx = xx;
fary = xy;

nearx = ax;
neary = ay;
}
if(showtarget=="b-c")
{
farx = bx;
fary = by;

nearx = cx;
neary = cy;
}
rangex = farx-nearx;
rangey = fary-neary;
plot(linearray(farx, fary, nearx, neary), "", colorgreen, styledashed);
plot(linearray(nearx+(rangex*0.236),neary+(rangey*0.236),barcount-1,neary+(rangey*0.236)),
"", colorgreen, styledashed|stylenolabel);
plottext(strformat("%.2f",neary+(rangey*0.236))
,barcount,neary+(rangey*0.236), colorwhite);
plot(linearray(nearx+(rangex*0.382),neary+(rangey*0.382),barcount-1,neary+(rangey*0.382)),
"", colorgreen, styledashed|stylenolabel);
plottext(strformat("%.2f",neary+(rangey*0.382))
,barcount,neary+(rangey*0.382), colorwhite);
plot(linearray(nearx+(rangex*0.5),neary+(rangey*0.5),barcount-1,neary+(rangey*0.5)),
"", colorgreen, styledashed|stylenolabel);
plottext(strformat("%.2f",neary+(rangey*0.5)) ,barcount,neary+(rangey*0.5),
colorwhite);
plot(linearray(nearx+(rangex*0.618),neary+(rangey*0.618),barcount-1,neary+(rangey*0.618)),
"", colorgreen, styledashed|stylenolabel);
plottext(strformat("%.2f",neary+(rangey*0.618))
,barcount,neary+(rangey*0.618), colorwhite);
plot(linearray(nearx+(rangex*0.786),neary+(rangey*0.786),barcount-1,neary+(rangey*0.786)),
"", colorgreen, styledashed|stylenolabel);
plottext(strformat("%.2f",neary+(rangey*0.786))
,barcount,neary+(rangey*0.786), colorwhite);
plot(linearray(farx,fary,barcount-1,fary), "", colorgreen,
styledashed|stylenolabel);
plottext(strformat("%.2f",fary) ,barcount,fary, colorwhite);
plot(linearray(nearx,neary,barcount-1,neary), "", colorgreen,
styledashed|stylenolabel);
plottext(strformat("%.2f",neary) ,barcount,neary, colorwhite);
if(showtargetext)
{
plot(linearray(farx,neary+(rangey*1.27),barcount-1,neary+(rangey*1.27)), "",
colorgreen, styledashed|stylenolabel);
plottext(strformat("%.2f",neary+(rangey*01.27))
,barcount,neary+(rangey*1.27), colorwhite);
plot(linearray(farx,neary+(rangey*1.618),barcount-1,neary+(rangey*1.618)),
"", colorgreen, styledashed|stylenolabel);
plottext(strformat("%.2f",neary+(rangey*01.618))
,barcount,neary+(rangey*1.618), colorwhite);
}
}
}
//----------------------------------------------------------------------------------------
plot(c, "", iif(o>c, colorred, colorgreen), paramstyle("price
style",stylebar,maskprice));
title = name()+" - "+interval(2)+" - "+"{{date}} - "+strformat("open=%.2f,
high=%.2f, low=%.2f, close=%.2f", o, h, l, c)+strformat(" (%.2f %.2f%%)",
c-ref(c, -1), selectedvalue(roc(c, 1)));
_section_end();

filter=bcon;

addtextcolumn ( fullname(), "full__________name", 1.2 );

addcolumn(bcon , "_____", 1.2 );

_SECTION_BEGIN("Fib Retracements");
fibs = ParamToggle("Plot Fibs","Off|On",0);
pctH = Param ("Pivot Hi %", 0.325,0.001,2.0,0.002);
HiLB = Param ("Hi LookBack",1,1,BarCount-1,1);
pctL = Param ("Pivot Lo %", 0.325,0.001,2.0,0.002);
LoLB = Param ("Lo LookBack",1,1,BarCount-1,1);
Back = Param ("Extend Left = 2",1,1,500,1);
Fwd = Param("Plot Forward", 0, 0, 500, 1);
text = ParamToggle("Plot Text","Off|On",0);
hts = Param ("Text Shift", -33.5,-50,50,0.10);
style =ParamStyle("Line Style",styleLine,styleNoLabel);
x = BarIndex();
pRp = PeakBars( H, pctH, 1) == 0;
yRp0 = SelectedValue(ValueWhen( pRp, H, HiLB));
xRp0 = SelectedValue(ValueWhen( pRp, x, HiLB));
pSp = TroughBars( L, pctL, 1) == 0;
ySp0 = SelectedValue(ValueWhen( pSp, L, LoLB));
xSp0 = SelectedValue(ValueWhen( pSp, x, LoLB));
Delta = yRp0 - ySp0;

function fib(ret)
{
retval = (Delta * ret);
Fibval = IIf(ret < 1.0
AND xSp0 < xRp0, yRp0 - retval, IIf(ret < 1.0
AND xSp0 > xRp0, ySp0 + retval,IIf(ret > 1.0
AND xSp0 < xRp0, yRp0 - retval, IIf(ret > 1.0
AND xSp0 > xRp0, ySp0 + retval, Null))));
return FibVal;
}

x0 = Min(xSp0,xRp0)-Back;
x1 = (BarCount -1);
//////////////////////////////////////////////////////////////////
r236 = fib(0.236); r236I = LastValue (r236,1);
r382 = fib(0.382); r382I = LastValue (r382,1);
r050 = fib(0.50); r050I = LastValue (r050,1);
r618 = fib(0.618); r618I = LastValue (r618,1);
r786 = fib(0.786); r786I = LastValue (r786,1);
e127 = fib(1.27); e127I = LastValue (e127,1);
e162 = fib(1.62); e162I = LastValue (e162,1);
e200 = fib(2.00); e200I = LastValue (e200,1);
e262 = fib(2.62); e262I = LastValue (e262,1);
e424 = fib(4.24); e424I = LastValue (e424,1);
//////////////////////////////////////////////////////////////////
p00 = IIf(xSp0 > xRp0,ySp0,yRp0); p00I = LastValue (p00,1);
p100 = IIf(xSp0 < xRp0,ySp0,yRp0); p100I = LastValue (p100,1);
color00 =IIf(xSp0 > xRp0,colorLime,colorRed);
color100 =IIf(xSp0 < xRp0,colorLime,colorRed);
//////////////////////////////////////////////////////////////////
numbars = LastValue(Cum(Status("barvisible")));
fraction= IIf(StrRight(Name(),3) == "", 3.2, 3.2);
//////////////////////////////////////////////////////////////////
if(fibs==1)
{
Plot(LineArray(xRp0-Fwd,yRp0,x1,yRp0,Back),"PR",32,8|styleNoRescale,Null, Null,Fwd);
Plot(LineArray(xSp0-Fwd,ySp0,x1,ySp0,Back),"PS",27,8|styleNoRescale,Null, Null,Fwd);
Plot(LineArray(x0-Fwd,r236,x1,r236,Back),"",45,style|styleNoRescale,Null, Null,Fwd);
Plot(LineArray(x0-Fwd,r382,x1,r382,Back),"",44,style|styleNoRescale,Null, Null,Fwd);
Plot(LineArray(x0-Fwd,r050,x1,r050,Back),"",41,style|styleNoRescale,Null, Null,Fwd);
Plot(LineArray(x0-Fwd,r618,x1,r618,Back),"",43,style|styleNoRescale,Null, Null,Fwd);
Plot(LineArray(x0-Fwd,r786,x1,r786,Back),"",42,style|styleNoRescale,Null, Null,Fwd);
Plot(LineArray(x0-Fwd,e127,x1,e127,Back),"e127",47,style|styleNoRescale,Null, Null,Fwd);
Plot(LineArray(x0-Fwd,e162,x1,e162,Back),"e162",47,style|styleNoRescale,Null, Null,Fwd);
Plot(LineArray(x0-Fwd,e200,x1,e200,Back),"p200",47,style|styleNoRescale,Null, Null,Fwd);
Plot(LineArray(x0-Fwd,e262,x1,e262,Back),"p262",47,style|styleNoRescale,Null, Null,Fwd);
Plot(LineArray(x0-Fwd,e424,x1,e424,Back),"p424",25,style|styleNoRescale,Null, Null,Fwd);
}
//////////////////////////////////////////////////////////////////
if(text==1)
{
PlotText(" 0% = " + WriteVal(p00,fraction), LastValue(BarIndex())-(numbars/hts), p00I + 0.05, color00);
PlotText("23% = " + WriteVal(r236,fraction), LastValue(BarIndex())-(numbars/hts), r236I + 0.05, 45);
PlotText("38% = " + WriteVal(r382,fraction), LastValue(BarIndex())-(numbars/hts), r382I + 0.05, 44);
PlotText("50% = " + WriteVal(r050,fraction), LastValue(BarIndex())-(numbars/hts), r050I + 0.05, 41);
PlotText("62% = " + WriteVal(r618,fraction), LastValue(BarIndex())-(numbars/hts), r618I + 0.05, 43);
PlotText("78% = " + WriteVal(r786,fraction), LastValue(BarIndex())-(numbars/hts), r786I + 0.05, 42);
PlotText("100% = " + WriteVal(p100,fraction), LastValue(BarIndex())-(numbars/hts),p100I + 0.05, color100);
PlotText("127% = " + WriteVal(e127,fraction), LastValue(BarIndex())-(numbars/hts),e127I + 0.05, 47);
PlotText("162% = " + WriteVal(e162,fraction), LastValue(BarIndex())-(numbars/hts),e162I + 0.05, 47);
PlotText("200% = " + WriteVal(e200,fraction), LastValue(BarIndex())-(numbars/hts),e200I + 0.05, 47);
PlotText("262% = " + WriteVal(e262,fraction), LastValue(BarIndex())-(numbars/hts),e262I + 0.05, 47);
PlotText("424% = " + WriteVal(e424,fraction), LastValue(BarIndex())-(numbars/hts),e424I + 0.05, 25);
}
_SECTION_END();

{
_N(Title = EncodeColor(colorWhite)+StrFormat(" {{NAME}} - {{INTERVAL}} {{DATE}} Open: %g, High: %g, Low: %g, Close: %g {{VALUES}}",O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
}

{
Title = EncodeColor(colorWhite)+ Date() + " Tick = " + EncodeColor(5) + Interval()+
EncodeColor(colorWhite) + " Open = " + EncodeColor(colorWhite) + O +
EncodeColor(colorWhite) + " High = " + EncodeColor(5) + H +
EncodeColor(colorWhite) + " Low = " + EncodeColor(colorRed) + L +
EncodeColor(colorWhite) + " Close = " + EncodeColor(colorWhite) + C + "\n" +
EncodeColor( colorWhite) +"_______________"+"\n"+
EncodeColor( colorWhite) + "424% = " + EncodeColor(25)+ e424 + " " +"\n"+
EncodeColor( colorWhite) + "262% = " + EncodeColor(47)+ e262 + " " +"\n"+
EncodeColor( colorWhite) + "200% = " + EncodeColor(47)+ e200 + " " +"\n"+
EncodeColor( colorWhite) + "162% = " + EncodeColor(47)+ e162 + " " +"\n"+
EncodeColor( colorWhite) + "127% = " + EncodeColor(47)+ e127 + " " +"\n"+
EncodeColor( colorYellow) + " Res = " + EncodeColor(32)+ p100 + " " +"\n"+
EncodeColor( colorWhite) + " 78% = " + EncodeColor(42)+ r786 + " " +"\n"+
EncodeColor( colorWhite) + " 62% = " + EncodeColor(43)+ r618 + " " +"\n"+
EncodeColor( colorWhite) + " 50% = " + EncodeColor(41)+ r050 + " " +"\n"+
EncodeColor( colorWhite) + " 38% = " + EncodeColor(44)+ r382 + " " +"\n"+
EncodeColor( colorWhite) + " 23% = " + EncodeColor(45)+ r236+ " " +"\n"+
EncodeColor( colorYellow) + " Sup = " + EncodeColor(34)+ p00 + " " ;
}



رد مع اقتباس
قديم 26-10-2014, 12:10 PM
  المشاركه #132

محلل فني

تاريخ التسجيل: Jul 2007
المشاركات: 2,069
JLocIg JLo غير متواجد حالياً  

اقتباس:
المشاركة الأصلية كتبت بواسطة douplexx مشاهدة المشاركة
طيب كذا اخوي الداب 300 كيف





_section_begin("harmonic patterns");
//abdulkareem alghamdi - june 2012
percentage = param("percentage", 5, 1, 100, 0.1);
showtarget = paramlist("show target from:", "off|c-d|a-d |x-a|b-c");
showtargetext = paramtoggle("show target extensions?", "no|yes");
back = param("look back", 1, 1, 100, 1);
currection = param("currection:", 50, 5, 100,1);
//----------------------------------------------------------------------------------------
ax = bx = cx = dx = xx= 0;
ay = by = cy = dy = xy = 0;
bcon = scon = xcon = 0;
//----------------------------------------------------------------------------------------
procedure setuppattern(per, back)
{
backl = lastvalue(troughbars(l, per, back ));
backh = lastvalue(peakbars(h, per, back ));
backl2 = lastvalue(troughbars(l, per, back +1));
backh2 = lastvalue(peakbars(h, per, back+1));
backl3 = lastvalue(troughbars(l, per, back +2));
backh3 = lastvalue(peakbars(h, per, back +2));

if(backl < backh)
{
if(backl2 < backh)
for(i=back+1; backl2 < backh and i < back+currection; i++)
backl2 = lastvalue(troughbars(l, per, back + i));
if(backh2 < backl2)
for(i=back+1; backh2 < backl2 and i < back+currection; i++)
backh2 = lastvalue(peakbars(h, per, back + i));
if(backl3 < backh2)
for(i=back+2; backl3 < backh2 and i < back+currection; i++)
backl3 = lastvalue(troughbars(l, per, back + i));
if(backh3 < backl3)
for(i=back+2; backh3 < backl3 and i < back+currection; i++)
backh3 = lastvalue(peakbars(h, per, back + i));
}
else
{
if(backh2 < backl)
for(i=back+1; backh2 < backl and i < back+currection; i++)
backh2 = lastvalue(peakbars(h, per, back + i));
if(backl2 < backh2)
for(i=back+1; backl2 < backh2 and i < back+currection; i++)
backl2 = lastvalue(troughbars(l, per, back + i));
if(backh3 < backl2)
for(i=back+2; backh3 < backl2 and i < back+currection; i++)
backh3 = lastvalue(peakbars(h, per, back + i));
if(backl3 < backh3)
for(i=back+2; backl3 < backh3 and i < back+currection; i++)
backl3 = lastvalue(troughbars(l, per, back + i));
}
ax = barcount-1-lastvalue(max(backh2, backl2));
bx = barcount-1-lastvalue(min(backl2, backh2));
cx = barcount-1-lastvalue(max(backh, backl));
dx = barcount-1-lastvalue(min(backl, backh));

if(backl > backh)
{
ay = lastvalue((ref(l, -backl2)));
by = lastvalue((ref(h, -backh2)));
cy = lastvalue((ref(l, -backl)));
dy = lastvalue((ref(h, -backh)));
xy = lastvalue((ref(h, -backh3)));
xx = barcount-1-backh3;
xcon = xy > by and backh3 > backl2;
con = ((by-cy)/(by-ay)) > 0.3 and ((by-cy)/(by-ay)) < 0.8;
con = con and (ax < bx) and (bx < cx) and (cx < dx) and (ay < cy) and (cy <
by) and (by < dy);
con = con and backl2 > backh2 and backl > backh;
con = con and ((by-cy)/(by-ay)) >=0.3 and ((dy-cy)/(by-cy))>=1;
scon = con and ((dy-cy)/(xy-ay)) >=0.5 and ((by-ay)/(xy-ay))>=0.3;
}
else
{
ay = lastvalue((ref(h, -backh2)));
by = lastvalue((ref(l, -backl2)));
cy = lastvalue((ref(h, -backh)));
dy = lastvalue((ref(l, -backl)));
xy = lastvalue((ref(l, -backl3)));
xx = barcount-1-backl3;
xcon = xy < by and backl3 > backh2;
con = ((cy-by)/(ay-by)) > 0.5 and ((cy-by)/(ay-by)) < 0.8;
con = con and (ax < bx) and (bx < cx) and (cx < dx) and (ay > cy) and (cy >
by) and (by > dy);
con = con and backl2 < backh2 and backl < backh;
con = con and ((cy-dy)/(ay-xy))>=0.3 and ((ay-by)/(ay-xy)) >=0.3;
bcon = con and ((cy-dy)/(ay-by)) >=0.3 and ((cy-dy)/(cy-by)) >=1;
}
}
//----------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------
setuppattern(percentage, back) ;
color = iif(bcon, colorgold, colorred);
//----------------------------------------------------------------------------------------
if(bcon or scon)
{
plot(linearray(ax, ay, bx, by), "", color,4);//ab
plot(linearray(bx, by, cx, cy), "", color,4);//bc
plot(linearray(cx, cy, bx, by), "", color,4);//xb
plot(linearray(ax,ay,cx,cy,back),"ac ",paramcolor( "ac", colorred ),styleline+4,null, null );
plot(linearray(xx,xy,bx,by,back),"xb ",paramcolor( "xb", colorred ),styleline+4,null, null );
plot(linearray(cx, cy, ax, ay), "", color,4);//ca
plot(linearray(cx, cy, dx, dy), "", color,4);//cd
plot(linearray(ax, ay, cx, cy),"", color , styledashed );//ac
plot(linearray(bx, by, dx, dy),"", color , styledashed );//bd
plottext("a"+strformat("=%.2f", ay), ax, ay, colorwhite );
plottext("b"+strformat("=%.2f", by), bx, by, colorwhite );
plottext("c"+strformat("=%.2f", cy), cx, cy, colorwhite );
plottext("d"+strformat("=%.2f", dy), dx, dy, colorwhite );
plottext(strformat("%.3f", abs((cy-by)/(ay-by))), (ax+cx)/2, (ay+cy)/2,
colorwhite);
plottext(strformat("%.3f", abs((dy-cy)/(by-cy))), (bx+dx)/2, (by+dy)/2,
colorwhite);
if(xcon)
{
plot(linearray(xx, xy, ax, ay), "", color,4);
plottext("x"+strformat("=%.2f", xy), xx, xy, colorwhite );
plot(linearray(xx, xy, bx, by),"", color, styledashed );
plot(linearray(xx, xy, dx, dy),"", color, styledashed );
plottext(strformat("%.3f", (ay-by)/(ay-xy)), (xx+bx)/2, (xy+by)/2,
colorwhite);
plottext(strformat("%.3f", (cy-dy)/(ay-xy)), (xx+dx)/2, (xy+dy)/2,
colorwhite);
}
if(showtarget!="off")
{
if(showtarget=="c-d")
{
farx = cx;
fary = cy;
}
else
{
farx = ax;
fary = ay;
}

nearx = dx;
neary = dy;
if(showtarget=="x-a")
{
farx = xx;
fary = xy;

nearx = ax;
neary = ay;
}
if(showtarget=="b-c")
{
farx = bx;
fary = by;

nearx = cx;
neary = cy;
}
rangex = farx-nearx;
rangey = fary-neary;
plot(linearray(farx, fary, nearx, neary), "", colorgreen, styledashed);
plot(linearray(nearx+(rangex*0.236),neary+(rangey*0.236),barcount-1,neary+(rangey*0.236)),
"", colorgreen, styledashed|stylenolabel);
plottext(strformat("%.2f",neary+(rangey*0.236))
,barcount,neary+(rangey*0.236), colorwhite);
plot(linearray(nearx+(rangex*0.382),neary+(rangey*0.382),barcount-1,neary+(rangey*0.382)),
"", colorgreen, styledashed|stylenolabel);
plottext(strformat("%.2f",neary+(rangey*0.382))
,barcount,neary+(rangey*0.382), colorwhite);
plot(linearray(nearx+(rangex*0.5),neary+(rangey*0.5),barcount-1,neary+(rangey*0.5)),
"", colorgreen, styledashed|stylenolabel);
plottext(strformat("%.2f",neary+(rangey*0.5)) ,barcount,neary+(rangey*0.5),
colorwhite);
plot(linearray(nearx+(rangex*0.618),neary+(rangey*0.618),barcount-1,neary+(rangey*0.618)),
"", colorgreen, styledashed|stylenolabel);
plottext(strformat("%.2f",neary+(rangey*0.618))
,barcount,neary+(rangey*0.618), colorwhite);
plot(linearray(nearx+(rangex*0.786),neary+(rangey*0.786),barcount-1,neary+(rangey*0.786)),
"", colorgreen, styledashed|stylenolabel);
plottext(strformat("%.2f",neary+(rangey*0.786))
,barcount,neary+(rangey*0.786), colorwhite);
plot(linearray(farx,fary,barcount-1,fary), "", colorgreen,
styledashed|stylenolabel);
plottext(strformat("%.2f",fary) ,barcount,fary, colorwhite);
plot(linearray(nearx,neary,barcount-1,neary), "", colorgreen,
styledashed|stylenolabel);
plottext(strformat("%.2f",neary) ,barcount,neary, colorwhite);
if(showtargetext)
{
plot(linearray(farx,neary+(rangey*1.27),barcount-1,neary+(rangey*1.27)), "",
colorgreen, styledashed|stylenolabel);
plottext(strformat("%.2f",neary+(rangey*01.27))
,barcount,neary+(rangey*1.27), colorwhite);
plot(linearray(farx,neary+(rangey*1.618),barcount-1,neary+(rangey*1.618)),
"", colorgreen, styledashed|stylenolabel);
plottext(strformat("%.2f",neary+(rangey*01.618))
,barcount,neary+(rangey*1.618), colorwhite);
}
}
}
//----------------------------------------------------------------------------------------
plot(c, "", iif(o>c, colorred, colorgreen), paramstyle("price
style",stylebar,maskprice));
title = name()+" - "+interval(2)+" - "+"{{date}} - "+strformat("open=%.2f,
high=%.2f, low=%.2f, close=%.2f", o, h, l, c)+strformat(" (%.2f %.2f%%)",
c-ref(c, -1), selectedvalue(roc(c, 1)));
_section_end();

filter=bcon;

addtextcolumn ( fullname(), "full__________name", 1.2 );

addcolumn(bcon , "_____", 1.2 );

_section_begin("fib retracements");
fibs = paramtoggle("plot fibs","off|on",0);
pcth = param ("pivot hi %", 0.325,0.001,2.0,0.002);
hilb = param ("hi lookback",1,1,barcount-1,1);
pctl = param ("pivot lo %", 0.325,0.001,2.0,0.002);
lolb = param ("lo lookback",1,1,barcount-1,1);
back = param ("extend left = 2",1,1,500,1);
fwd = param("plot forward", 0, 0, 500, 1);
text = paramtoggle("plot text","off|on",0);
hts = param ("text shift", -33.5,-50,50,0.10);
style =paramstyle("line style",styleline,stylenolabel);
x = barindex();
prp = peakbars( h, pcth, 1) == 0;
yrp0 = selectedvalue(valuewhen( prp, h, hilb));
xrp0 = selectedvalue(valuewhen( prp, x, hilb));
psp = troughbars( l, pctl, 1) == 0;
ysp0 = selectedvalue(valuewhen( psp, l, lolb));
xsp0 = selectedvalue(valuewhen( psp, x, lolb));
delta = yrp0 - ysp0;

function fib(ret)
{
retval = (delta * ret);
fibval = iif(ret < 1.0
and xsp0 < xrp0, yrp0 - retval, iif(ret < 1.0
and xsp0 > xrp0, ysp0 + retval,iif(ret > 1.0
and xsp0 < xrp0, yrp0 - retval, iif(ret > 1.0
and xsp0 > xrp0, ysp0 + retval, null))));
return fibval;
}

x0 = min(xsp0,xrp0)-back;
x1 = (barcount -1);
//////////////////////////////////////////////////////////////////
r236 = fib(0.236); r236i = lastvalue (r236,1);
r382 = fib(0.382); r382i = lastvalue (r382,1);
r050 = fib(0.50); r050i = lastvalue (r050,1);
r618 = fib(0.618); r618i = lastvalue (r618,1);
r786 = fib(0.786); r786i = lastvalue (r786,1);
e127 = fib(1.27); e127i = lastvalue (e127,1);
e162 = fib(1.62); e162i = lastvalue (e162,1);
e200 = fib(2.00); e200i = lastvalue (e200,1);
e262 = fib(2.62); e262i = lastvalue (e262,1);
e424 = fib(4.24); e424i = lastvalue (e424,1);
//////////////////////////////////////////////////////////////////
p00 = iif(xsp0 > xrp0,ysp0,yrp0); p00i = lastvalue (p00,1);
p100 = iif(xsp0 < xrp0,ysp0,yrp0); p100i = lastvalue (p100,1);
color00 =iif(xsp0 > xrp0,colorlime,colorred);
color100 =iif(xsp0 < xrp0,colorlime,colorred);
//////////////////////////////////////////////////////////////////
numbars = lastvalue(cum(status("barvisible")));
fraction= iif(strright(name(),3) == "", 3.2, 3.2);
//////////////////////////////////////////////////////////////////
if(fibs==1)
{
plot(linearray(xrp0-fwd,yrp0,x1,yrp0,back),"pr",32,8|stylenorescale,null, null,fwd);
plot(linearray(xsp0-fwd,ysp0,x1,ysp0,back),"ps",27,8|stylenorescale,null, null,fwd);
plot(linearray(x0-fwd,r236,x1,r236,back),"",45,style|stylenorescale,null, null,fwd);
plot(linearray(x0-fwd,r382,x1,r382,back),"",44,style|stylenorescale,null, null,fwd);
plot(linearray(x0-fwd,r050,x1,r050,back),"",41,style|stylenorescale,null, null,fwd);
plot(linearray(x0-fwd,r618,x1,r618,back),"",43,style|stylenorescale,null, null,fwd);
plot(linearray(x0-fwd,r786,x1,r786,back),"",42,style|stylenorescale,null, null,fwd);
plot(linearray(x0-fwd,e127,x1,e127,back),"e127",47,style|stylenorescale,null, null,fwd);
plot(linearray(x0-fwd,e162,x1,e162,back),"e162",47,style|stylenorescale,null, null,fwd);
plot(linearray(x0-fwd,e200,x1,e200,back),"p200",47,style|stylenorescale,null, null,fwd);
plot(linearray(x0-fwd,e262,x1,e262,back),"p262",47,style|stylenorescale,null, null,fwd);
plot(linearray(x0-fwd,e424,x1,e424,back),"p424",25,style|stylenorescale,null, null,fwd);
}
//////////////////////////////////////////////////////////////////
if(text==1)
{
plottext(" 0% = " + writeval(p00,fraction), lastvalue(barindex())-(numbars/hts), p00i + 0.05, color00);
plottext("23% = " + writeval(r236,fraction), lastvalue(barindex())-(numbars/hts), r236i + 0.05, 45);
plottext("38% = " + writeval(r382,fraction), lastvalue(barindex())-(numbars/hts), r382i + 0.05, 44);
plottext("50% = " + writeval(r050,fraction), lastvalue(barindex())-(numbars/hts), r050i + 0.05, 41);
plottext("62% = " + writeval(r618,fraction), lastvalue(barindex())-(numbars/hts), r618i + 0.05, 43);
plottext("78% = " + writeval(r786,fraction), lastvalue(barindex())-(numbars/hts), r786i + 0.05, 42);
plottext("100% = " + writeval(p100,fraction), lastvalue(barindex())-(numbars/hts),p100i + 0.05, color100);
plottext("127% = " + writeval(e127,fraction), lastvalue(barindex())-(numbars/hts),e127i + 0.05, 47);
plottext("162% = " + writeval(e162,fraction), lastvalue(barindex())-(numbars/hts),e162i + 0.05, 47);
plottext("200% = " + writeval(e200,fraction), lastvalue(barindex())-(numbars/hts),e200i + 0.05, 47);
plottext("262% = " + writeval(e262,fraction), lastvalue(barindex())-(numbars/hts),e262i + 0.05, 47);
plottext("424% = " + writeval(e424,fraction), lastvalue(barindex())-(numbars/hts),e424i + 0.05, 25);
}
_section_end();

{
_n(title = encodecolor(colorwhite)+strformat(" {{name}} - {{interval}} {{date}} open: %g, high: %g, low: %g, close: %g {{values}}",o, h, l, c, selectedvalue( roc( c, 1 ) ) ));
}

{
title = encodecolor(colorwhite)+ date() + " tick = " + encodecolor(5) + interval()+
encodecolor(colorwhite) + " open = " + encodecolor(colorwhite) + o +
encodecolor(colorwhite) + " high = " + encodecolor(5) + h +
encodecolor(colorwhite) + " low = " + encodecolor(colorred) + l +
encodecolor(colorwhite) + " close = " + encodecolor(colorwhite) + c + "\n" +
encodecolor( colorwhite) +"_______________"+"\n"+
encodecolor( colorwhite) + "424% = " + encodecolor(25)+ e424 + " " +"\n"+
encodecolor( colorwhite) + "262% = " + encodecolor(47)+ e262 + " " +"\n"+
encodecolor( colorwhite) + "200% = " + encodecolor(47)+ e200 + " " +"\n"+
encodecolor( colorwhite) + "162% = " + encodecolor(47)+ e162 + " " +"\n"+
encodecolor( colorwhite) + "127% = " + encodecolor(47)+ e127 + " " +"\n"+
encodecolor( coloryellow) + " res = " + encodecolor(32)+ p100 + " " +"\n"+
encodecolor( colorwhite) + " 78% = " + encodecolor(42)+ r786 + " " +"\n"+
encodecolor( colorwhite) + " 62% = " + encodecolor(43)+ r618 + " " +"\n"+
encodecolor( colorwhite) + " 50% = " + encodecolor(41)+ r050 + " " +"\n"+
encodecolor( colorwhite) + " 38% = " + encodecolor(44)+ r382 + " " +"\n"+
encodecolor( colorwhite) + " 23% = " + encodecolor(45)+ r236+ " " +"\n"+
encodecolor( coloryellow) + " sup = " + encodecolor(34)+ p00 + " " ;
}
بيض الله وجهك ورحم والديك مبدع



رد مع اقتباس
إضافة رد


الكلمات الدلالية (Tags)
معادلات, الايمي, بروكر, بعض, شرح, صنع, كيفية

أدوات الموضوع

تعليمات المشاركة
لا تستطيع إضافة مواضيع جديدة
لا تستطيع الرد على المواضيع
لا تستطيع إرفاق ملفات
لا تستطيع تعديل مشاركاتك

BB code is متاحة
كود [IMG] متاحة
كود HTML معطلة

الانتقال السريع



03:30 PM