Skip to main content

4 Tips for using Midas in KPL, Code added

ATTENTION : KPL-Midas Code is at the last part of this post. Please copy and paste in your amibroker.)
4 Tips for using Midas in KPL:
1. put your price mark at the beginning of last major price break, bullish or bearish.
2. Right click on price chart, and open Peremeters
3. Change the settings of VWAP channel and ovserve in chart, whether it can create strong support /ressitance level. or not.
4. If you are satisfied with the setting, click OK.
(of course, at the same time you can change the KPLs perimeter.)






KPL Swing is a simple trend following mechanical trading system. It automates the entry and exit signal. This trading system is very simple and easy to use. It works across multiple time frames and does not require any in-depth knowledge of TA.
In KPL System no targets are given as no one knows how high (or low) the stock price will reach. A trailing stoploss locks in the gains and removes emotions from trading.
The MIDAS system of technical market analysis is based on the concept of Volume Weighted Average Price (VWAP). VWAP calculations is being used widely worldwide. A standard VWAP calculation represents the total value of shares traded in a particular stock on a particula day divided by the total volume of shares traded in that stock on that day.
( a chart using both KPL and MIDAS (three lines) curves has been used here : http://tatunnel.blogspot.com/2010/08/trading-system-using-kpl-with-midas.html. In chart its visible that both KPL the Midas are working as support and resistance level.




CODES Bellow:


SetChartBkColor(colorWhite);
_SECTION_BEGIN("KPL");
//AFL by Kamalesh Langote. Email:kpl@vfmdirect.com
no=Param( "Swing", 2, 1, 55 );
tsl_col=ParamColor( "Color", colorCycle );

res=HHV(H,no);
sup=LLV(L,no);
avd=IIf(C>Ref(res,-1),1,IIf(C
avn=ValueWhen(avd!=0,avd,1);
tsl=IIf(avn==1,sup,res);

Plot(tsl, _DEFAULT_NAME(), tsl_col, styleStaircase,0,0,1);

Buy=Cross(C,tsl);
Sell=Cross(tsl,C);
shape=Buy*shapeUpArrow + Sell*shapeDownArrow;
PlotShapes(shape,IIf(Buy,tsl_col,tsl_col),0,IIf(Buy,Low,High));
_SECTION_END();


_SECTION_BEGIN("ANCHORED VWAP CHANNEL");
dn = DateTime();
sd = SelectedValue( dn );

start = dn == sd;

mp = (H+L)/2;

PV = mp * V;
CV = Cum( V );
VSS = CV - ValueWhen( start, CV );

denom = IIf( VSS == 0, 1, VSS );
num = Cum( PV ) - ValueWhen( start, Cum( PV ) );

M = IIf( BarsSince( start ), num/denom, mp );

Q1 = Param("Percentage Upper", 1, 0, 10, 0.01 );
Q2 = Param("Percentage Lower", 1, 0, 10, 0.01 );

Plot( C, Date() + " Close", colorBlack, styleBar );
Plot( M, "M" + _PARAM_VALUES(), colorBlue );
Plot( M * ( 1 + Q1 * 0.01 ), "Upper", colorGreen );
Plot( M * ( 1 - Q2 * 0.01 ), "Lower", colorRed );
_SECTION_END();

Comments

  1. i am getting error inline 10 and 11

    ReplyDelete
  2. try this code, please :

    _SECTION_BEGIN("KPL");
    //AFL by Kamalesh Langote. Email:kpl@vfmdirect.com
    no=Param( "Swing", 2, 1, 55 );
    tsl_col=colorWhite;

    res=HHV(H,no);
    sup=LLV(L,no);
    avd=IIf(C>Ref(res,-1),1,IIf(C<Ref(sup,-1),-1,0));
    avn=ValueWhen(avd!=0,avd,1);
    tsl=IIf(avn==1,sup,res);

    Plot(tsl, _DEFAULT_NAME(), tsl_col, styleStaircase, styleThick, 0,0,1);

    Buy=Cross(C,tsl);
    Sell=Cross(tsl,C);
    shape=Buy*shapeUpArrow + Sell*shapeDownArrow;
    PlotShapes(shape,IIf(Buy,tsl_col,tsl_col),0,IIf(Buy,Low,High));
    _SECTION_END();
    _SECTION_BEGIN("ANCHORED VWAP CHANNEL");
    dn = DateTime();
    sd = SelectedValue( dn );

    start = dn == sd;

    mp = (H+L)/2;

    PV = mp * V;
    CV = Cum( V );
    VSS = CV - ValueWhen( start, CV );

    denom = IIf( VSS == 0, 1, VSS );
    num = Cum( PV ) - ValueWhen( start, Cum( PV ) );

    M = IIf( BarsSince( start ), num/denom, mp );

    Q1 = Param("Percentage Upper", 1, 0, 10, 0.01 );
    Q2 = Param("Percentage Lower", 1, 0, 10, 0.01 );

    Plot( C, Date() + " Close", colorBlack, styleBar );
    Plot( M, "M" + _PARAM_VALUES(), colorBlue );
    Plot( M * ( 1 + Q1 * 0.01 ), "Upper", colorGreen );
    Plot( M * ( 1 - Q2 * 0.01 ), "Lower", colorRed );
    _SECTION_END();

    ReplyDelete
  3. PIASH VAI,....PARAMETER E GIYE ONLY KPL & ANCHORED KE DEKHTE PACCHI.....KIVABE EI DUITA KE MODIFY KORBO ?? & USE TA JODI EKTU DETAILS E BOLTEN.......MEANS EI AFL THEKE KI EVALUATE KORTE PARI & EKTA JODI CHART DEKHA JETO THEN BUJHTE SUBIDHA HOTO.....

    ReplyDelete

Post a Comment

Popular posts from this blog

Trading System : Using KPL with MIDAS curve

Firsly, the KPL Swing is a simple trend following mechanical trading system. It automates the entry and exit signal. This trading system is very simple and easy to use. It works across multiple time frames and does not require any in-depth knowledge of TA. In KPL System no targets are given as no one knows how high (or low) the stock price will reach. A trailing stoploss locks in the gains and removes emotions from trading. Secondly, the the MIDAS System. The MIDAS system of technical market analysis is based on the concept of Volume Weighted Average Price (VWAP). VWAP calculations is being used widely worldwide. A standard VWAP calculation represents the total value of shares traded in a particular stock on a particula  day divided by the total volume of shares traded in that stock on that day. Here i`m giving a chart using bothe KPL and MIDAS (three lines) curves. As example, BERGER symbol (data updated at 4 Aug, 2010) has been used. In chart its visible that both ...

Make your Amibroker Chart Colorful

You can make any chart of Amibroker Colorful with gradient effect. Just copy and paste this code above any afl codes, save, open parameter and choice two of your favorite color. Its done! code are : SetChartBkGradientFill( ParamColor("BgTop", ColorRGB( 172,172,172 )), ParamColor("BgBottom", ColorRGB( 172,172,172 )),ParamColor("titleblock",ColorRGB( 172,172,172 ))); This tip is not intended for primary level user. To change Amibroker`s default Background color visit http://tatunnel.blogspot.com/2010/07/change-amibroker-chart-background-color.html