Teknik Analiz Dünyasına Hoşgeldiniz. Paylaşmak Güzeldir.

Yayından kaldırmak istediğiniz formüller için algoritmabul@gmail.com ile iletişime geçebilirsiniz... 

  • DİKKAT: Formüller, Sistemler sadece eğitim amaçlıdır. Alım satım, olası anapara kaybı ve diğer kayıplar dahil olmak üzere "YÜKSEK RİSK" içerir.
  • Mucize teknik gösterge yoktur, sadece doğru veya yanlış kullanılan göstergeler vardır.

İndikatör N-day Breakout

Teknik analizde fiyatın yönü veya trendin devamıyla ilgili fikir veren matematiksel modellerdir. İndikatörlerin Türkçe karşılığı göstergedir.

algoritma

eiπ + 1 = 0
Algorithmist
Algoritma
Katılım
23 Eki 2020
Mesajlar
1,797
In a message dated 2/26/00 6:47:50 AM Central Standard Time,
jcob3@xxxxxxxxxxx writes:
Help needed for formula wizards.
I have coded the entry for the n-day breakout system from Perry Kaufmann's "Trading Systems and Methods" as:
ENTER LONG:
n:=20;
nhigh:=Ref(HHV(H,n),-1);
HIGH>nhigh AND CLOSE > Ref(CLOSE,-1)
I would like to be able to vary "n" using a volatility multiplier like this one taken from Chande's "The New Technical Trader",
Stdev(C,20)/Mov(Stdev(C,20),5,S),
so that, ultimately "n" will equal
20*(Stdev(C,20)/Mov(Stdev(C,20),5,S)).
So far so good, but when I try to implement this into the ENTER LONG Formula
I get the following error message.
"This variable or expression must contain only constant data.", referring to the "n" in the "nhigh" formula.
n:=20*(Stdev(C,20)/Mov(Stdev(C,20),5,S));
nhigh:=Ref(HHV(H,n),-1);
HIGH>nhigh AND CLOSE > Ref(CLOSE,-1)
After pondering this I thought that maybe it was because the "n" needed to be a whole number for this particular formula; after all, it must be difficult to select a highest high value for a fractional day. Therefore, I altered the formula thusly:
n:=int(20*(Stdev(C,20)/Mov(Stdev(C,20),5,S)))
I was willing to accept that the program would round every decimal down. Unfortunately, I received the same error. This makes little sense to me since I can simply put n:= opt1
for as many days as I want and the formula works just fine.
Any help with this little conundrum will be greatly appreciated.
Jeff

Re: n-day breakout system
· To: metastock@xxxxxxxxxxxxx
· Subject: Re: n-day breakout system
· From: Kevin243@xxxxxxx
· Date: Sat, 26 Feb 2000 18:41:39 EST
· Reply-To: metastock@xxxxxxxxxxxxx
· Sender: owner-metastock@xxxxxxxxxxxxx
In functions like HHV, etc. Metastock language requires a constant for the length of the function. You need to look at the LASTVALUE() function for using as a constant in the HHV function. Try the following code.​

N-day Breakout
n:=20*(Stdev(C,20)/Mov(Stdev(C,20),5,S));
nhigh:=Ref(HHV(H,LastValue(n)),-1);
HIGH>nhigh AND CLOSE > Ref(CLOSE,-1)​

Hope this works for you. There are some quirks with using LASTVALUE, but I can't remember what they are. Maybe some one else on the list can help identify the quirks.
Kevin Campbell
[17496]​
Source / From:
 

Forumdan daha fazla yararlanmak için giriş yapın yada üye olun!

Forumdan daha fazla yararlanmak için giriş yapın veya kayıt olun!

Kayıt ol

Forumda bir hesap oluşturmak tamamen ücretsizdir.

Şimdi kayıt ol
Giriş yap

Eğer bir hesabınız var ise lütfen giriş yapın

Giriş yap