Stock Portfolio Organizer
The ultimate porfolio management solution.
WiseTrader Toolbox
#1 Selling Amibroker Plugin featuring:
Swing Trading ST for Amibroker (AFL)
Hello Everone,
This concept was discussed on Traderji by Smart_Trader
and this concept is coded By Edward Pottasch
Many Many Thanks to Edward Pottasch , for taking out his precious time and coded this concept
for Details about this concept check this
http://www.traderji.com/day-trading/49521-thoughts-day-swing-trading.html
Indicator / Formula
// Edward Pottasch 24dec2014 SetBarsRequired(sbrAll,sbrAll); xx=BarIndex();x=xx;Lx=LastValue(x); rightStrength=Optimize("R_S",Param("R_S",3,1,50,1) ,1,50,1); leftStrength=Optimize("L_S",Param("L_S",3,1,50,1), 1,50,1); function pkID(rightStrength,leftStrength) { pk=H>Ref(HHV(H,leftStrength),-1) AND H>=Ref(HHV(H,rightStrength),rightStrength); return pk; } function trID(rightStrength,leftStrength) { tr=L<Ref(LLV(L,leftStrength),-1) AND L<=Ref(LLV(L,rightStrength),rightStrength); return tr; } pk=pkID(rightStrength,leftStrength); tr=trID(rightStrength,leftStrength); SetChartBkColor(ColorRGB(0,0,0));SetChartOptions(0 ,chartShowDates); SetBarFillColor(IIf(C>O,colorGreen,IIf(C<=O,colorR ed,colorLightGrey))); Plot(C,"Price",IIf(C>O,colorDarkGreen,IIf(C<=O,col orDarkRed,colorLightGrey)),64,null,null,0,0,1); PlotShapes(shapeSmallCircle*tr,IIf(Lx-ValueWhen(tr,x)>rightStrength,ColorRGB(0,100,0),co lorWhite),0,L,-10); PlotShapes(shapeSmallCircle*pk,IIf(Lx-ValueWhen(pk,x)>rightStrength,ColorRGB(255,0,0),co lorWhite),0,H,10); pkHigh1=Ref(ValueWhen(pk,H,1),-(rightStrength+1)); trLow1=Ref(ValueWhen(Tr,L,1),-(rightStrength+1)); pkHigh0=ValueWhen(pk,H,0); trLow0=ValueWhen(Tr,L,0); upGap=Cross(C,pkHigh1) AND pkHigh1<trLow0; dnGap=Cross(trLow1,C) AND trLow1>pkHigh0; gapBaseUp=ValueWhen(upGap,pkHigh1); gapBaseDn=ValueWhen(dnGap,trLow1); gapExtrUp=ValueWhen(upGap,trLow0); gapExtrDn=ValueWhen(dnGap,pkHigh0); upGapArea=Flip(upGap,dnGap); dnGapArea=Flip(dnGap,upGap); gapBase=IIf(upGapArea,gapBaseUp,gapBaseDn); gapExtr=IIf(upGapArea,gapExtrUp,gapExtrDn); Plot(pkHigh1,"",colorBlue,24,Null,Null,0,2,1); Plot(trLow1,"",colorRed,24,Null,Null,0,2,1); Plot(gapBase,"",colorlightgrey,styledashed,Null,Nu ll,0,2,1); Plot(gapExtr,"",colorlightgrey,styledashed,Null,Nu ll,0,2,1); PlotOHLC(gapBase,gapBase,gapExtr,gapExtr,"",IIf(ga pExtr>gapBase,colorseaGreen,colorOrange),styleClou d|styleNoRescale,Null,Null,0,-1,1); strWeekday = StrMid("SunMonTueWedThuFriSat", SelectedValue(DayOfWeek())*3,3); Title = EncodeColor(colorWhite)+ "Gap _ST style by Edward.P" + " - " + Name() + " - "+ "" + fullName() + " " + EncodeColor(colorRed)+ Interval(2) + EncodeColor(colorWhite) +" - " + Date() + " # "+strWeekday + StrFormat("\nOp %g, Hi %g, Lo %g, Cl %g, Vol %g", O, H, L, C, V)+ "\nRight Bars: " + rightStrength + "\nLeft Bars : " + leftStrength; //============================================
13 comments
Leave Comment
Please login here to leave a comment.
Back
please give the link again because above link broken
7 syntax error ab 5.91 lines 22-27
error due to older version of Amibroker
Try this
23 remove space red
24 remove space color
thank you working fine
Extra spaces, corrected version placed in [Pastie] section.
No need to use Above formula ,
As updated version of this concept is posted
Here…
Please provide the correct Trader ji link.
Thanks in advance
@ Casoni,
Is there is anyway by which we can add the buy and sell signal in it ??
Thanks in advance
this formula look into the future.
before:
after:
you can’t always immediately say that a code looks into the future without understanding the code. Fractal type pivots always look into the future. That is why you need to wait until a pivot is completed before you can use it. Fractal type pivots are used to bring some structure in the price movement but you can’t buy/short at a fractal low or high as shown in the chart (unless you get lucky). Before a pivot is confirmed you always have to wait rightstrength + 1 bars.
here some code that adds signals (you can also toggle to system type signals):
http://wisestocktrader.com/indicatorpasties/1434-gapfill3b
Mr Pottasch very solid idea, best programmer,i am a big fan, keep up your get work thanks, wishing you and yours a happy and healthy New Years
try this: