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

How to Import CSV data into amibroker

Tips : A Step by StepsText guide, A pictorial guide and a video guide has been attached with the post. To see right now go to last part of the post, clicking more.   Now post : After database creation, importing CSV data is the 2nd major job Amibroker requires. But for new users of Amibroker, a trading system software, its not always an easy job. In Bangladesh most of the TA followers import data through Profita, as its more easier. Stockbangladesh.com gives csv data more faster, just after the market closes at 3pm, but it lacks sector data in csv files.  So its better wait one hour, update Profita after 4PM, and import csv file to amibroker. But how? See the graph bellow. Its very easy.  Just have a glance. It`s `Jalabat Taralang'. Steps to follow : Profita1: in Profita Click `Tools', then click `Export data to Amibroker' P2: previous click opened Date selection option P3: select your date. Selection of more than one day is possible. If you do it everyday, m

Change Amibroker Chart Background Color

How you would change the color of your Amibroker chart`s Background? Its very simple. Tools>Preferences>Color>Background is the path for color change options. Click Background, which color by default is black, and select a new color. Click Ok. Tips: never use pure Black color. As some indicators have black lines, even some price bars are black. These color will be lost In black background. Chose a lighter one, and my preference is gray- light or deep. The problem of this setting is it changes all the charts background. To give different color in different chart you need a simple trick. Interested? Then click http://tatunnel.blogspot.com/2010/07/make-your-amibroker-chart-colorful.html