Stock Portfolio Organizer
The ultimate porfolio management solution.
WiseTrader Toolbox
#1 Selling Amibroker Plugin featuring:
koam-ashi nifty trading system for Amibroker (AFL)
koam-ashi nifty trading system with buy and sell signal. enjoy.
Screenshots
Similar Indicators / Formulas
Indicator / Formula
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 | _SECTION_BEGIN ( "Price" ); SetChartOptions (0, chartShowArrows | chartShowDates ); _N (Title = StrFormat ( "{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}" , O , H , L , C , SelectedValue ( ROC ( C , 1 ) ) )); Plot ( C , "Close" , ParamColor ( "Color" , colorBlack ), styleNoTitle | ParamStyle ( "Style" ) | GetPriceStyle () ); _SECTION_END (); "plotted pivots \n Plotted the avarage as a bars \n " ; _SECTION_BEGIN ( "average as a bar" ); /* Heikin-Ashi(Koma-Ashi) with Moving Average Type */ SetChartOptions (2, chartWrapTitle ); // Calculate Moving Average MAPeriod = Param ( "MA Period" , 15, 1, 100); MAOpen = EMA ( Open , MAPeriod); MAHigh = EMA ( High , MAPeriod); MALow = EMA ( Low , MAPeriod); MAClose = EMA ( Close , MAPeriod); HaClose = (MAOpen + MAHigh + MALow + MAClose) / 4; HaOpen = AMA ( Ref (HaClose, -1), 0.5); // for graph collapse for (i = 0; i <= MAPeriod; i++) HaClose[i] = Null ; /* // same // HaOpen = (Ref(HaOpen, -1) + Ref(HaClose, -1)) / 2; HaOpen[ 0 ] = HaClose[ 0 ]; for(i = 1; i < BarCount; i++) { HaOpen[i] = (HaOpen[i - 1] + HaClose[i - 1]) / 2; } */ HaHigh = Max (MAHigh, Max (HaClose, HaOpen)); HaLow = Min (MALow, Min (HaClose, HaOpen)); // outs comments "BarIndex = " + BarIndex (); "Open = " + Open ; "High = " + High ; "Low = " + Low ; "Close = " + Close ; "HaOpen = " + HaOpen; "HaHigh = " + HaHigh; "HaLow = " + HaLow; "HaClose = " + HaClose; // Plot graphs _N (Title = StrFormat ( "{{NAME}} - {{INTERVAL}} {{DATE}} HaOpen %g, HaHigh %g, HaLow %g, HaClose %g (%.1f%%) {{VALUES}}" , HaOpen, HaHigh, HaLow, HaClose, SelectedValue ( ROC ( HaClose, 1)))); PlotOHLC (HaOpen, HaHigh, HaLow, HaClose, _DEFAULT_NAME (), ParamColor ( "Color" , colorWhite ), styleBar ); _SECTION_END (); //source http://www.traderji.com/amibroker/24404-help-amibroker-forumla-afl-saintjis-going-60min-flow-practice-2.html // Written by Abhay (aad on www.traderji.com) // Previous version 1.0 on 28.07.2008. // Current Version 1.1 on 31.07.2008. /////////////////////////////////////////////////////////// ///// Major changes done from previous version 1.0 : ////// // The method of pivot definition is changed. // Now it does not use zig() or related functions anywhere. // Stoploss line error, that it moves in both directions after a position is taken, // is removed. Now stoploss lines are unidirectional. // To protect profit on long positions, SELL is triggered either when trailing buy stop // is hit OR when previous lower pivot is cracked. Fresh long position will be initiated // if uptrend continues after previous high pivot is cracked. /////////////////////////////////////////////////////////// // This is simple YET powerful pivot based trading system. // Used only for intraday. Not suitable for EOD data. // Designed for continuous trading. i.e. short=sell and cover=buy // When long, watch crack of close in green line ONLY. Ignore red line. // When short, watch crack of close in red line ONLY. Ignore green line. // You will have to tweak the parameters as per your trading style. // Warning : I have tried to develop this method from Saint's Pivot Based System (www.traderji.com) // However, it is very well possible that its performance is not as per actual system // suggested by Saint due to programming errors and inadequate knowledge level at my end. // Warning : Traders are advised to trade on their own, knowing very well that it is their money. _SECTION_BEGIN ( "Simple Pivot based Trading System" ); // User defined parameters. GraphXSpace = 10; //defines how much extra space should be added above and below graph line (in percent). dist = 0.25* ATR (10); Capital= Param ( "Total capital" ,100000,10000,1000000,1000); drawdown= Param ( "Max. loss per trade as % of Capital" , 1.0,0.5,25.0,0.1); room= Param ( "Room for S/L as % of Pivot value" ,0.0005,0,0.02,0.0001); // Now calculate pivots. Method courtesy : Kenneth (www.traderji.com) PH= ValueWhen ( ( Ref ( H ,-2) > Ref ( H , -4)) AND ( Ref ( H ,-2) > Ref ( H , -3)) AND ( Ref ( H ,-2) > Ref ( H , -1)) AND ( Ref ( H ,-2) > H ), Ref ( H ,-2)); PL= ValueWhen ( ( Ref ( L ,-2) <= Ref ( L , -4)) AND ( Ref ( L ,-2) <= Ref ( L , -3)) AND ( Ref ( L ,-2) <= Ref ( L , -1)) AND ( Ref ( L ,-2) <= L ), Ref ( L ,-2)); // filter lines phfilter=PH+(room*PH); plfilter=PL-(room*PL); //Uncomment following code if you wish to see the pivot lines. Plot ( Ref (PH,2), "UpPivot" , ParamColor ( "UpPivot Color" , colorRed ), styleDashed + styleNoLabel ); Plot ( Ref (PL,2), "DownPivot" , ParamColor ( "DownPivot Color" , colorGreen ), styleDashed + styleNoLabel ); Plot ( Ref (Phfilter,2), "Upfilter" , ParamColor ( "upfilter Color" , colorRed ), styleLine ); Plot ( Ref (Plfilter,2), "Downfilter" , ParamColor ( "dnfilter Color" , colorGreen ), styleLine ); //Plot(Ref(UpFractal,2), "Up Fractal", ParamColor("Up Fractal Color",colorRed),8); //Plot(Ref(DownFractal,2), "Down Fractal",ParamColor("Down Fractal Color",colorGreen),8); /*for (a=4;a<BarCount;a++) { if ((H[a-2] >= H[a-4]) AND (H[a-2] >= H[a-3]) AND (H[a-2] >= H[a-1]) AND (H[a-2] >= H[a])) PlotText("PH", a-2, H[a-2], colorGreen); if ((L[a-2] <= L[a-4]) AND (L[a-2] <= L[a-3]) AND (L[a-2] <= L[a-1]) AND (L[a-2] <= L[a])) PlotText("PL", a-2, L[a-2]-dist[a-2], colorRed); }*/ //Condition for buy : Enter when Close crosses latest pivot high. Buy = C > (PH+(room*PH)); initialStopBuy= Ref (PL,2)-( Ref (PL,2)*room/100); trailStopBuy= IIf ( C >PH, Ref (initialStopBuy,-1),initialStopBuy); newStopBuy=trailStopBuy; BuyLimitCapital= int (Capital/ C ); SLbuy= round ( C -initialStopBuy); BuyLimitSL= int ((Capital*drawdown)/(100*SLbuy)); //Condition for sell : Exit when previous pivot low is cracked. Sell = C < (PL-(room*PL)); Buy = ExRem ( Buy , Sell ); Sell = ExRem ( Sell , Buy ); //Short = Sell; //Cover = Buy; //Short=ExRem(Short,Cover); //Cover=ExRem(Cover,Short); shape = Buy * shapeUpArrow + Sell * shapeDownArrow ; PlotShapes ( shape, IIf ( Buy , colorGreen , colorRed ),0, IIf ( Buy , Low , High ) ); _SECTION_END (); |
4 comments
Leave Comment
Please login here to leave a comment.
Back
Excellent work done.
Very good!
Thank You!
Nice Thanks
ERRRRR