Ben de aynısını düşünüyorum :)
Printable View
selamlar matriks topicindeki sorumuda bu bölüme koyayım fikir verebilen olursa sevinirim.
1. şart rsi 50 seviesini yukarı kırmış olacak. sonra momentum 100 seviyesini yukarı kırmış olacak. momentum ilk önce kırar ise 100 ve ardından rsi kırarsa bunu kabul etmeyecek . önce rsi sonra momentum kırılımı olcak. sırasi ile yani.
şartlı olan tarafı ben yaptım ama sırası ile olmadı. aşşğı kırsada bukez sinyal üretiyor. ikisininde yukarı kırılımında sırası ile olması gerekiyor.
rsi yukarı 50 seviyesini kırdı diyelim bu şart 1 olacak sonra momentum 100 seviyesni ne zaman kırarsa ikinci şart gerçekleşmiş olacak ozaman sinyal üretecek.
bir nevi rsi kırıldıktan sonra momentumun yukarı kırmasını beklemiş olacak. metastockta alert fonksiyonu var bildiğim ama matrikste yok. tşk.
al:=cross(x,x);
sat:=cross(x,x);
durum:=if(al,1,if(sat,0,prev));
al2:=cross(x,x);
sat2:=cross(x,x);
durum2:=if(al2,1,if(sat2,0,prev));
finalal:=durum=1 and durum2=1;
finalsat:=durum=0 and durum2=0;
finaldurum:=if(finalal,1,if(finalsat,0,prev));
finaldurum
bunu sıralamaya uygun hale getirebilsem sanırım olacak
gec cevap için kusurabakmayınız
tools the Explorer new
col a
RSI(14);
col b
Mo(10);
col c
a12:=RSI(14);
a13:=50;
al:=Cross(a12,a13);
sat:=Cross(a13,a12);
durum:=If(al,1,If(sat,0,PREV));
a1234:=Mo(10);
a12345:=100;
al2:=Cross(a1234,a12345);
sat2:=Cross(a12345,a1234);
durum2:=If(al2,1,If(sat2,0,PREV));
finalal:=durum=1 AND durum2=1;
finalsat:=durum=0 AND durum2=0;
finaldurum:=If(finalal,1,If(finalsat,0,PREV));
finaldurum
bir çok şekilde yapılabilir
yanıt için teşekkürler bende hala çözüm arıyorum sn pazartesi. ben exp. için değilde viop için sistem tersterda teste tabi tutuyorum yukarıdaki formulün benimki ile arasında fark göremedim bu şekilde yapınca uymyor sanki ama deneyip sonucu yazarım.
exp için değilde sistem için sanırım sadece şu bölüm gerekli.
a12:=RSI(14);
a13:=50;
al:=Cross(a12,a13);
sat:=Cross(a13,a12);
durum:=If(al,1,If(sat,0,PREV));
a1234:=Mo(10);
a12345:=100;
al2:=Cross(a1234,a12345);
sat2:=Cross(a12345,a1234);
durum2:=If(al2,1,If(sat2,0,PREV));
finalal:=durum=1 AND durum2=1;
finalsat:=durum=0 AND durum2=0;
finaldurum:=If(finalal,1,If(finalsat,0,PREV));
finaldurum
bu şekilde yapınca sıralama uymuyor çünkü benim formülde de.
İz süren stoploss'u kod olarak nasıl yazabiliriz ?
Ahmet abinin bir formülü var
pr1:=Input("HIGH-LOW-PERIOT",1,500,5);
a1:=If(ValueWhen(1,If(CLOSE>Ref(Mov(H,PR1,E),-1),1,If(CLOSE<Ref(Mov(L,PR1,E),-1),-1,0))
<>0,If(CLOSE>Ref(Mov(H,PR1,E),-1),1,If(CLOSE<Ref(Mov(L,PR1,E),-1),-1,0))) =-1,Ref(H,-1),Ref(L,-1));
A2:= SAR(0.0618 ,0.618000) ;
A3:=(LLV(L,PR1)+HHV(H,PR1))/2;
A4:=ValueWhen(1,C>A1 AND C>(H+L)/2 AND C>A2 ,Ref(A3,-1));
A4
yine aynı şekilde
http://stocata.org/metastock/formulas.html
SVE_Stop_Trail_ModATR
period:=Input("ATR period :",1,100,10);
atrfact:=Input("ATR multiplication :",1,10,3.5);
HiLo:=If(H-L<1.5*Mov(H-L,period,S),H-L, 1.5*Mov(H-L,period,S));
Href:=If(L<=Ref(H,-1),H-Ref(C,-1),(H-Ref(C,-1))-(L-Ref(H,-1))/2);
Lref:=If(H>=Ref(L,-1),Ref(C,-1)-L,(Ref(C,-1)-L)-(Ref(L,-1)-H)/2);
diff1:=Max(HiLo,Href);
diff2:=Max(diff1,Lref);
atrmod:=Wilders(diff2,period);
loss:=atrfact*atrmod;
trail:=
If(C>PREV AND Ref(C,-1)>PREV,
Max(PREV,C-loss),
If(C<PREV AND Ref(C,-1)<PREV,
Min(PREV,C+loss),
If(C>PREV,C-loss,C+loss)));
Trail
***********************
SVE_Stop_Trail_ATR
atrper:=Input("ATR period :",1,100,5);
atrfact:=Input("ATR multiplication :",1,10,3.5);
loss:=atrfact*ATR(atrper);
trail:=
If(C>PREV AND Ref(C,-1)>PREV,
Max(PREV,C-loss),
If(C<PREV AND Ref(C,-1)<PREV,
Min(PREV,C+loss),
If(C>PREV,C-loss,C+loss)));
Trail
* ve kesinlikle bakmanız gereken atr hesaplamaları ile ilgili
http://www.learncfds.com/learn-the-k...ing-stop-loss/
ve
http://www.meta-formula.com/Metastoc...as-S.html#Stop Loss Indicator
Stop Loss Indicator
periodsshort:=Input("periods if short",1,50,10); periodslong:=input("periods
if long",1,50,10);
HHV(H,periodsshort)-atr(periodsshort);{stop loss level for short positions}
LLV(L,periodslong)+ATR(periodslong);{stop loss level for long positions}
ben hiç birini kullanmıyorum
metastockda var olan ı kullanıyorum
Dr:= FmlVar("MTF - Dynamic Balance Point","DBC");
Dsc:=(ValueWhen(1,Dr,Dr)+
ValueWhen(5,Dr,Dr)+
ValueWhen(10,Dr,Dr)+
ValueWhen(15,Dr,Dr)+
ValueWhen(20,Dr,Dr))/5;
Dsc
ve bir önceki konuda ""1. şart rsi 50 seviesini yukarı kırmış olacak. sonra momentum 100 seviyesini yukarı kırmış olacak. momentum ilk önce kırar ise 100 ve ardından rsi kırarsa bunu kabul etmeyecek . önce rsi sonra momentum kırılımı olcak. sırasi ile yani.""""
if then else kalıbı ile oluşturmaya çalışıyorum