Alım-satım fırsatlarını kaçırıyorsunuz:
- Ücretsiz alım-satım uygulamaları
- İşlem kopyalama için 8.000'den fazla sinyal
- Finansal piyasaları keşfetmek için ekonomik haberler
Kayıt
Giriş yap
Gizlilik ve Veri Koruma Politikasını ve MQL5.com Kullanım Şartlarını kabul edersiniz
Hesabınız yoksa, lütfen kaydolun
Bu doğru, sayılır. Hücre numarası bulunur. Bu hücreden (zaman serisi) çubuğun maksimum veya minimum değeri alınır. Örneğin, bu çubukta bir maksimum bulunduğuna inanılmaktadır. Bu değer daha sonra bulunan sayı ile gösterge arabelleğine yerleştirilir. Göstergenin maksimumu, çubuktaki maksimuma karşılık gelmelidir. Ve kodumda, aynı bulunan sayı ile diziden (zaman serisi) maksimum alınır ve val değeriyle karşılaştırılır. Bu sayı ile tampona val sayısını koyarak doğru olanı yapıp yapmadığımız kontrol edilir. Ayrıca çubuğun maksimum değerine eşit olmalıdır. Aynı yerden alınan sayıları karşılaştırmak oldukça doğru.
Bana öyle geliyor ki ...==val karşılaştırması tehlikeli çünkü keneden tike değişebilen hücre numarası. Özellikle çok sayıda yakın eşleşen Düşük ve Yüksek'in olduğu küçük zaman dilimlerinde . Ancak düşünmemiz gerekiyor, belki aklımızda farklı noktalar var.
//+------------------------------------------------------------------+ //| CZigZag.mq4 | //| Copyright © 2006, Candid | //| likh@yandex.ru | //+------------------------------------------------------------------+ #property copyright "Copyright © 2006, Candid" #property link "likh@yandex.ru" #property indicator_chart_window #property indicator_buffers 1 #property indicator_color1 Blue //---- indicator parameters extern int ExtDepth=12; extern int ExtDeviation=5; //extern int ExtBackstep=3; int shift; double res; int i; int fBar; double CurMax,CurMin; int CurMaxPos,CurMinPos; int CurMaxBar,CurMinBar; double hPoint; double mhPoint; double EDev; int MaxDist,MinDist; bool FirstRun; bool AfterMax,AfterMin; //---- indicator buffers double ZigZag[]; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- indicators SetIndexStyle(0,DRAW_SECTION); //---- indicator buffers mapping SetIndexBuffer(0,ZigZag); SetIndexEmptyValue(0,0.0); //---- indicator short name IndicatorShortName("CZigZag("+ExtDepth+","+ExtDeviation+")"); FirstRun = true; //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { int counted_bars=IndicatorCounted(); if (FirstRun) { hPoint = 0.5*Point; mhPoint = -hPoint; // EDev = ExtDeviation*Point; EDev = (ExtDeviation+0.5)*Point; AfterMax = true; AfterMin = true; fBar = Bars-1; CurMax = High[fBar]; CurMaxBar = 1; CurMin = Low[fBar]; CurMinBar = 1; MaxDist = 0; MinDist = 0; FirstRun = false; } //---- fBar = Bars-counted_bars-1; if (fBar > Bars-2) fBar = Bars-2; for(shift=fBar; shift>=0; shift--) { if (AfterMax) { // res = Low[shift]-CurMin-hPoint; res = Low[shift]-CurMin; // if (res < 0) { if (res < mhPoint) { ZigZag[Bars-CurMinBar] = 0; CurMin = Low[shift]; CurMinBar = Bars-shift; ZigZag[Bars-CurMinBar] = CurMin; } else { // if (res < 0) // if (res > 0 ) { if (res > hPoint ) { MaxDist = Bars-CurMaxBar-shift+1; MinDist = Bars-CurMinBar-shift+1; if ((MaxDist>ExtDepth && MinDist>ExtDepth) || res > EDev) { AfterMax = false; AfterMin = true; CurMaxBar = CurMinBar+1; CurMaxPos = Bars-CurMaxBar; CurMax = High[CurMaxPos]; for (i=CurMaxPos-1;i>=shift;i--) { if (High[i] > CurMax+hPoint) { CurMaxBar = Bars-i; CurMax = High[i]; } } // for (i=CurMaxPos-1;i>=shift;i--) ZigZag[Bars-CurMaxBar] = CurMax; } // if ((MaxDist>ExtDepth && MinDist>ExtDepth) || res > EDev) } // if (res > 0 ) } // else if (res < 0) } // if (AfterMax) if (AfterMin) { // res = CurMax-High[shift]-hPoint; res = CurMax-High[shift]; // if (res < 0) { if (res < mhPoint) { ZigZag[Bars-CurMaxBar] = 0; CurMax = High[shift]; CurMaxBar = Bars-shift; ZigZag[Bars-CurMaxBar] = CurMax; } else { // if (res < 0) // if (res > 0 ) { if (res > hPoint ) { MaxDist = Bars-CurMaxBar-shift+1; MinDist = Bars-CurMinBar-shift+1; if ((MaxDist>ExtDepth && MinDist>ExtDepth) || res > EDev) { AfterMin = false; AfterMax = true; CurMinBar = CurMaxBar+1; CurMinPos = Bars-CurMinBar; CurMin = Low[CurMinPos]; for (i=CurMinPos-1;i>=shift;i--) { if (Low[i] < CurMin-hPoint) { CurMinBar = Bars-i; CurMin = Low[i]; } } // for (i=CurMinPos-1;i>=shift;i--) ZigZag[Bars-CurMinBar] = CurMin; } // if ((MaxDist>ExtDepth && MinDist>ExtDepth) || res > EDev) } // if (res > 0 ) } // else if (res < 0) } // if (AfterMin) } // for(shift=fBar; shift>=0; shift--) //---- return(0); } //+------------------------------------------------------------------+Lütfen parametrelerin adlarının kaydedilmesine rağmen farklı çalıştıklarını unutmayın.
//+------------------------------------------------------------------+ //| DT_ZZ.mq4 | //+------------------------------------------------------------------+ #property copyright "Copyright © 2006, klot." #property link "klot@mail.ru" #property indicator_chart_window #property indicator_buffers 3 #property indicator_color1 Aqua #property indicator_color2 Blue #property indicator_color3 Red //---- indicator parameters extern int ExtDepth=12; //---- indicator buffers double zzL[]; double zzH[]; double zz[]; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { // IndicatorBuffers(3); //---- drawing settings SetIndexStyle(2,DRAW_ARROW); SetIndexStyle(1,DRAW_ARROW); SetIndexStyle(0,DRAW_SECTION); SetIndexArrow(2,159); SetIndexArrow(1,159); //---- indicator buffers mapping SetIndexBuffer(0,zz); SetIndexBuffer(1,zzH); SetIndexBuffer(2,zzL); SetIndexEmptyValue(0,0.0); SetIndexEmptyValue(1,0.0); SetIndexEmptyValue(2,0.0); //---- indicator short name IndicatorShortName("DT_ZZ("+ExtDepth+")"); //---- initialization done return(0); } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ int start() { int i,shift,pos,lasthighpos,lastlowpos,curhighpos,curlowpos; double curlow,curhigh,lasthigh,lastlow; double min, max; ArrayInitialize(zz,0.0); ArrayInitialize(zzL,0.0); ArrayInitialize(zzH,0.0); lasthighpos=Bars; lastlowpos=Bars; lastlow=Low[Bars];lasthigh=High[Bars]; for(shift=Bars-ExtDepth; shift>=0; shift--) { curlowpos=Lowest(NULL,0,MODE_LOW,ExtDepth,shift); curlow=Low[curlowpos]; curhighpos=Highest(NULL,0,MODE_HIGH,ExtDepth,shift); curhigh=High[curhighpos]; //------------------------------------------------ if( curlow>=lastlow ) { lastlow=curlow; } else { //идем вниз if( lasthighpos>curlowpos ) { zzL[curlowpos]=curlow; ///* min=100000; pos=lasthighpos; for(i=lasthighpos; i>=curlowpos; i--) { if (zzL[i]==0.0) continue; if (zzL[i]<min) { min=zzL[i]; pos=i; } zz[i]=0.0; } zz[pos]=min; //*/ } lastlowpos=curlowpos; lastlow=curlow; } //--- high if( curhigh<=lasthigh ) { lasthigh=curhigh;} else { // идем вверх if( lastlowpos>curhighpos ) { zzH[curhighpos]=curhigh; ///* max=-100000; pos=lastlowpos; for(i=lastlowpos; i>=curhighpos; i--) { if (zzH[i]==0.0) continue; if (zzH[i]>max) { max=zzH[i]; pos=i; } zz[i]=0.0; } zz[pos]=max; //*/ } lasthighpos=curhighpos; lasthigh=curhigh; } //---------------------------------------------------------------------- } return(0); } //+------------------------------------------------------------------+Lütfen parametrelerin adlarının kaydedilmesine rağmen farklı çalıştıklarını unutmayın.
kandida . Kesinlikle bir göz atacağım. İlk kurulumda, aşağıdaki açıklama hemen ortaya çıktı.
Aynı yüksekliğe sahip arka arkaya birkaç çubuk var. ZigZag sürümünüz son çubukta bir ara (üstte) çizer. Yani sıfıra yakın. İyi bir kayda göre, kırılma ilk çubuğa - sıfırdan en uzak olana - çizilecek şekilde yapılmalıdır. Görünen ilk köşe önemlidir. Ayrıca mtnimums ile. Sadece bunu yapmanın gerekli olduğu birkaç kaynaktan (literatürden) alıntı yapabilirim.
Evet fark ettim :) sadece bir fikir kaldı :) . Şimdi 3Z'mi her yerde kullanıyorum (yukarıdaki yazıdaki kod) Diğer TF'lerin verileriyle daha kararlı çalışıyor.
İlk kurulumda, aşağıdaki açıklama hemen ortaya çıktı.
Aynı yüksekliğe sahip arka arkaya birkaç çubuk var. ZigZag sürümünüz son çubukta bir ara (üstte) çizer.
Klot , ilginç bir seçenek.
Zigzag çeşitleriniz ilginç sonuçlar gösteriyorsa, geliştirmenizde kullanılabilirler mi?