Stock Portfolio Organizer
The ultimate porfolio management solution.
Shares, Margin, CFD's, Futures and Forex
EOD and Realtime
Dividends and Trust Distributions
And Much More ....
WiseTrader Toolbox
#1 Selling Amibroker Plugin featuring:
Advanced Adaptive Indicators
Advanced Pattern Exploration
Neural Networks
And Much More ....
pg.sinu for Amibroker (AFL)
Copy & Paste Friendly
Back
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 | _SECTION_BEGIN ( "camarilla levels" ); //---- pivot points DayH = TimeFrameGetPrice ( "H" , inDaily , -1); // yesterdays high DayL = TimeFrameGetPrice ( "L" , inDaily , -1); // low DayC = TimeFrameGetPrice ( "C" , inDaily , -1); // close DayO = TimeFrameGetPrice ( "O" , inDaily ); // current day open // camarilla pivots if ( True ) { R = DayH - DayL; // range PP = (DayH + DayL + DayO + DayO) / 4 ; R4 = (R * 1.1/2)+DayC; R3 = (R * 1.1/4)+DayC; S3 = DayC-(R * 1.1/4); S4 = DayC- (R * 1.1/2); } Plot (R4, "" , colorGreen , styleLine ); Plot (S4, "" , colorDarkBlue , styleLine ); Plot (R3, "R3" , colorRed , styleLine ); Plot (S3, "S3" , colorDarkBlue , styleLine ); Plot (PP, "" , colorYellow , styleLine ); //---- Title = Name ()+ " Camarilla" + Date ()+ EncodeColor ( colorRed )+ " R3 " + WriteVal (R3,1.2)+ EncodeColor ( colorGreen )+ " S3 " + WriteVal (S3,1.2)+ "\n" + EncodeColor ( colorGreen )+ " Long Breakout above " + WriteVal (R4,1.2)+ "\n" + EncodeColor ( colorRed )+ " Short breakout below " + WriteVal (S4,1.2) + "\n" + EncodeColor ( colorGreen )+ " If Rangebound buy close to " + WriteVal (S3,1.2)+ "\n" + EncodeColor ( colorRed )+ " If Rangebound short close to " + WriteVal (R3,1.2); Filter =1; AddColumn ( C , "cmp" ,1.2); AddColumn (R3, "R3" ,1.2); AddColumn (R4, "R4" ,1.2); AddColumn (S3, "S3" ,1.2); AddColumn (S4, "S4" ,1.2); _SECTION_END (); _SECTION_BEGIN ( "Kpl System" ); /* my entry is very simple(daily data for trading) kpl system for entry only & exit as follow: 1 st exit at x % from entry price only 1/3 quantity.(ie 1st profit target) 2 nd exit when exit Signal comes from kpl sys remaining 1/3 quantity. 3. scale-in to initial quantity if new kpl Buy Signal comes. re-do above scaling-out & scaling-in till filal exit. 4. final exit all quantity when Close below 21 Day EMA. kpl system code bellow : */ //AFL by Kamalesh Langote. Email:kpl@... no= Param ( "Swing" , 20, 1,150 ); tsl_col= ParamColor ( "Color" , colorRed ); 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); Buy = Cover = Cross ( C ,tsl) ; Sell = Short = Cross (tsl, C ) ; Plot (tsl, _DEFAULT_NAME (), tsl_col, styleStaircase ); Buy = ExRem ( Buy , Sell ); Sell = ExRem ( Sell , Buy ); Short = ExRem ( Short , Cover ); Cover = ExRem ( Cover , Short ); PlotShapes ( IIf ( Buy , shapeUpArrow , shapeNone ), colorWhite , 0, Low ,-15); PlotShapes ( IIf ( Sell , shapeDownArrow , shapeNone ), colorYellow , 0, High ,-15); PlotShapes ( IIf ( Cover , shapeHollowCircle , shapeNone ), colorWhite , 0, Close ,0); PlotShapes ( IIf ( Short , shapeHollowCircle , shapeNone ), colorYellow , 0, Close ,0); SetPositionSize (300, spsShares ); ApplyStop (0,1,10,1); //-----------end-------------- Long= Flip ( Buy , Sell ); Shrt= Flip ( Sell , Buy ); BuyPrice = ValueWhen ( Buy , C ); SellPrice = ValueWhen ( Sell , C ); Edc=( WriteIf ( Buy AND Ref (shrt,-1), " BUY@ " + C + " " , "" )+ WriteIf ( Sell AND Ref (Long,-1), " SEll@ " + C + " " , "" )+ WriteIf ( Sell , "Last Trade Profit Rs." +( C - BuyPrice )+ "" , "" )+ WriteIf ( Buy , "Last Trade Profit Rs." +( SellPrice - C )+ "" , "" )); _SECTION_END (); //============== TITLE ============== _SECTION_BEGIN ( "Title" ); if ( Status ( "action" ) == actionIndicator ) ( Title = EncodeColor ( colorGold )+ "arihant Trading System" + EncodeColor ( colorRose )+ " (" + Name () + ") " + EncodeColor ( colorGold )+ Interval (2) + " " + Date () + " " + " • Open " + WriteVal ( O ,1.2)+ " • " + "Hi " + WriteVal ( H ,1.2)+ " • " + "Lo " + WriteVal ( L ,1.2)+ " • " + "Close " + WriteVal ( C ,1.2)+ " (" + WriteVal ( C - Ref ( C ,-1),1,0)+ " " + WriteVal (( C - Ref ( C ,-1))*100/ Ref ( C ,-1),1.1)+ "%) • Vol= " + WriteVal ( V ,1.0) + "\n" + EncodeColor ( colorGrey50 )+ "------------------------------------------------------------------------------------------------------------" + "\n" + EncodeColor ( colorGold )+ WriteIf ( Buy , "Signal: Go Long - Entry Price: " + WriteVal ( C )+ " - Traget: " + WriteVal (( BuyPrice -tsl)+ BuyPrice ) + " - StopLoss:" + WriteVal (tsl)+ " " , "" )+ WriteIf ( Sell , "Signal: Go Short - Entry Price: " + WriteVal ( C )+ " - Target: " + WriteVal ((tsl- SellPrice )- SellPrice )+ " - StopLoss:" + WriteVal (tsl)+ " " , "" )+ EncodeColor ( ColorRGB (111,208,255))+ WriteIf (Long AND NOT Buy , "Trade: Long - Entry Price: " + WriteVal (( BuyPrice ))+ " - Profit: " + WriteVal (( C - BuyPrice ))+ " " + EncodeColor ( colorLime )+ "Let your profit runs!" , "" )+ WriteIf (shrt AND NOT Sell , "Trade: Short - Entry Price: " + WriteVal (( SellPrice ))+ " - Profit: " + WriteVal (( SellPrice - C ))+ " - " + EncodeColor ( colorLime )+ "Let your profit runs!" , "" ) + "\n" + EncodeColor ( colorGrey50 )+ "------------------------------------------------------------------------------------------------------------" ); dist = 3* ATR (15); dist1 = 3* ATR (15); for ( i = 0; i < BarCount ; i++ ) { if ( Buy [i] ) { PlotText ( "\nBuy:" + C [ i ] + "\nT= " + (( C [i]-tsl[i])+ C [i]) + "\nSL= " + tsl[i], i, C [ i ]-dist[i], colorBlue , colorGreen ); } if ( Sell [i] ) { PlotText ( "Sell:" + C [ i ] + "\nT= " + ( C [i]-(tsl[i]- C [i])) + "\nSL= " + tsl[i], i, C [ i ]+dist1[i], colorRed , colorGreen ); } } /*Plot Ribbon */ Ribbon1= IIf ( ( C ) >(tsl) , colorWhite , IIf (( tsl )>( C ), colorOrange , colorYellow )); Plot (3, "Ribbon" , Ribbon1, styleOwnScale | styleArea | styleNoLabel ,-0.5,100); _SECTION_END (); _SECTION_BEGIN ( "" ); P1 = Param ( "MA01 Period" , 5, 2, 200 ); P2 = Param ( "MA02 Period" , 10, 2, 200 ); MA01= MA ( C ,P1 ); MA02= MA ( C ,P2 ); RG= IIf (MA01>MA02,MA01-MA02,-(MA02-MA01)); PlotOHLC ( MA02,RG+MA02,MA02,RG+MA02, "" ,23, styleCandle +4096); Plot ( SelectedValue ( C ), "" , IIf ( SelectedValue (MA01)> SelectedValue (MA02),4,34), styleNoLine ); Title = EncodeColor (44)+ Name () + " ( " + Interval (2)+ " ) " + EncodeColor (41 )+ WriteVal ( DateTime (), formatDateTime); _SECTION_END (); |