รบกวนขอสูตรทั้งหมดสำหรับ Amibroker ครับ

Home Forums CDC Forums Supporting Members Area — รวบรวมสูตร Downloads และระบบการเทรด รบกวนขอสูตรทั้งหมดสำหรับ Amibroker ครับ

Viewing 7 reply threads
  • Author
    Posts
    • #24358
      Profit Grower
      Participant

      อยากได้สูตรสำหรับ Amibroker ครับ ที่มี link สำหรับ download มีแต่ของ Metastock ครับ

      ขอบคุณครับ

    • #24359
      dreamscat
      Keymaster

      CDC Action Zone Basic.afl

      ///////////////////////////
      // CDC Action ZOne Basic //
      // 21st April 2017 //
      ///////////////////////////

      // Basic Parameter Setup //

      PlotStyle = ParamToggle(“Plot Style”,”Price Chart|MACD”,0);
      PlotLine = ParamList(“Plot MA Lines”,”Plot Lines|Plot Bullish and Bearish Trend|Plot Lines and Trend|Do not Plot”,0);
      Price = ParamField(“Price”,3);

      FastPrd = Param(“Fast MA Period”,12);
      SlowPrd = Param(“Slow MA Period”,26);

      // Un-comment these to enable optimization //
      // Do not forget to set your own lower and upper limits //
      // Do not forget to comment the FastPrd and SlowPrd lines above //
      /*
      SlowPrd = Optimize(“Slow MA Period”,26,12,125,2);
      FastPrd = round(Optimize(“Fast MA Period”,0.1,0.1,0.6,0.05)*SlowPrd);
      */

      // Main functions //
      Fast = EMA(Price,FastPrd);
      Slow = EMA(Price,SlowPrd);

      Bullish = Fast > Slow;
      Bearish = Fast < Slow;

      // Bar Colors //
      Green = Bullish AND Price > Fast;
      Yellow = Bullish AND Price < Fast AND Price > Slow;
      Brown = Bullish AND Price < Slow;

      Red = Bearish AND Price < Fast;
      Aqua = Bearish AND Price > Fast AND Price < Slow;
      Blue = Bearish AND Price > Slow;

      BarColor = IIf(Green,colorGreen,IIf(Yellow,colorYellow,IIf(Brown,colorOrange,IIf(Red,colorRed,IIf(Aqua,colorAqua,IIf(Blue,colorBlue,colorDefault))))));

      // Buy & Sell //
      // Amibroker recognize these functions and use them in system tests and scans //
      Buy = Bullish AND Ref(Bearish,-1);
      Sell = Bearish AND Ref(Bullish,-1);

      // Explorer //
      // A more detailed report //

      Filter = 1; // Basically means we don’t filter anything

      // This part here is also mainly cosmetics //
      // The codes are mostly about how the exploration should be displayed //

      pctchange = ((C-Ref(C,-1))/C)*100;
      buyp = ValueWhen(Ref(Buy,-1),O,1);
      sellp = ValueWhen(Ref(Sell,-1),O,1);

      longpct = IIf(BarsSince(Buy) < BarsSince(Sell),(C-buyp)/buyp,Null);
      longcolor = iif (SelectedValue(longpct) > 0,IIf(SelectedValue(longpct) < 1, SelectedValue(longpct), 1),IIf(SelectedValue(longpct) > -1, abs(SelectedValue(longpct)) , 1));

      shortpct = IIf(BarsSince(Sell) < BarsSince(Buy),(buyp-C)/buyp,Null);
      shortcolor = iif (SelectedValue(shortpct) > 0,IIf(SelectedValue(shortpct) < 1, SelectedValue(shortpct), 1),IIf(SelectedValue(shortpct) > -1, abs(SelectedValue(shortpct)) , 1));

      colorGV = ColorBlend(GetChartBkColor(),colorGreen,longcolor);
      colorRV = ColorBlend(GetChartBkColor(),colorRed,shortcolor);

      AddColumn(C,”Last Price”,1.4);
      AddColumn(pctchange,”% Change”,1.2,IIf(pctchange>0,colorGreen,colorRed));
      AddColumn(Buy,”Buy Order”,1.0,colorDefault,IIf(Buy==1,colorLime,colorDefault));
      AddColumn(Sell,”Sell Order”,1.0,colorDefault,IIf(Sell==1,colorRed,colorDefault));

      AddColumn(IIf(BarsSince(Buy) < BarsSince(Sell),BarsSince(Buy),Null),”Buy Since (Bars)”,1.0);
      AddColumn(longpct*100,”Long %”,1.2,colorDefault,IIf(SelectedValue(longpct) > 0,ColorBlend(colorDefault,colorGreen,longcolor),ColorBlend(colorDefault,colorRed,longcolor)));

      AddColumn(IIf(BarsSince(Sell) < BarsSince(Buy),BarsSince(Sell),Null),”Sell Since (Bars)”,1.0);
      AddColumn(shortpct*100,”Short %”,1.2,colorDefault,IIf(SelectedValue(shortpct) > 0,ColorBlend(colorDefault,colorGreen,shortcolor),ColorBlend(colorDefault,colorRed,shortcolor)));

      // Plots //
      // This part does not have to be complicated at all //
      // What you see here is mostly for cosmetic purpose //

      if(PlotStyle == 0)
      {
      if(PlotLine == “Plot Lines”)
      {
      Plot(Fast,”Fast MA”,colorRed,styleLine);
      Plot(Slow,”Slow MA”,colorBlue,styleLine | styleThick);
      }
      if(PlotLine == “Plot Bullish and Bearish Trend”)
      {
      GraphZOrder = 1;
      PlotOHLC(Fast,Fast,Slow,Slow,”Action Zone Trend Cloud”,IIf(Bullish,ColorBlend(colorGreen,GetChartBkColor()),ColorBlend(colorRed,GetChartBkColor())),styleCloud);
      }
      if(PlotLine == “Plot Lines and Trend”)
      {
      GraphZOrder = 1;
      PlotOHLC(Fast,Fast,Slow,Slow,”Action Zone Trend Cloud”,IIf(Bullish,ColorBlend(colorGreen,GetChartBkColor()),ColorBlend(colorRed,GetChartBkColor())),styleCloud);
      Plot(Fast,”Fast MA”,colorRed,styleLine);
      Plot(Slow,”Slow MA”,colorBlue,styleLine | styleThick);
      }
      if(PlotLine == “Do not Plot”)
      {
      }
      Plot(Close,”Price”,BarColor,GetPriceStyle());
      }
      else
      {
      macdline = Fast – Slow;
      signalline = MA(macdline,9);
      Plot(signalline,”Signal Line”,colorBlack,styleLine | styleThick);
      Plot(macdline,”Action Zone Basic | MACD”,BarColor,styleArea);

      }

      // Modify Jan 2018
      Maxpos = 50;
      SetPositionSize(100/Maxpos,spsPercentOfEquity); // 1 % of Equity
      //

    • #24360
      dreamscat
      Keymaster

      CDC Actionzone 170101 for Amibroker.afl

      ///////////////////////////
      // CDC Actionzone 170101 //
      // Amibroker Edition //
      // Converted 17/01/2017 //
      ///////////////////////////

      _N( Title = StrFormat( “{{NAME}} – {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) Vol ” + WriteVal( V, 1.0 ) + ” {{VALUES}}”, O, H, L, C, SelectedValue( ROC( C, 1 ) ) ) );

      src = ParamField(“Data Source”,3);

      sprd = Optimize(“Slow MA”,26,15,50,1);
      fprd = Optimize(“Fast Period”,0.3,0.1,0.6,0.05)*sprd;

      fast = EMA(src,fprd);
      slow = EMA(src,sprd);
      macdv = fast-slow;
      sig = MA(macdv,9);

      Bullish = macdv>0;
      Bearish = macdv<0;

      Green = Bullish AND src>fast;
      Yellow = Bullish AND src<fast AND src>slow;
      Brown = Bullish AND src<fast AND src<slow;

      Red = Bearish AND src<fast;
      Aqua = Bearish AND src>fast AND src<slow;
      Blue = Bearish AND src>fast AND src>slow;

      buysig = Bullish AND Ref(Bearish,-1);
      PreBuy = Blue AND Ref(Blue,-1) AND Ref(Blue,-2) AND Ref(Blue,-3) AND src<Ref(src,-2);
      BuyMore=BarsSince(Bullish)<26 AND Yellow AND src=LLV(src,9);

      sellsig = Bearish AND Ref(Bullish,-1);
      PreSell=Yellow AND BarsSince(buysig)>25 AND src<Ref(src,-2);
      SellMore=Yellow AND BarsSince(Yellow)>2 AND src<Ref(src,-2);

      //Plot(sig,”Signal Line”,colorBlue,styleLine);
      //SetGradientFill(colorLime,colorRed,0,GetChartBkColor());
      //Plot(macdv,”MACD”,colorGrey50,styleGradient);

      plotcolor = IIf(Green,colorGreen,IIf(Yellow,colorYellow,iif(Brown,colorBrown,iif(Red,colorRed,iif(Aqua,colorAqua,iif(Blue,colorBlue,colorWhite))))));

      Plot(c,”Price”,plotcolor,styleCandle);
      Plot(fast,”Fast EMA”,colorRed,styleDashed);
      Plot(slow,”Slow EMA”,colorBlueGrey,styleDashed);
      PlotOHLC(fast,fast,slow,slow,”2ma zone”,IIf(fast>slow,ColorBlend(colorGreen,GetChartBkColor()),ColorBlend(colorRed,GetChartBkColor())),styleCloud);

      // Exploration //

      pctchange = ((C-Ref(C,-1))/Ref(C,-1))*100;
      Filter = pctchange;
      AddColumn(C,”Close”);
      AddColumn(buysig,”Buy”);
      AddColumn(prebuy,”PreBuy”);
      AddColumn(BuyMore,”Buy More”);
      AddColumn(sellsig,”Sell”);
      AddColumn(PreSell,”PreSell”);
      AddColumn(SellMore,”Sell More”);
      AddColumn(pctchange,”Percent Change”);

      // Quick Scan //
      Buy = buysig;
      Sell = sellsig;

      // System Test //
      // DO NOT FORGET TO EDIT THIS PART TO FIT YOUR SYSTEM TEST SETTINGS!! //

      maxpos = 500;

      SetPositionSize(100/maxpos,spsPercentOfEquity);
      SetOption(“InitialEquity”, 1000000);
      SetOption(“AllowPositionShrinking”, True);
      SetOption(“MaxOpenPositions”,maxpos);

    • #24361
      dreamscat
      Keymaster

      PnT 1.1

      Pct=Param(“Pct”,1,0.1,2,0.1);
      Pk=Peak(C,Pct,1); Tr=Trough(C,Pct,1);
      Upper=Ref(ValueWhen(Pk!=Ref(Pk,-1),C,1),-1);
      Lower=Ref(ValueWhen(Tr!=Ref(Tr,-1),C,1),-1);
      Grn=BarsSince(Cross(C,Upper))<BarsSince(Cross(Lower,C));
      Red=BarsSince(Cross(C,Upper))>BarsSince(Cross(Lower,C));
      BarColor=Iif(Grn,colorGreen,colorRed);
      Plot(C,_DEFAULT_NAME(),BarColor,styleCandle);
      Plot(Upper,”Upper”,colorGreen,styleDashed);
      Plot(Lower,”Lower”,colorRed,styleDashed);

    • #24362
      dreamscat
      Keymaster

      ATR trailing stop.afl (สูตรเฉพาะ indicator ครับ)

      prd = 14;
      x = 2;
      plt0 = HHV(H-x*ATR(prd),prd);
      plt1 = IIf(C>plt0,plt0,Null);
      Plot(plt1,”ATR trailing stop”,colorRed,styleThick);
      //Plot(C,”Price”,colorGrey40,styleCandle);

    • #24363
      dreamscat
      Keymaster

      RSI Over Bought – Over Sold

      zz=2;
      rs=RSI(14);
      Bullrtr1=ValueWhen(TroughBars(C,zz,1)==0,rs,1);
      Bullrtr2=ValueWhen(TroughBars(C,zz,1)==0,rs,2);
      Bullctr1=ValueWhen(TroughBars(C,zz,1)==0,C,1);
      Bullctr2=ValueWhen(TroughBars(C,zz,1)==0,C,2);
      BullDVG=Bullrtr1>Bullrtr2 AND Bullctr2>Bullctr1; //AND Bullrtr1<30
      BullDVG=Ref(BullDVG AND Ref(BullDVG,-1)==0,-1);

      Setsortcolumns(-2);
      SetOption(“NoDefaultColumns”,1);
      filter = IIf(StrLen(Name())<=5,1,IIf(StrToNum(StrLeft(Strright(Name(),3),1))+StrToNum(StrLeft(Strright(Name(),4),1))==0,1,0))
      AND Strright(Name(),2)!=”-F” AND Strright(Name(),2)!=”-P” AND Strright(Name(),2)!=”_I” AND Strright(Name(),4)!=”_CON” AND Strleft(Name(),1)!=”!” AND Strleft(Name(),1)!=”$”
      AND Strright(Name(),2)!=”17″ AND Strright(Name(),2)!=”.1″
      AND C>0.5
      AND Now(3)-Datenum()<8900 AND Status(“lastbarinrange”)
      AND MA(C*V,2)>500000 ;

      AddTextColumn(Name(),”Ticker”,formatChar,colorDefault,colorDefault,80);
      AddColumn(DateTime(),”Date/time”,formatDateTime,colorDefault,colorDefault,70);

      AddColumn(IIf(IsEmpty(BarsSince(BullDVG)<=15),0,BarsSince(BullDVG)<=15),
      “Divergence”,1.0,colorDefault,colorDefault,35);

      OB=IIf(rs>70,1,0);
      OS=IIf(rs<30,1,0);
      AddColumn(OB,”Overbought”,1.0,colorDefault,colorDefault,35);
      AddColumn(OS,”Oversold”,1.0,colorDefault,colorDefault,35);

    • #24364
      dreamscat
      Keymaster

      CDC – 1 ATR Channel 20170502.afl

      // CDC 1 ATR Channel 20170502
      Prc=C;
      X=1;
      Smth=2;
      Upper=Ref(EMA(Prc+X*ATR(14),Smth),-1);
      Lower=Ref(EMA(Prc-X*ATR(14),Smth),-1);
      Buy=Cross(Prc,Upper);
      Sell=Cross(Lower,Prc);
      Bullish=BarsSince(Buy)<BarsSince(Sell);
      Bearish=BarsSince(Buy)>BarsSince(Sell);
      Green=Bullish AND Prc>Lower;
      Red=Bearish AND Prc<Upper;

      Plot(C,””,IIf(Green,colorGreen,IIf(Red,colorRed,colorWhite)),stylecandle);
      Plot(Upper,”Upper”,colorblue,styleLine|styleDashed);
      Plot(Lower,”Lower”,colorRed,styleLine|styleDashed);

    • #24366
      Profit Grower
      Participant

      ขอบคุณมากๆครับ

Viewing 7 reply threads
  • You must be logged in to reply to this topic.