Bu başlıkta yeni indikatörleri paylaşabiliriz.Başlangıcı "Oynak İndikatörü" ile yapıyorum.
Oynak İndikatörü: Parametre olarak verilen bar sayısındaki, Ortalama yüzde değişimin 100 katını döndürür.
Bu indikatör piyasa hareketliliğini ölçmek için 1970'lerin sonunda J. Welles Wilder tarafından geliştirilmiş olan ATR(Average True Range) İndikatörünün muadili olarak, ATR nin olumsuz yanlarını kapatmak amacıyla yazıldı.
ATR farklı fiyatların "farkları" alınarak hesaplanıyor, "fiyat seviyesine" duyarlı olduğu için aynı kriter örneğin fiyatın 50 olduğu zaman diliminde farklı 120 olduğu dönemlerde iken ise çok daha farklı anlamlara gelir.
Aynı zamanda diğer sembollerde yine fiyat nedeniyle çok farklı değerlere dönüşür.Haliyle bir RSI da olduğu gibi 30 da al 80 sat denilemez.
Elbette kendi ortalaması ile kıyaslamak gibi yöntemler söz konusudur fakat bu istenilen sonucu almak için yetersizdir, yalnızca oynaklığın artıyormu azalıyormu olduğunu bulursunuz, oynaklığı ölçemezsiniz.
ATR'nin hesaplanışını aşağıda bulabilirsiniz:
https://www.tradingview.com/wiki/Ave...ue_Range_(ATR)
"Oynak İndikatörü" nü yazarken ATR nin aynısını puan yerine yüzde şeklinde hesaplayacaktım fakat algo trade için biraz daha farklılaştırdım. ATR orjinal hesaplamasını oran yöntemiyle hesaplamak da bir alternatif olabilirdi.
Anlık işlem yapan robot geliştiriyor olsamda Robot Sistemleri genelde bar kapanışlı tercih ediliyor.
Haliyle Bar içindeki yüksek ve düşükten ziyade kapanış fiyatı daha önemli bu tip sistemlerde.
Bundan dolayı "Oynak İndikatörü" değişimi yalnızca bar kapanışı ile önceki bar kapanışı farkı üzerinden hesaplıyor.
Bir diğer farklılık ise sayıların kullanıcı dostu olması için sonucun 100 ile çarpılmasıdır.Yani görülen değerler aslında 10.000 de X olan değişimlerdir.
Grafik görüntüsü ise ATR indikatörüne çok benzerdir.
OYNAK vs ATR
-Oynak İndikatörü önceki bar kapanışı üzerinden bar değişimini "oranlayarak" piyasa hareketliliğini ölçer. ATR ise yüksek-düşük, yüksek-kapanış, düşük-kapanış "farklarını" kullanarak piyasa hareketliliğini ölçer.
-Oynak İndikatörü bar kapanışlı intraday algoritmik sistemler için uygundur, sembole yada fiyata göre anlam kayması yaşanmaz, evrenseldir. ATR evrensel değildir, ATR ile uzun süre geçerliliğini koruyan bir algoritmik sistem geliştiremessiniz. Fiyat seviyeleri değiştikçe kriterlerin anlamı değişir.
-Farklı Sembollerin Oynak değerleri kıyaslanarak hangilerinin daha oynak olduğunu gösteren sorgu sistem yazmak mümkündür.Fakat ATR ile bunu yapamazsınız, çünkü sonuçlar standart bir metrik de değildirler.
Oynak İndikatörü iDeal için Açık Kodu:
Aşağıdaki resimde THYAO nun OYNAK ve ATR kıyaslamasını görebilirsiniz.PHP Code:
/*
Oynak İndikatörü: Parametre olarak verilen bar sayısındaki, Ortalama yüzde değişimin 100 katını döndürür.
*/
//Veriler
var C = Sistem.GrafikFiyatSec("Kapanis");
//Oynak İndikatörü---------------------------------------------------------------------------------------------------
int ParamOynakBar= 15;
var Oynak = Sistem.Liste(0);
for (int i = ParamOynakBar; i < C.Count; i++)
{
double MutlakYuzdeToplamlari=0f;
for (int j = 0; j < ParamOynakBar; j++)
{
MutlakYuzdeToplamlari += Math.Abs( ( C[i-j] / C[i-j-1] ) - 1 ) * 100 * 100;
if(j == ParamOynakBar-1) Oynak[i] = (float)(MutlakYuzdeToplamlari / ParamOynakBar);
}
}
//--------------------------------------------------------------------------------------------------------------------
Sistem.Cizgiler[0].Deger =Oynak ; //Panel 2
Sistem.Cizgiler[1].Deger =Sistem.AverageTrueRange(ParamOynakBar); //Panel 3
2017 ocakda de ATR değerleri 0.9 dan 0.1 e 9 kat düşüyorken, OYNAK değerleri hala 200 lerde seyrediyor.Oynak İndikatöründe değişim gerçekten oynaklık değişimidir.
ATR ise fiyat seviyesinden etkilendiği için kriter verilerek kullanılamayacak başarısız bir indikatördür.
Yazdıklarım her türlü eleştiriye açıktır :)
fırsat buldukça yeni indikatörler paylaşmaya devam edeceğim.
https://image.prntscr.com/image/Xvor...usXOMWNtXw.png
https://prnt.sc/lkj1mv