Bollinger Bånd Afl Amibroker


BOLLINGER BAND OG KROSS OVER SYSTEM for Amibroker (AFL) DEL BEGIN (Bollinger Bands med kryss over og justert strekkode) P ParamField (Prisfelt, -1) Periode Param (korte perioder, 20, 15, 30, 1) Bredde Param Bredde, 2, 1, 10, 1) TopCondBBandTop (P, Periode, Bredde) gtRef (BBandTop (P, Periode, Bredde), - 1) MidCondMA (C, Periode) gtRef (MA (C, Periode) BotCondBBandBot (P, Periode, Bredde) gtRef (BBandBot (P, Periode, Bredde), - 1) UpColorIIf (TopCond OG MidCond, colorTurquoise, colorPink) DownColorIIf (MidCond og BotCond, colorTurquoise, colorPink) PlotOHLC (BBandTop Bredde), BBandTop (P, Periode, Bredde), MA (C, Periode), MA (C, Periode),, UpColor, styleCloudstyleNoLabelstyleNoTitle, Null, Null, Null, -2) PlotOHLC (P, Periode), BBandBot (P, Periode, Bredde), BBandBot (P, Periode, Bredde),, DownColor, StyleCloudstyleNoLabelstyleNoTitle, Null, Null, Null, -2) Plot (BBandBot (P, Periode, Bredde) ,, colorGreen, styleThickstyleNoTitle, Null, Null, Null, -1) Plot (BBandTop (P, Periode, Bredde) ,, colorRed, styleThickstyleNoTitle, Null, Null, Null, -1) Plot (MA (C, Periode) ,, colorLime, styleThickstyleNoTitle, Null, Null, Null, -1) FilterTopCond og MidCond og BotCond AddColumn (V, volum, 1,0 ) SECTION BEGIN (Pris) SetChartOptions (0, chartShowArrowschartShowDates) N (Tittel StrFormat (- Åpne g, Hei g, Lo g, Lukk g (.1f) Vol SkrivVal (V, 1.0), O, H, L, C, SelectedValue ROC (C, 1))) trendup IIf (MACD (12,26) gt 0 og MACD (12,26) gt Signal (12,26,9), colorBlue, colorWhite) trendfarve IIf (MACD (12,26) lt 0 og MACD (12,26) lt Signal (12,26,9), colorRed, trendup) Plot (C, Lukk, trendcolor, stilBar styleThick) RSIup RSI (7) gt 70 RSIdown RSI (7) lt 30 sp Param (RSI-periode, 7, 1, 100) r RSI (sp) RSIup r gt 70 RSIdown r lt 30 form RSIup formNone RSIdown formNone PlotShapes (form, IIf (RSIup, colorBrightGreen, colorRed), 0, IIf (RSIup, Lav, Høy )) hvis (ParamToggle (Tooltip viser, Alle verdier bare priser)) ToolTipStrFormat (Åpne: GnHigh: gnLow: gnClose: g (.1f) nVolume: Num ToStr (V, 1), O, H, L, C, SelectedValue (ROC (C, 1))) Seksjon End () SetChartBkColor (ParamColor (Panelfarge, Farge Svart)) PlotOHLC (Åpne, Høy, Lav, Lukk, (L, 20) 2 ATR (10)) ExitSignal C lt (HHV (H, 20) - 2 ATR (10)) Farge IIf (EntrySignal, colorBlue, IIf ExitSignal, colorOrange, colorGrey50)) TrailStop HHV (C - 2 ATR (10), 15) ProfitTaker EMA (H, 13) 2 ATR (10) plot prisdiagram og stopper Plot (TrailStop, Trailing stop, colorGold, stilThick styleLine) Plot (C, Pris, farge, styleBar) plottfargebånd Plot (2,, Farge, styleArea styleOwnScale styleNoLabel, -0,1, 50) GJENNOMFØRINGSBEGIN (GFX EMA) prosedyre Plotlinebredde (pvalue, ptitle, pcolor, pstyle, pmin, pmax, pxshift, plenwidth, pshowdate8203) lokal pvalue, ptitle, pcolor, pstyle, pmin, pmax, pxshift, plinebredde, ppenstyle, pshowdate lokal Miny, Maxy lokal Lvb, fvb lokal pxbredde, pxheight lokal TotalBars, akselområde lokal i, x, y hvis (plinewidthgt0 er px Status (handling) 1 ampamp (pstyle amp styleLinestyleLine)) GfxSetOverlayMode (0) MinyStatus (axisminy) MaxyStatus (axismaxy) lvbStatus (lastvisiblebar) fvbStatus (firstvisiblebar) pxwidthStatus (pxwidth) pxheightStatus (pxheight) TotalBarsLvb-fvb xaxisarea56 if (pshowdate) yaxisarea10 ellers yaxisarea0 i0 x5i (pxwidth-xaxisarea-10) (TotalBars1) y5yaxisarea (pvalueifvb-Miny) (pxheight-yaxisarea-10) (Maxy-Miny) GfxMoveTo (x, pxheight-y) for (i1 iltTotalBars AND ilt (BarCount-fvb ) i) GfxSelectPen (pxheight-yaxisarea-10) (Maxy-Miny) GfxLineTo (x, pxheight-y) RequestTimedRefresh (pxheight-yaxisarea-10) (pxwidth-xaxisarea-10) (TotalBars1) y5yaxisarea (pvalueifvb-Miny) (2), DELTID () DELBEGIN (små utløsere) p1 Param (TL 1 Perioder, 20, 5, 50, 1) p2 Param (TL 2 Perioder, 5, 3, 25, 1) TL1 LinearReg (C, p1) TL2 EMA (TL1, P2) Col1 IIf (TL1 gt TL2, ParamColor (TL Up Color, colorBrightGreen), ParamColor (TL Dn Color, colorCustom12)) Plot (TL1, TriggerLine 1, Col1, styleLinestyleThickstyleNoLabel) Plot (TL2 , TriggerLine 2, Col1, styleLinestyleThickstyleNoLabel) Seksjon END () SECTIONBEGIN (Large Triggers) p3 Param (TL 3 Perioder, 80, 5, 100, 1) p4 Param (TL 4 Perioder, 20, 3, 100, 1) TL3 LinearReg , P3) TL4 EMA (TL3, p4) Col1 IIf (TL3 gt TL4, ParamColor (TLL Up Color, colorBlue), ParamColor (TLL Dn Color, colorRed)) Plot (TL3, TriggerLine 3, Col1, styleLinestyleThickstyleNoLabel) Plot (TL4, TriggerLine 4, Col1, styleLinestyleThickstyleNoLabel) AVSNITT END () DELBEGIN (Fibo Retrace and Extensions) fib ParamToggle (Plot Fibs, OffOn, 1) pctH Param (Pivot Hei, 0.325,0.001,2.0,0.002) HiLB Param (Hei LookBack, 1,1 , BarCount-1,1) pctL Param (Pivot Lo, 0.325,0.001,2.0,0.002) LoLB Param (Lo Lookback, 1,1, BarCount-1,1) Tilbake Param (Forleng venstre 2,1,1,500,1) Fwd Param (Plot Forward, 0, 0, 500, 1) tekst ParamToggle (Plot Text, OffOn, 1) hts Param (Text Shift, -33,5, -50,50,0,10) stil ParamStyle (Linjestil, styleLine, styleNoLabel) x BarIndex () pRp PeakBars (H, pctH, 1) 0 yRp0 SelectedValue (ValueWhen (pR p, H, HiLB)) xRp0 SelectedValue (ValueWhen (pRp, x, HiLB)) pSp TroughBars (L, pctL, 1) 0 ySp0 SelectedValue (ValueWhen (pSp, L, LoLB)) xSp0 SelectedValue (ValueWhen (pSp, x, LoLB)) Delta yRp0 - ySp0 funksjonsfibre (ret) retval (Delta ret) Fibval ​​IIf (ret l 1.0 og xSp0 lt xRp0, yRp0 - retval, IIf (retl 1.0 og xSp0 gt xRp0, ySp0 retval, IIf (ret gt 1,0 Og xsp0 lt xRp0, yRp0 - retval, IIf (ret gt 1.0 og xSp0 gt xRp0, ySp0 retval, null))) returnere FibVal x0 Min (xSp0, xRp0) - Back x1 (BarCount -1) r236 fib (0.236) r236I LastValue (r050,1) r618 fi (0.618) r618I LastValue (r618,1) r786 fib (0.786) r786I LastValue (r08,1) (e262,1) e200 fib (2.00) e200I LastValue (e200,1) e262 fib (2.62) e262I LastValue (e262, e262i) 1) e424 fib (4.24) e424I LastValue (e424,1) p00 IIf (xSp0 gt xRp0, ySp0, yRp0) p00I LastValue (p00,1) p100 IIf (xSp0 lt xRp0, ySp0, yRp0) p100I LastValue (p100,1) color00 IIf (xSp0 gt xRp0, colorLime, colorRed) color100 IIf (xSp0 lt xRp0, colorLime, colorRed) numbars LastValue (Cum (Status (barvisible))) fraksjon IIf StrRight (Name (), 3), 3.2, 3.2) hvis (fibs1) Plot (LineArray (xRp0-Fwd, yRp0, x1, yRp0, Tilbake), PR, 32,8styleNoRescale, Null, Null, Fwd) Plot (LineArray xSp0-Fwd, ySp0, x1, ySp0, Tilbake), PS, 27,8styleNoRescale, Null, Null, Fwd) Plot (LineArray (x0-Fwd, r236, x1, r236, Tilbake) ,, 45, stilstilNoRescale, Null, Null , Fwd) Plot (LineArray (x0-Fwd, r382, x1, r382, Tilbake) ,, 44, stilstilNoRescale, Null, Null, Fwd) Plot (LineArray (x0-Fwd, r050, x1, r050, Tilbake) ,, 41 , StylestyleNoRescale, Null, Null, Fwd) Plot (LineArray (x0-Fwd, r618, x1, r618, Tilbake) ,, 43, stilstilNoRescale, Null, Null, Fwd) Plot (LineArray (x0-Fwd, r786, x1, r786 , Back) ,, 42, stilstilNoRescale, Null, Null, Fwd) Plot (LineArray (x0-Fwd, e127, x1, e127, Tilbake), e127,47, stilstilNoRescale, Null, Null, Fwd) Fwd, e162, x1, e162, Tilbake), e162,47, stilstilNoRescale, null, null, FWD) Plot (LineArray (x0-Fwd, e200, x 1, e200, tilbake), p200,47, stilstilNoRescale, null, null, FWD) Plot (LineArray (x0-Fwd, e262, x1, e262, tilbake), p262,47, stilstilNoRescale, null, null, FWD) LineArray (x0-Fwd, e424, x1, e424, Tilbake), p424,25, stilstilNoRescale, null, null, FWD) hvis (tekst1) PlotText (0 WriteVal (p00, brøkdel), LastValue (BarIndex ()) - (numbarshts ), p00I 0,05, color00) PlotText (23 WriteVal (r236, brøkdel), LastValue (BarIndex ()) - (numbarshts), r236I 0.05, 45) PlotText (38 WriteVal (r382, brøkdel), LastValue (BarIndex ()) - (Numbarshts), r382I 0.05, 44) PlotText (50 WriteVal (r050, brøkdel), LastValue (BarIndex ()) - (numbarshts), r050I 0.05, 41) PlotText (62 WriteVal (r618, brøkdel), LastValue (BarIndex () ) - (numbarshts), r786i 0.05, 42) PlotText (100 WriteVal (p100, fraksjon), LastValue (BarIndex) PlotText (127 WriteVal (e127, fraksjon), LastValue (BarIndex ()) - (numbarshts), e127I 0.05, 47) PlotText () PlotText (200 WriteVal (e200, brøkdel), LastValue (BarIndex ()) - (numbarshts), e200I 0.05, 47) PlotText (424 WriteVal (e424, brøkdel), LastValue (BarIndex ()) - (numbarshts), e424I 0,05, 25) Seksjonsendring () Kode for å automatisk identifisere svingninger - hva vil være vårt lookback-område for hh og ll farbackParam (Hvor langt tilbake å gå, 100,50,5000,10) nBars Param (Antall barer, 12, 5, 40) Tittelnavn () (StrLeft (FullName (), 15)) O: Åpen, H: Høy, L: Lav, C: Lukk - Plott grunnleggende lysdiagram PlotOHLC (Åpne, Høy, Lav, Lukk, N OO nH H nL Lørdag 25, 2011 VIKTIG: Ikke bruk indikatoren i et ekte handelssystem, det ser fremover i tid og vil gjøre deg tapt. Det er kun ment for forskning: å vise potensiell fortjeneste og vise piler på svært lønnsomme stillinger for å legge til rette for å formulere bedre handelsregler. Indikatoren som presenteres her, ligner veldig ZigZag-indikatoren, bortsett fra at vinkelpunkter for denne indikatoren er hvor de motsatte Bollinger-båndene brytes sist før neste signal. Formelen er skrevet som et handelssystem. Det kan være Backtested, og BB-perioden og bredden kan optimaliseres. Siden dette bare er en eksperimentell formel, er det ikke gjort noe forsøk på å optimalisere koden. Filed by Herman at 8:43 pm under Indicators Comments Off på Bollinger Band ZigZag Indicator Kommentarer er stengt. Siste innlegg Siste kommentarer Kategorier Copyright (C) 2006 AmiBroker. Dette nettstedet bruker WordPress Page generert på 0.535 sekunder. . Amibroker Trading Systems - Koding Et Bollinger Band Breakout System: 29. 2013 . Se hele leksjonen og flere Amibroker leksjoner her: asxmarketwatch201206. Denne Amibroker-leksjonen om koding av et handelssystem er basert på et Bollinger Band breakout trading system, denne spesielle ble berømt av den mesterlige australske handelsmannen Nick Radge i sin bok Holy Grails. Nick er en absolutt stand-up fyr som enhver australsk handelsmann eller investor vil fortelle deg, og jeg anbefaler hans bok og hans tjeneste på The Chartist. Bollinger Band breakout-systemet er dessuten ganske enkelt å kode i Amibroker Formula Language (AFL), selv for en ekstremt nybegynner deltidskoder som meg selv. Selvfølgelig på grunn av det, er det bare veldig grunnleggende kode med ingen av klokkene eller fløyter som andre mer erfarne forhandlere kan legge til. Det gir noen solide resultater i back-testing.

Comments

Popular Posts