Metastock indikatörler

Collapse
X
 
  • Saat
  • Show
Clear All
new posts
  • teo
    Demirbaş
    • 03 Mart 2009
    • 3712

    #31
    SVAPO PRICE ONLY INDICATOR for MetaStock

    {calculate heikin ashi closing average haCl and get the input variables}
    haO:=(Ref((O+H+L+C)/4,-1) + PREV)/2;
    haCl:=((O+H+L+C)/4+haO+Max((O+H+L+C)/4,Max(H,haO))+Min((O+H+L+C)/4,Min(L,haO)))/4;
    {input SVAPO period}
    period:= Input("SVAPO period :", 2, 20, 8);
    {input minimum per thousand price change}
    cutoff:= Input("Minimum %o price change :",0.0,10,1);
    {Inputs for standard deviation bands}
    devH:= Input("Standard Deviation High :", 0.1, 5, 1.5);
    devL:= Input("Standard Deviation Low :", 0.1, 5, 1.3);
    stdevper:= Input("Standard Deviation Period :", 1, 200, 100);
    {Smooth HaCl closing price}
    haC:=Tema(haCl,period/1.6);
    {MA divisor}
    vave:=Ref(Mov(C,period*5,S),-1);
    {Basic trend}
    vtr:=Tema(LinRegSlope(C,period),period);
    {SVAPO result of price only}
    SVAPO:=Tema(Sum(If(haC>(Ref(haC,-1)*(1+cutoff/1000)) AND
    Alert(vtr>=Ref(vtr,-1),2), C, If(haC<(Ref(haC,-1)*(1-cutoff/1000)) AND
    Alert(vtr>Ref(vtr,-1),2),-C,0)),period)/(vave+1),period);
    devH*Stdev(SVAPO,stdevper);
    -devL*Stdev(SVAPO,stdevper);
    zeroref:=0;
    zeroref;
    SVAPO

    Yorum

    • teo
      Demirbaş
      • 03 Mart 2009
      • 3712

      #32
      SVAPO (SHORT-TERM VOLUME AND PRICE OSCILLATOR)
      MetaStock code for up & down trigger

      Please note that all arrows on all the charts in the November 2007 article on
      SVAPO are put on manually just to show the exact coincidence between price and
      SVAPO turning points. SVAPO is not meant to be used as a mechanical trading
      system. Please read how I apply the SVAPO in the December 2007 issue of S&C
      ("Short-Term Trading With SVAPO").

      Of course you could create an expert and an explorer function in MetaStock to
      give you a signal when SVAPO is turning up or down from below or from above the
      standard deviation line. But please only use it as a trigger to have a look at
      the chart. Do not use it for any automatic buying or selling!


      Here is an expert function for such a trigger:

      Up trigger:

      haO:=(Ref((O+H+L+C)/4,-1) + PREV)/2;
      haCl:=((O+H+L+C)/4+haO+Max((O+H+L+C)/4,Max(H,haO))+Min((O+H+L+C)/4,Min(L,haO)))/4;
      period:= 8;
      cutoff:= 1;
      devH:= 1.5;
      devL:= 1.3;
      stdevper:= 100;
      haC:=Tema(haCl,period/1.6);
      vave:=Ref(Mov(V,period*5,S),-1);
      vmax:=vave*2;
      vc:=If(V < vmax,V,vmax);
      vtr:=Tema(LinRegSlope(V,period),period);
      SVAPO:=Tema(Sum(If(haC>(Ref(haC,-1)*(1+cutoff/1000))
      AND Alert(vtr>=Ref(vtr,-1),2), vc, If(haC<(Ref(haC,-1)*(1-cutoff/1000))
      AND Alert(vtr>Ref(vtr,-1),2),-vc,0)),period)/(vave+1),period);
      highdev:=devH*Stdev(SVAPO,stdevper);
      lowdev:=-devL*Stdev(SVAPO,stdevper);
      Alert(SVAPO < lowdev,2) AND Cross(SVAPO,Ref(SVAPO,-1))

      Down trigger:

      haO:=(Ref((O+H+L+C)/4,-1) + PREV)/2;
      haCl:=((O+H+L+C)/4+haO+Max((O+H+L+C)/4,Max(H,haO))+Min((O+H+L+C)/4,Min(L,haO)))/4;
      period:= 8;
      cutoff:= 1;
      devH:= 1.5;
      devL:= 1.3;
      stdevper:= 100;
      haC:=Tema(haCl,period/1.6);
      vave:=Ref(Mov(V,period*5,S),-1);
      vmax:=vave*2;
      vc:=If(V < vmax,V,vmax);
      vtr:=Tema(LinRegSlope(V,period),period);
      SVAPO:=Tema(Sum(If(haC>(Ref(haC,-1)*(1+cutoff/1000))
      AND Alert(vtr>=Ref(vtr,-1),2), vc, If(haC<(Ref(haC,-1)*(1-cutoff/1000))
      AND Alert(vtr>Ref(vtr,-1),2),-vc,0)),period)/(vave+1),period);
      highdev:=devH*Stdev(SVAPO,stdevper);
      lowdev:=-devL*Stdev(SVAPO,stdevper);
      Alert(SVAPO>highdev,2) AND Cross(Ref(SVAPO,-1),SVAPO)

      Yorum

      • teo
        Demirbaş
        • 03 Mart 2009
        • 3712

        #33
        Code for MetaStock: Bear range trailing stop

        Dy:=Input("Day of Trend",1,31,19);
        Mn:=Input("Month of Trend",1,12,12);
        Yr:=Input("Year of Trend",2000,2500,2003);

        Value1:=Input("Bearish Periods",3,55,21);
        Value2:=Input("Multiplication Factor",1,10,3.2);
        Value3:=Input("Initial Stop",0,100000,10);

        Value4:= 34;{Channel Periods}
        Value5:= 75;{OverBought Region}

        HoldingDays:= BarsSince(Dy=DayOfMonth()
        AND Mn=Month() AND Yr=Year());

        Index:=RSI(CLOSE,Value4);
        OB:=Index -Value5;
        Bullish:= CLOSE-(CLOSE*(OB/100));

        Bearish:=(Sum(Abs(LOW-Ref(LOW,-1)),Value1))/Value1;
        RangeA:=(Sum(CLOSE-LOW,Value1))/Value1;
        Stop:=CLOSE-((Bearish+RangeA)*Value2);

        If(Stop>PREV AND Stop>Value3,Stop,If(Stop>PREV
        AND Stop < Value3,Value3,If(Stop<=PREV,PREV,Stop
        *Holdingdays)));

        Bullish

        Yorum

        • teo
          Demirbaş
          • 03 Mart 2009
          • 3712

          #34
          Bunlar dergılerı satmak ıcın her gun bır sey uydurmuslar,

          perıyodları degıstırıp degıstıp sunuyorlar,

          hheheehe

          Allah yardımcınız olsun, her gun deneyın bır tane, ama DEMO hesapta,


          bır de bunları denerken çarpılmayalım...

          Yorum

          • PAŞA
            Demirbaş
            • 22 Mayıs 2009
            • 100

            #35
            teo Nickli Üyeden Alıntı Mesajı göster
            ATR-based trailing stop value on the closing price.


            {Get the required ATR period;}
            period:=Input("ATR Period :",1,100,5);
            {Calculate the biggest difference based on the true range concept;}
            diff1:=Max(H-L,Abs(H-Ref(C,-1)));
            diff2:=Max(diff1,Abs(L-Ref(C,-1)));
            {Use Wilders' moving average method to calculate the Average True Range;}
            Mov(diff2,period*2-1,E)


            Sidebar code from page 35 of the June 2009 issue:

            ATR TRAILING STOP
            {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


            Code from page 36 of the June 2009 issue:

            Long position: SVE_StopLong_Trail_ATR_Date.

            {SVE_StopLong_Trail_ATR_Date - ATR trailing stop long from date}
            InpMonth:=Input("Month",1,12,1);
            InpDay:=Input("Day",1,31,1);
            InpYear:=Input("Year",1800,2050,2009);
            InitStop:=Input("Initial Stop Price",0.1,10000,10);
            atrper:=Input("ATR period :",1,100,5);
            atrfact:=Input("ATR multiplication :",1,10,3.5);
            loss:=atrfact*ATR(atrper);
            Entry:= InpYear=Year() AND InpMonth=Month() AND InpDay=DayOfMonth();
            StopLong:=ExtFml( "AdvancedStop.StopLong", Entry,InitStop,0,C-Loss,0,0,0,0);
            StopLong

            Short position: SVE_StopShort_Trail_ATR_Date.

            {SVE_StopShort_Trail_ATR_Date - ATR trailing stop short from date}
            InpMonth:=Input("Month",1,12,1);
            InpDay:=Input("Day",1,31,1);
            InpYear:=Input("Year",1800,2050,2009);
            InitStop:=Input("Initial Stop Price",0.1,10000,10);
            atrper:=Input("ATR period :",1,100,5);
            atrfact:=Input("ATR multiplication :",1,10,3.5);
            loss:=atrfact*ATR(atrper);
            Entry:= InpYear=Year() AND InpMonth=Month() AND InpDay=DayOfMonth();
            StopShort:=ExtFml("AdvancedStop.StopShort",Entry,
            InitStop,0,C+Loss,0,0,0,0);
            StopShort


            Sidebar code from page 38 of the June 2009 issue:

            ATR MODIFIED
            {SVE_ATR_Mod}
            period:=Input("ATR Period :",1,100,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);
            Wilders(diff2,period);


            Sidebar code from page 39 of the June 2009 issue:

            MODIFIED ATR WITH TRAILING STOPS
            {SVE_Stop_Trail_ATR_Mod}
            period:=Input("ATR period :",1,100,5);
            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


            Sidebar code from page 40 of the June 2009 issue:

            Modified ATR trailing stop from start date
            Since you are using your own trading method to finding entry points, you certainly want
            to be able to use your own entry date. So again, since the number of input parameters in
            MetaStock is limited to six, we have to create separate formulas for a long or a short
            position:

            Long position: SVE_StopLongMod_Trail_ATR_Date.

            {SVE_StopLongMod_Trail_ATR_Date}
            InpMonth:=Input("Month",1,12,1);
            InpDay:=Input("Day",1,31,1);
            InpYear:=Input("Year",1800,2050,2009);
            InitStop:=Input("Initial Stop Price",0.1,10000,10);
            period:=Input("ATR period :",1,100,5);
            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;
            Entry:= InpYear=Year() AND InpMonth=Month() AND InpDay=DayOfMonth();
            StopLong:=ExtFml( "AdvancedStop.StopLong", Entry,InitStop,0,C-Loss,0,0,0,0);
            StopLong

            Short position: SVE_StopShortMod_Trail_ATR_Date.

            {SVE_StopShortMod_Trail_ATR_Date}
            InpMonth:=Input("Month",1,12,1);
            InpDay:=Input("Day",1,31,1);
            InpYear:=Input("Year",1800,2050,2009);
            InitStop:=Input("Initial Stop Price",0.1,10000,10);
            period:=Input("ATR period :",1,100,5);
            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;
            Entry:= InpYear=Year() AND InpMonth=Month() AND InpDay=DayOfMonth();
            StopShort:=ExtFml("AdvancedStop.StopShort",
            Entry,InitStop,0,C+Loss,0,0,0,0);
            StopShort


            Üstad kırmızı yaptığım yerler hata veriyor...
            BİR SOĞAN SOYULUYOR, YAŞARIYOR GÖZLER, BİR DEVLET SOYULUYOR, ALDIRMIYOR ÖKÜZLER....

            Yorum

            • salihkara
              Yeni üye
              • 04 Ekim 2009
              • 1

              #36
              Aşağıdaki makalede belirtilen sistemin c ve c,l,h la ilişkilendirilen filtresinden dah afarklı bir filtre ile bu sistem iyileşirmi? Yoksa asıl formülemi koşul eklemek gerekir. Kimse kimseye bedava sistem vermediği için iş başa düştü..Tabi paylaşabilecek daha iyi sistemi olan varsa onuda alabilirim -------------------------------------------------------------------- ÇALIŞMA S1 Sistemlerin en ilkel hali ile başlayalım. RSI indikatörünün belirli bir periyottaki davranışının, daha yüksek bir periyottaki davranışı ile ilişkisini yaklaşımımıza temel alalım. Kısa periyottaki indikatör hareketinin, uzun periyottakinden daha önce fiyatı takip edeceğinden hareketle(Bu her indikatörde geçerli bir varsayım değildir!), kısa periyottaki RSI değerinin uzun periyottaki RSI değerini yukarı kesmesini boğa piyasasının başladığına, tersini de ayı piyasasının başladığına yoralım. Bu varsayımımızın Matriks dilindeki karşılığı; AL/AÇIK POZ.KAPA: Cross(RSI(Opt1),RSI(Opt2)) SAT/AÇIĞA SAT: Cross(RSI(Opt2),RSI(Opt1)) (1) şeklindedir. Küçük zaman dilimlerinde görece dalgalı hareketlerden dolayı toplam sinyal sayısının da, hatalı sinyal sayısının da azaltılması gerekir. Bunun için RSI'yı daha durağan bir hale çevirmek gerekir. Bunun için bilinen en basit yöntemler değişkenin basit hareketli ortalamasının alınması veya DEMA ile kullanılmasıdır. Formül şu hale gelir. AL/AÇIK POZ.KAPA: cross(dema(rsi(opt1),opt3),dema(rsi(opt2),opt4)) SAT/AÇIĞA SAT : cross(dema(rsi(opt2),opt4),dema(rsi(opt1),opt3)) (2) Sinyal sayısının azaldığı getirinin ise arttığı görülecektir. (DEMA'nın basit hareketli ortalama ile karşılaştırmasını en alttaki grafikte görebilirsiniz). Bu sinyal üretecimiz olsun. Bir sonraki aşamada doğrudan fiyatın kendisinden türetilmiş bir filtre eklemeyi düşünelim. AL/APK formülüne "and c>(c+l+h)/3" and SAT/AS formülüne "and c

              Yorum

              • teo
                Demirbaş
                • 03 Mart 2009
                • 3712

                #37
                salihkara Nickli Üyeden Alıntı Mesajı göster
                Aşağıdaki makalede belirtilen sistemin c ve c,l,h la ilişkilendirilen filtresinden dah afarklı bir filtre ile bu sistem iyileşirmi? Yoksa asıl formülemi koşul eklemek gerekir. Kimse kimseye bedava sistem vermediği için iş başa düştü..Tabi paylaşabilecek daha iyi sistemi olan varsa onuda alabilirim -------------------------------------------------------------------- ÇALIŞMA S1 Sistemlerin en ilkel hali ile başlayalım. RSI indikatörünün belirli bir periyottaki davranışının, daha yüksek bir periyottaki davranışı ile ilişkisini yaklaşımımıza temel alalım. Kısa periyottaki indikatör hareketinin, uzun periyottakinden daha önce fiyatı takip edeceğinden hareketle(Bu her indikatörde geçerli bir varsayım değildir!), kısa periyottaki RSI değerinin uzun periyottaki RSI değerini yukarı kesmesini boğa piyasasının başladığına, tersini de ayı piyasasının başladığına yoralım. Bu varsayımımızın Matriks dilindeki karşılığı; AL/AÇIK POZ.KAPA: Cross(RSI(Opt1),RSI(Opt2)) SAT/AÇIĞA SAT: Cross(RSI(Opt2),RSI(Opt1)) (1) şeklindedir. Küçük zaman dilimlerinde görece dalgalı hareketlerden dolayı toplam sinyal sayısının da, hatalı sinyal sayısının da azaltılması gerekir. Bunun için RSI'yı daha durağan bir hale çevirmek gerekir. Bunun için bilinen en basit yöntemler değişkenin basit hareketli ortalamasının alınması veya DEMA ile kullanılmasıdır. Formül şu hale gelir. AL/AÇIK POZ.KAPA: cross(dema(rsi(opt1),opt3),dema(rsi(opt2),opt4)) SAT/AÇIĞA SAT : cross(dema(rsi(opt2),opt4),dema(rsi(opt1),opt3)) (2) Sinyal sayısının azaldığı getirinin ise arttığı görülecektir. (DEMA'nın basit hareketli ortalama ile karşılaştırmasını en alttaki grafikte görebilirsiniz). Bu sinyal üretecimiz olsun. Bir sonraki aşamada doğrudan fiyatın kendisinden türetilmiş bir filtre eklemeyi düşünelim. AL/APK formülüne "and c>(c+l+h)/3" and SAT/AS formülüne "and c

                rsı kısa nın rsı uzunu kesmesı, veya ccı kısa nın ccı uzunu kesmesı,

                cok ıyı sonuc vermez, bunları bende yıllar once denedım,

                bır sınyalın azaltılması yanı avarajının tekrar alınması veya deme tema, veya herhangı bır yontemle agırlastırılmasının da mantıgı bana gore yoktur..


                Eger sızın pusulanız rsı kesısmesı ıse bunu azaltarak belkı de gercekten dogru olacak bır sınyalı de elımıne etmenız anlamına gelır.

                Netıcede bır sey dogru veya yanlıs dır..

                Az dogru az yanlıs ama az yanlısı fıltre edersek cok dogru olur mantıgı pek yurumez kanaıtındeyım...


                Sız bu sıstem ıle cıddı bır performans real trade de elde edebıldınız mı?

                ( Sıstem test sonuclarını sormuyorum, real trade sonucunu soruyorum)

                Saygı ve Sevgılerımle...

                Yorum

                • teo
                  Demirbaş
                  • 03 Mart 2009
                  • 3712

                  #38
                  The volume-weighted moving average
                  The VWMA is analogous to the SMA. (The SMA is actually a special case of the VWMA,
                  where all the volume values are set at 1.) The n-period VWMA is formed by making the
                  (price)(volume) product for each of the last n trading bars, summing those products,
                  and dividing by the sum of the total volume over the last n bars. So its formula is:

                  Sum(Vol.*Price)/Sum(Vol.), for the latest n bars

                  In MetaStock's Indicator Builder scripting language, the VWMA is:


                  {Volume weighted moving average of closes}
                  Periods:=Input("Enter number of periods",1,500,52);
                  (Sum(V*C,Periods)/Sum(V,Periods))


                  ... The VWMA consists of a numerator, Sum(Price*Volume), and a denominator, Sum(Volume),
                  over the latest n bars. My idea is to apply exponential weighting separately to both the
                  numerator and the denominator. Instead of the numerator being the sum of the
                  price*volume products, make it the EMA of the price*volume products. And instead of the
                  denominator being the sum of the volume, make it the EMA of the volume.

                  Thus, the formula for the VWEMA would be:


                  EMA of (Price*Volume) divided by EMA of Volume

                  This is simple to implement in scripting languages. The MetaStock implementation of
                  this is:

                  {Volume weighted exponential moving average of closes}
                  Periods:=Input("Enter number of periods",1,500,22);
                  (Mov(V*C,Periods,E))/(Mov(V,Periods,E))


                  The volume-weighted MACD histogram
                  Since the MACDH is composed of exponential moving averages, we simply substitute our
                  new VWEMA for each EMA, and thus we get the volume-weighted MACDH (VMACDH).

                  The MetaStock indicator for the VMACDH is:

                  PeriodS:=Input("Enter short period",1,500,12);
                  PeriodL:=Input("Enter long period",2,501,26);
                  PeriodSig:=Input("Enter smoothing period",1,200,9);
                  LongMA:=(PeriodL*Mov(V*C,PeriodL,E))/(PeriodL*Mov(V,PeriodL,E));
                  ShortMA:=(PeriodS*Mov(V*C,PeriodS,E))/(PeriodS*Mov(V,PeriodS,E));
                  VMACD:=(ShortMA-LongMA);
                  SignalLine:=Mov(VMACD,PeriodSig,E);
                  VMACD-SignalLine

                  Yorum

                  Working...
                  X

                  Debug Information