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 ...

Learn AFL from AMi guru

I have a laptop, or a mobile phone, and I don't know how to use! What a shame!! We use Amibroker, love amibroker but, how much this great tool`s potentiality we are using? Most of the users just generate charts, and are satisfied. If we want to beat my fellow traders, defeat the crowd there is no alternative to deep knowledge. Stock market is evolving day by day, it is growing every moments. More time goes, more the conscious traders are becoming aware about the trading system. Here comes the name of Amibroker! And Amibroker`s heart is it`s AFL, amibroker formula language. But unfortunately this subject lacks free tutorial in the net. How much you do googling, you will be disappointed. Then solution? Howard Bandy. He has written two excellent books on Amibroker. 1. Introduction to Amibroker and 2. Quantitative Trading System. One Should start with the first one.This is the book  you need if you are looking for a step-by-step introduction to  AmiBroker.This book is for;...