kullandığım şeklini paylaşamam.
forumda vardı ama;
http://www.hisse.net/forum/showthrea...12740&page=322
Printable View
kullandığım şeklini paylaşamam.
forumda vardı ama;
http://www.hisse.net/forum/showthrea...12740&page=322
2015 de paylaşılan filtreleri hatırlatalım, emeği geçenlere teşekkürler.
Math.Cos içeren her filtre candır :)
Low Pass Filter
PHP Code:
/*
* SharpDevelop tarafından düzenlendi.
* Kullanıcı: Lyrklaunavan
* Tarih: 18.3.2015
* Zaman: 18:04
* Low Pass Filter
*/
var V = Sistem.GrafikVerileri ;
var C = Sistem.GrafikFiyatOku(V, "Kapanis") ;
var H = Sistem.GrafikFiyatOku(V, "Yuksek") ;
var L = Sistem.GrafikFiyatOku(V, "Dusuk") ;
var O = Sistem.GrafikFiyatOku(V, "Acilis") ;
int order = 3; // 2 ya da 3 olmali
int FilterPeriod = 35; //kafaniza gore degistirebilirsiniz
int PreSmooth = 5; //kafaniza gore degistirebilirsiniz
double a=0;
double b=0;
double c=0;
double pi = Math.Round(Math.PI,6);
double k1=0;
double k2=0;
double k3=0;
double k4=0;
double k5=0;
double k6=0;
var Smoother = Sistem.Liste(V.Count,0);
var Filter = Sistem.Liste(V.Count,0);
var sma1 = Sistem.MA(C, "Simple", PreSmooth);
var sma2 = Sistem.MA(Smoother, "Simple", FilterPeriod);
switch (order)
{
case 1:
break;
case 2:
a = Math.Round(Math.Exp(-Math.Sqrt(2) * pi / FilterPeriod),6);
b = Math.Round(2 * a * Math.Cos(Math.Sqrt(2) * pi / FilterPeriod),6);
k1=a*a; k2=(1 - b + a * a);
break;
case 3:
a = Math.Round(Math.Exp(-pi / FilterPeriod),6);
b = Math.Round(2 * a * Math.Cos(Math.Sqrt(3) * pi / FilterPeriod),6);
c = Math.Round(Math.Exp(-2 * pi / FilterPeriod),6);
k3=(b + c); k4=Math.Round((c + b * c),6);k5=Math.Round(c * c,6);k6=Math.Round(((1 - b + c) * (1 - c)),6);
break;
}
for (int i = 3; i < V.Count; i++)
{
Smoother[i]=sma1[i];
switch (order)
{
case 1: Filter[i]=sma2[i]; break;
case 2: Filter[i]=(float)(b*Filter[i-1] - k1*Filter[i-2] + k2*Smoother[i]); break;
case 3: Filter[i]=(float)(k3*Filter[i-1] - k4*Filter[i-2] + k5*Filter[i-3]+ k6*Smoother[i]); break;
}
}
Sistem.Cizgiler[0].Deger = Filter;
Unscented Kalman Filter
PHP Code:
int Period = 16;
int Phase = 0;
var Input = Sistem.GrafikFiyatSec("Kapanis");
double _beta;
double _expFactor;
double _lengthParam;
double _windowLength = 0.5 * (Period - 1);
double _permissivity = 0.01 * Phase + 1.5;
double _sigma;
int _longAvgWindow = 65;
int _stdDevLength = 20;
var _hInterval = new List<double>(new double[Input.Count]);
var _lInterval = new List<double>(new double[Input.Count]);
var _vx = new List<double>(new double[Input.Count]);
var _avgVx = new List<double>(new double[Input.Count]);
var _vxCum = new List<double>(new double[Input.Count]);
var bank0 = new List<double>(new double[Input.Count]);
var bank1 = new List<double>(new double[Input.Count]);
var bank2 = new List<double>(new double[Input.Count]);
var bank3 = new List<double>(new double[Input.Count]);
var bank4 = new List<double>(new double[Input.Count]);
var kalman = Sistem.Liste(0);
var SMA = Sistem.MA(Input, "Simple", 1);
for (int i = 1; i < Input.Count; i++)
{
_windowLength = 0.5 * (Period - 1);
_lengthParam = Math.Log(Math.Sqrt(_windowLength)) / Math.Log(2.0) + 2;
if (_lengthParam < 0) _lengthParam = 0;
_expFactor = _lengthParam - 2;
if (_expFactor < 0.5) _expFactor = 0.5;
_sigma = Math.Sqrt(_windowLength) * _lengthParam;
_beta = _sigma / (_sigma + 1);
var price = SMA[i];
if (i == 1 || i == 0)
{
_hInterval[i] = price;
_lInterval[i] = price;
}
double uDelta = price - _hInterval[i - 1];
double lDelta = price - _lInterval[i - 1];
double uAbs = Math.Abs(uDelta);
double lAbs = Math.Abs(lDelta);
if (uAbs > lAbs) _vx[i] = uAbs;
else if (uAbs < lAbs) _vx[i] = lAbs;
else if (uAbs == lAbs) _vx[i] = 0;
_vxCum[i] = (i < 10) ? 0 : _vxCum[i] = _vxCum[i - 1] + 0.1 * (_vx[i] - _vx[i - 10]);
double matop = 0.0;
for (int j = i - _longAvgWindow + 1; j <= i; j++)
matop += _vxCum[i];
var SMA2 = matop / _longAvgWindow;
_avgVx[i] = (i <= _longAvgWindow + 1) ? _avgVx[i - 1] + 2.0 * (_vxCum[i] - _avgVx[i - 1]) / (_longAvgWindow + 1) : SMA2;
double vxCoeff = 0d;
if (_avgVx[i] > 0) vxCoeff = _vx[i] / _avgVx[i];
if (vxCoeff > Math.Pow(_lengthParam, 1.0 / _expFactor)) vxCoeff = Math.Pow(_lengthParam, 1.0 / _expFactor);
if (vxCoeff < 1) vxCoeff = 1.0;
double vExp = Math.Pow(vxCoeff, _expFactor);
double kV = Math.Pow(_beta, Math.Sqrt(vExp));
double gamma = 0.45 * (Period - 1) / (0.45 * (Period - 1) + 2);
double alpha = Math.Pow(gamma, vExp);
_hInterval[i] = (uDelta > 0) ? price : _hInterval[i] = price - kV * uDelta;
_lInterval[i] = (lDelta < 0) ? price : _lInterval[i] = price - kV * lDelta;
if (i == 2)
{
bank4[i] = price;
bank0[i] = price;
bank2[i] = price;
}
else if (i > 2)
{
bank0[i] = (1 - alpha) * price + alpha * bank0[i - 1];
bank1[i] = (price - bank0[i]) * (1 - gamma) + gamma * bank1[i - 1];
bank2[i] = bank0[i] + _permissivity * bank1[i];
bank3[i] = (bank2[i] - bank4[i - 1]) * Math.Pow((1 - alpha), 2) + Math.Pow(alpha, 2) * bank3[i - 1];
bank4[i] = bank4[i - 1] + bank3[i];
}
kalman[i] = (float)bank4[i];
}
Sistem.Cizgiler[0].Deger =kalman;//panel1
3 Pole Super Smoother
PHP Code:
/*
* SharpDevelop tarafından düzenlendi.
* Kullanıcı: Lyrklaunavan
* Tarih: 25.3.2015
* Zaman: 21:36
* 3 Pole Super Smoother
* From 'Cybernetic Analysis for Stocks and Futures' by John Ehlers
*/
var V = Sistem.GrafikVerileri ;
var C = Sistem.GrafikFiyatOku(V, "Kapanis" ) ;
var H = Sistem.GrafikFiyatOku(V, "Yuksek" ) ;
var L = Sistem.GrafikFiyatOku(V, "Dusuk" ) ;
var O = Sistem.GrafikFiyatOku(V, "Acilis" ) ;
int period = 15;
float a1 = (float)Math.Exp(-3.14159/period);
float b1 = 2*a1*(float)Math.Cos(1.738*3.14159 /period);
float c1=a1*a1;
float coef2=b1+c1;
float coef3=-(c1+b1*c1);
float coef4=c1*c1;
float coef1=1-coef2-coef3-coef4;
var SS3Pole=Sistem.Liste(V.Count,0);
for(int j=4; j<V.Count; j++){
SS3Pole[j] = coef1*C[j]+coef2*SS3Pole[j-1]+coef3*SS3Pole[j-2]+coef4*SS3Pole[j-3];
}
Sistem.Cizgiler[0].Deger = SS3Pole;
2 Pole Super Smoother
3 Pole Butterworth filterPHP Code:
/*
* SharpDevelop tarafından düzenlendi.
* Kullanıcı: Lyrklaunavan
* Tarih: 25.3.2015
* Zaman: 21:36
* 2 Pole Super Smoother
* From 'Cybernetic Analysis for Stocks and Futures' by John Ehlers
*/
var V = Sistem.GrafikVerileri ;
var C = Sistem.GrafikFiyatOku(V, "Kapanis" ) ;
var H = Sistem.GrafikFiyatOku(V, "Yuksek" ) ;
var L = Sistem.GrafikFiyatOku(V, "Dusuk" ) ;
var O = Sistem.GrafikFiyatOku(V, "Acilis" ) ;
int period = 15;
float a1 = (float)Math.Exp(-1.414*3.14159/period);
float b1 = 2*a1*(float)Math.Cos(1.414*3.14159 /period);
float coef2=b1;
float coef3=-a1*a1;
float coef1=1-coef2-coef3;
var SS2Pole=Sistem.Liste(V.Count,0);
for(int j=3; j<V.Count; j++){
SS2Pole[j] = coef1*C[j]+coef2*SS2Pole[j-1]+coef3*SS2Pole[j-2];
}
Sistem.Cizgiler[0].Deger = SS2Pole;
2 Pole Butterworth FilterPHP Code:
/*
* SharpDevelop tarafından düzenlendi.
* Kullanıcı: Lyrklaunavan
* Tarih: 25.3.2015
* Zaman: 21:36
* 3 Pole Butterworth Filter
* From 'Cybernetic Analysis for Stocks and Futures' by John Ehlers
*/
var V = Sistem.GrafikVerileri ;
var C = Sistem.GrafikFiyatOku(V, "Kapanis" ) ;
var H = Sistem.GrafikFiyatOku(V, "Yuksek" ) ;
var L = Sistem.GrafikFiyatOku(V, "Dusuk" ) ;
var O = Sistem.GrafikFiyatOku(V, "Acilis" ) ;
int period = 15;
float a1 = (float)Math.Exp(-3.14159/period);
float b1 = 2*a1*(float)Math.Cos(1.738*3.14159 /period);
float c1=a1*a1;
float coef2=b1+c1;
float coef3=-(c1+b1*c1);
float coef4=c1*c1;
float coef1=(1-b1+c1)*(1-c1)/8;
var Butter3Pole=Sistem.Liste(V.Count,0);
for(int j=4; j<V.Count; j++){
Butter3Pole[j] = coef1*(C[j]+3*C[j-1]+3*C[j-2]+C[j-3])+coef2*Butter3Pole[j-1]+coef3*Butter3Pole[j-2]+coef4*Butter3Pole[j-3];
}
Sistem.Cizgiler[0].Deger = Butter3Pole;
PHP Code:
/*
* SharpDevelop tarafından düzenlendi.
* Kullanıcı: Lyrklaunavan
* Tarih: 25.3.2015
* Zaman: 21:36
* 2 Pole Butterworth Filter
* From 'Cybernetic Analysis for Stocks and Futures' by John Ehlers
*/
var V = Sistem.GrafikVerileri ;
var C = Sistem.GrafikFiyatOku(V, "Kapanis" ) ;
var H = Sistem.GrafikFiyatOku(V, "Yuksek" ) ;
var L = Sistem.GrafikFiyatOku(V, "Dusuk" ) ;
var O = Sistem.GrafikFiyatOku(V, "Acilis" ) ;
int period = 15;
float a1 = (float)Math.Exp(-1.414 * 3.14159 / period);
float b1 = 2 * a1 * (float)Math.Cos(1.414 * 3.14159 / period);
float coef2 = b1;
float coef3 = -a1 * a1;
float coef1 = (1 - b1 + a1 * a1) / 4;
var Butter=Sistem.Liste(V.Count,0);
for(int j=3; j<V.Count; j++){
Butter[j]=coef1 * (C[j] + 2 * C[j-1] + C[j-2]) + coef2 * Butter[j-1] + coef3 * Butter[j-2];
}
Sistem.Cizgiler[0].Deger = Butter;
2 hafta önce eğitimi oldu bunların..
http://bettersystemtrader.com/john-ehlers-workshop-2018
talep olursa aynı konuları ideal kodlu örneklerle 12 saatlik bir eğitimde min. 10 kişilik(sadece tecrübeli olanlar katılabilir) gruba aynı fiyatla anlatabilirim. 12 saat için 360k kurtarır:)
JOHN EHLERS 2018 WORKSHOP SYLLABUS
NEW THIS YEAR:
Zero Lag Filters
Predictive Filters
Chebyshev Filters
Rocket RSI
Recursive Median
Deviation Scaling
Deviation Scaled Adaptive Moving Average
How to Evaluate Strategy Robustness
How to Optimize a Strategy for Out-of-Sample performance
Maximally Robust Intraday Strategy
Correct Position Sizing
DATA
What are cycles?
Wave Power – decibels
Fractals
Pink Noise
Swerling Noise
Spectral Dilation
Sampled data theory
Aliasing
Chart patterns
Fibonacci series
Number theory
Complex Variables
Trigonometry Review
FILTER THEORY
Transfer response
Z Transforms
FILTERS AND INDICATORS*
Finite Impulse Response Filters (FIR)
SMA
Binomial
Critical Period
Computational Lag
Infinite Impulse Response Filters (IIR)
EMA
Critical Period
High Pass Filters
SuperSmoother
Roofing Filter
Automatic Gain Control (AGC)
Deviation Scaling
BandPass Filter
Decyclers
Filt11 Techniques
MESA Predict
Correlation
Super PassBand Filter
Swiss Army Knife
Chebyshev Filter
Error Correcting Codes
Reverse EMA
MyStochastic
Rocket RSI
Transforms
Fisher and Inverse Fisher
Hilbert
Peaking Filters
CYCLE MEASURING TECHNIQUES*
MESA (disclosed only at workshops)
DFT
Autocorrelation Periodogram
Bandpass Filter Bank
Signal to Noise Ratio
Dual Differentiator
Homodyne Discriminator
Phase Accumulation
Pisarenko Harmonic Decomposition
Goertzel
SWAMICHARTS INDICATORS*
TRADING STRATEGY CONCEPTS
Key parameters
Excel Coin Toss Test
Parameter Optimization
How to evaluate Robustness
Monte Carlo Simulation
UPUBLISHED ROBUST TRADING STRATEGIES (daily bars)*
MESA Phasor
Complex Angle
Correlation Angle
Correlation
Enigma
MyRSI
PassBand
Ultimate Angle
UNPUBLISHED ROBUST INTRADAY TRADING STRATEGIES*
MESA Intraday V3
15min Bandpass
15min Chebyshev
15min Correlation Angle
15min Double Octave
15min Octave
15min Passband
15min SuperSmoother Difference
*Indicator and Strategy Easy Language Code will be provided in electronic format
Merhaba Sezai bey,
1. sorum çok güzel çalıştı volume işin içine alındığında hatalı sinyal azaltmak için kullandığımda işe yarayacak gibi duruyor. 5 dk'lık 1000 barda vol'süz %16,62 getiri bu vol ile %18,24'e çıktı.
2. soruma yazdığınız yukarıdaki hiç sinyal üretmedi. galiba ben tam anlatamadım sorumu. Tam anlayamıyorum kodlardan ama tam demek istediğim
if (Mov1[i] > Mov2[i] && MovVol[i] > VolGun[i] && SonYon != "A") galiba sizin yazdığınız "VolGun[i]" günlük hacim toplamı olduğundan sinyal üretemedi
if (Mov1[i] > Mov2[i] && son5barın ortalama hacim[i] > [I]OrtalamaHAcim && SonYon != "A")
VolGun[i-1] deneyelim...
Merhaba Sezai bey,
1. sorum çok güzel çalıştı volume işin içine alındığında hatalı sinyal azaltmak için kullandığımda işe yarayacak gibi duruyor. 5 dk'lık 1000 barda vol'süz %16,62 getiri bu vol ile %18,24'e çıktı.
2. soruma yazdığınız yukarıdaki hiç sinyal üretmedi. galiba ben tam anlatamadım sorumu. Tam anlayamıyorum kodlardan ama tam demek istediğim
if (Mov1[i] > Mov2[i] && MovVol[i] > VolGun[i] && SonYon != "A") galiba sizin yazdığınız "VolGun[i]" günlük hacim toplamı mı anlayamadım. sinyal üretmedi maalesef
if (Mov1[i] > Mov2[i] && son5barın ortalama hacim[i] > [I]OrtalamaHacim && SonYon != "A") tam olarak yapmak istediğim.
Bu arada yardımınız için teşekkür ederim.
Bu sinyallere İdeal Sistem kütüphanesinden bakarak mail gönder özelliği ekledim. ama sinyal geldiğinde 5 dk boyunca sinyalle ilgili 35-40 adet mail atıyor. bunu tek maile nasıl düşürebilirim?
yazdığım koşulu ;
// alış
if (Sistem.YukariKestiyse(MA1, MA2)) // Al sinyali mail
{
var Periyot = "5" ;
var Veri = Sistem.GrafikVerileriniOku(Sembol, Periyot);
var SonBarNo = Veri.Count-1;
//Mailin içine yazılacak mesaja bu verileri ekle
var Mesaj = Veri[SonBarNo].Date.ToString("HH:mm:ss")
+ "\r\n" +" Open="+Veri[SonBarNo].Open.ToString()
+ "\r\n" +" High="+Veri[SonBarNo].High.ToString()
+ "\r\n" +" Low="+Veri[SonBarNo].Low.ToString()
+ "\r\n" +" Close="+Veri[SonBarNo].Close.ToString();
// Mail Gönder
Sistem.GoruntuKaydet("C:\\Ekranım.png");
var MailServer = "smtp.gmail.com";
Sistem.MailServerAdres = MailServer;
Sistem.MailServerPort = 587;
Sistem.MailKonu = "Al Sinyali";
Sistem.MailMetin = Mesaj;
Sistem.MailGonderenAdres = "*******@gmail.com";
Sistem.MailGonderenSifre = "*******";
Sistem.MailDosyaEkle("C:\\Ekranım.png");
Sistem.MailAliciEkle("*******@gmail.com");
Sistem.MailGonder();
}