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 ....
Lemenchus with target and stoploss for Amibroker (AFL)
Rating:
3 / 5 (Votes 7)
Tags:
amibroker, stop loss
Works fine for intraday in all TF. Enjoy
Similar Indicators / Formulas
DODA BAND BUY SELL
Submitted
by saas almost 12 years ago
JMA Stoploss
Submitted
by kuzukapama over 13 years ago
TSL & HL & New
Submitted
by morgen almost 13 years ago
Stop Loss Indicator
Submitted
by nabcha almost 15 years ago
ABKP Benchmark Bar
Submitted
by amitabh almost 15 years ago
Indicator / Formula
Copy & Paste Friendly
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 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 | _SECTION_BEGIN ( "Price" ); SetChartOptions (0, chartShowArrows | chartShowDates ); SetBarsRequired ( sbrAll , sbrAll ); SetBarFillColor ( IIf ( C > O , ParamColor ( "Candle Up Color" , colorBrightGreen ), IIf ( C <= O , ParamColor ( "Candle Down Color" , colorRed ), colorLightGrey ))); Plot ( C , "Price" , IIf ( C > O , ParamColor ( "Shadow Up Color" , colorBlack ), IIf ( C <= O , ParamColor ( "Shadow Down Color" , colorBlack ), colorLightGrey )),64,0,0,0,0); SetChartBkColor ( ParamColor ( "Panel Color " , colorLightGrey )); SetChartBkGradientFill ( ParamColor ( "Upper Chart" , colorLightGrey ), ParamColor ( "Lower Chart" , colorLightGrey )); GraphXSpace = Param ( "GraphXSpace" ,20,-10,25,1); _SECTION_BEGIN ( "Raghee Horner's EMA's" ); EMA1 = EMA ( H ,34); EMA2 = EMA ( L ,34); EMA3 = EMA ( C ,34); Plot ( EMA1, "EMA1" , ParamColor ( "Color1" , colorRed ), ParamStyle ( "Style" , styleDashed | styleThick ) | styleNoRescale ); Plot ( EMA2, "EMA2" , ParamColor ( "Color2" , colorGreen ), ParamStyle ( "Style" , styleDashed | styleThick ) | styleNoRescale ); Plot ( EMA3, "EMA3" , ParamColor ( "Color3" , colorBlue ), ParamStyle ( "Style" , styleDashed | styleThick ) | styleNoRescale ); _SECTION_END (); _SECTION_BEGIN ( "Supertrend" ); procedure calcTrend_proc(ATR_Period,tr,ATR_Multiplier,TrendMode,CalcPrice) { global buffer_line_down; global buffer_line_up; buffer_line_down = Null ; buffer_line_up = Null ; PHASE_NONE = 0; PHASE_BUY = 1; PHASE_SELL = -1; phase=PHASE_NONE; band_upper = 0;band_lower = 0; for (i = ATR_Period + 1; i < BarCount ; i++) { band_upper = CalcPrice[i] + ATR_Multiplier * tr[i]; band_lower = CalcPrice[i] - ATR_Multiplier * tr[i]; if (phase==PHASE_NONE) { buffer_line_up[i] = CalcPrice[i]; buffer_line_down[i] = CalcPrice[i]; } if (phase!=PHASE_BUY && Close [i]>buffer_line_down[i-1] && ! IsEmpty (buffer_line_down[i-1])) { phase = PHASE_BUY; buffer_line_up[i] = band_lower; buffer_line_up[i-1] = buffer_line_down[i-1]; } if (phase!=PHASE_SELL && Close [i]<buffer_line_up[i-1] && ! IsEmpty (buffer_line_up[i-1])) { phase = PHASE_SELL; buffer_line_down[i] = band_upper; buffer_line_down[i-1] = buffer_line_up[i-1]; } if (phase==PHASE_BUY && ((TrendMode==0 && ! IsEmpty (buffer_line_up[i-2])) || TrendMode==1) ) { if (band_lower>buffer_line_up[i-1]) { buffer_line_up[i] = band_lower; } else { buffer_line_up[i] = buffer_line_up[i-1]; } } if (phase==PHASE_SELL && ((TrendMode==0 && ! IsEmpty (buffer_line_down[i-2])) || TrendMode==1) ) { if (band_upper<buffer_line_down[i-1]) { buffer_line_down[i] = band_upper; } else { buffer_line_down[i] = buffer_line_down[i-1]; } } } } TrendMode = ParamToggle ( "TrendMode" , "Off|On" ,1); ATR_Multiplier = Param ( "ATR_Multiplier" ,2,0.1,10,0.1); ATR_Period = Param ( "ATR_Period" ,5,1,20,1); tr = ATR (ATR_Period); CalcPrice = ( H + L )/2; calcTrend_proc(ATR_Period,tr,ATR_Multiplier,TrendMode,CalcPrice); Plot (buffer_line_up, "\ntu" , ColorRGB (28,134,238), styleThick ); Plot (buffer_line_down, "\ntd" , ColorRGB (205,51,51), styleThick ); Plot ( 2, "" , IIf (buffer_line_up, colorGreen , colorBlack ), styleOwnScale | styleArea | styleNoLabel , -0.5, 100 ); Plot ( 4, "" , IIf (buffer_line_down, colorRed , colorBlack ), styleOwnScale | styleArea | styleNoLabel , -0.5, 100 ); _SECTION_END (); TimeFrameSet ( inDaily ); DayHigh = LastValue ( H ); DayLow = LastValue ( L ); TimeFrameRestore (); Title = Date () + ", Op=" + Open + ", Hi=" + High + ", Lo=" + Low + ", LTP=" + Close + ", Change= " + SelectedValue ( ROC ( C , 1 ) ) + "%" + "\n Today`s High=" + DayHigh + ", Today`s Low=" + DayLow + " © " ; prev= AMA2 ( C ,1,0); d= IIf ( C > Ref ( Max ( Max ( H , Ref ( H ,-20)), Max ( Ref ( H ,-10), Ref ( H ,-15))),-1), Min ( Min ( L , Ref ( L ,-20)), Min ( Ref ( L ,-10), Ref ( L ,-15))), IIf ( C < Ref ( Min ( Min ( L , Ref ( L ,-20)), Min ( Ref ( L ,-10), Ref ( L ,-15))),-1), Max ( Max ( H , Ref ( H ,-20)), Max ( Ref ( H ,-10), Ref ( H ,-15))),PREV)); a= Cross ( Close ,d); b= Cross (d, Close ); state= IIf ( BarsSince (a)< BarsSince (b),1,0); s=state> Ref (state,-1); ss=state< Ref (state,-1); sss=state== Ref (state,-1); col= IIf (state == 1 ,51, IIf (state ==0,4,1)); Plot ( C , "" ,Col,64); Buy = s; Sell = ss; shape = Buy * shapeUpArrow + Sell * shapeDownArrow ; PlotShapes (shape, IIf ( Buy , colorGreen , colorRed ), 0, IIf ( Buy , Low , High )); PlotShapes ( IIf ( Buy , shapeSquare , shapeNone ), colorGreen , 0, L , Offset=-10); PlotShapes ( IIf ( Buy , shapeSquare , shapeNone ), colorLime , 0, L , Offset=-20); PlotShapes ( IIf ( Buy , shapeUpArrow , shapeNone ), colorWhite , 0, L , Offset=-15); PlotShapes ( IIf ( Sell , shapeSquare , shapeNone ), colorRed , 0, H , Offset=20); PlotShapes ( IIf ( Sell , shapeSquare , shapeNone ), colorOrange , 0, H , Offset=30); PlotShapes ( IIf ( Sell , shapeDownArrow , shapeNone ), colorWhite , 0, H , Offset=-25); //WriteIf(s,"EXIT all Short positions\nif trading long positions, enter long Now-\nOR at the market price on tomorrow's Open with stop="+EncodeColor(4)+WriteVal(L+.75*ATR(5),1.4)+" ,",""); //WriteIf(ss,"exit all long positions today with a Market On Close (MOC) order\nOR at the market price on tomorrow's Open with stop="+EncodeColor(4)+WriteVal(Ref(H+.75*ATR(5), -1),1.4)+",",""); //WriteIf( sss ,"No trading signals today.","") ; dist = 2* ATR (10); dist1 = 5* ATR (10); for ( i = 0; i < BarCount ; i++ ) { if ( Buy [i] ) { PlotText ( "\nBuy:" + L [ i ] + "\nT= " + ( L [i]*1.005) + "\nSL= " + ( L [i]*0.9975), i, L [ i ]-dist[i], colorGreen , colorWhite ); } if ( Sell [i] ) { PlotText ( "Sell:" + H [ i ] + "\nT= " + ( H [i]*0.995) + "\nSL= " + ( H [i]*1.0025), i, H [ i ]+dist1[i], colorRed , colorWhite ); } } Filter = s OR sss OR sss ; AddColumn ( C , "close" ,1.2); AddColumn ( IIf ( s, 66,1 ), "buy" , formatChar, 1, bkcolor = IIf (s, colorYellow , colorPink )); AddColumn ( IIf ( Ss, 83,1 ), "sell" , formatChar, 1, bkcolor = IIf (Ss, colorPink , colorWhite )); AddColumn ( IIf ( sss, 87,1 ), "wait" , formatChar, 1, bkcolor = IIf (sss, colorYellow , colorRed )); _SECTION_BEGIN ( "trend" ); uptrend= PDI (20)> MDI (10) AND Signal (29)< MACD (13); downtrend= MDI (10)> PDI (20) AND Signal (29)> MACD (13); Plot ( 2, /* defines the height of the ribbon in percent of pane width */ "ribbon" , IIf ( uptrend, colorGreen , IIf ( downtrend, colorRed , 0 )), /* choose color */ styleOwnScale | styleArea | styleNoLabel , -0.5, 100 ); _SECTION_END (); Buy = s AND a AND uptrend ; Short = ss AND b AND downtrend ; Sell = ss AND b AND downtrend ; Cover = s AND a AND uptrend ; Buy = ExRem ( Buy , Sell ); Sell = ExRem ( Sell , Buy ); Cover = ExRem ( Cover , Short ); Short = ExRem ( Short , Cover ); Filter = Buy OR Sell ; Filter = Cover OR Short ; AddColumn ( Buy , "Buy" , 1); AddColumn ( Sell , "Sell" , 1); AddColumn ( Close , "Close" ,1.2); AddColumn ( Volume , "Volume" ,1.0); // Plot the Buy and Sell arrows. shape = Buy * shapeUpArrow + Sell * shapeDownArrow ; PlotShapes ( IIf ( Buy , shapeSquare , shapeNone ), colorGreen , 0, L , Offset=-10); PlotShapes ( IIf ( Buy , shapeSquare , shapeNone ), colorLime , 0, L , Offset=-20); PlotShapes ( IIf ( Buy , shapeUpArrow , shapeNone ), colorWhite , 0, L , Offset=-15); PlotShapes ( IIf ( Sell , shapeSquare , shapeNone ), colorRed , 0, H , Offset=20); PlotShapes ( IIf ( Sell , shapeSquare , shapeNone ), colorOrange , 0, H , Offset=30); PlotShapes ( IIf ( Sell , shapeDownArrow , shapeNone ), colorWhite , 0, H , Offset=-25); //_SECTION_BEGIN("Background text"); C13= Param ( "fonts" ,20,10,30,1 ); C14= Param ( "left-right" ,2.1,1.0,5.0,0.1 ); C15= Param ( "up-down" ,12,1,20,1 ); Miny = Status ( "axisminy" ); Maxy = Status ( "axismaxy" ); lvb = Status ( "lastvisiblebar" ); fvb = Status ( "firstvisiblebar" ); pxwidth = Status ( "pxwidth" ); pxheight = Status ( "pxheight" ); GfxSetBkMode (transparent=1); GfxSetOverlayMode (1); GfxSelectFont ( "Tahoma" , Status ( "pxheight" )/C13 ); GfxSetTextAlign ( 6 ); GfxSetTextColor ( ColorRGB (217,217,213)); GfxTextOut ( Name (), Status ( "pxwidth" )/C14, Status ( "pxheight" )/C15 ); GfxSelectFont ( "Tahoma" , Status ( "pxheight" )/C13*0.5 ); GfxSetTextColor ( ColorRGB (103,103,103)); GfxTextOut ( "Kailash Pareek" , Status ( "pxwidth" )/C14, Status ( "pxheight" )/C15*2.5 ); GfxSelectFont ( "Tahoma" , Status ( "pxheight" )/C13*0.5 ); GfxSetTextColor ( ColorRGB (103,103,103)); GfxTextOut ( "Kailash Pareek" , Status ( "pxwidth" )/C14, Status ( "pxheight" )/C15*4 ); GfxSelectFont ( "MS Sans Serif" , 10, 500, False , False , 0); |
20 comments
Leave Comment
Please login here to leave a comment.
Back
Sell = High
Buy = Low
Super system!!!
Getting Error 16… too many arguments… on line 4
jest alter like this
Plot(C,“Price”,IIf(C>O,ParamColor(“Shadow Up Color”, colorBlack),IIf(C<=O,ParamColor(“Shadow Down Color”, colorBlack),colorLightGrey)),64,0,0,0);
EXCELLENT..SUPER.. MUST TRY ONCE (MY RATING IS 4 STAR)
BE CAREFUL
this line
buffer_line_up[i] = buffer_line_up[i-1];
repaint the past
Nice system but i don’t know any one person who buy at low and sell at high if any one know a person then tell me how
error inline 5
nice system thanks
The only error is on line 5 which has one more additional ‘0’ as an argument in the end.
Plot(C,“Price”,IIf(C>O,ParamColor(“Shadow Up Color”, colorBlack),IIf(C<=O,ParamColor(“Shadow Down Color”, colorBlack),colorLightGrey)),64,0,0,0,0);
Just delete one of the last 0 from the end of this line & code becomes good.
nice one
i am getting error saying that sbrall used witout having been initialized….
johnnypareek
only adding buy , sell along with stoploss and target in raghee horner indicator. jhonny did you wrote the afl or copied from some one else?
jparekh
Late signals, Targets are megre. Needs to be improved
viswanath
@jparekh
It seems you sell something. Who care its mine or not, thing is ppls are benefited or not. Don’t bother. No one need to know this. Just use it or get lost.
JOHNY SIR
REALLY GOOD INDICATOR…. THANKS A LOT
Work correcly at variouse Tf. Thanks!
thanks chanramohan , brockqaw
Thanks
Nothing Comes, When Price is eg. 345, it says to buy @ 341.5 for a target of 343.5 …. good joke.
Hi,
Please need one help, i am facing error 29
SetBarsRequired(sbrAll,sbrAll); // main command ;
ln 4, Col:23: Error 29. Variable ‘sbrAll’ used without having been initialized.
ln 4, Col:30: Error 29. Variable ‘sbrAll’ used without having been initialized.
I am not aware of terms, so please explain with example and in simple way.
I have amibroker 5.0
This error i face in many AFL and i m quite upset.