SECTION BEGIN (quotSDA2 Channel Trading System ver 2.0quot) SetChartOptions (0, chartShowArrowschartShowDates) trailing0 N (Titel StrFormat (quot - Öppet g, Hej g, Lo g, Stäng g (.1f) quot, O, H, L, C, SelectedValue (ROC (C, 1)))) SetTradeDelays (1, 1, 1, 1) KöpPris Öppna SäljPris Öppna DerivedWMA (WMA (WMA ((HL) 2) (OC), 2), 2), 2) IWMA Avledad, 3) Övre (DerivedStDev (Derived, 7)) ATR (2) 1.5 Nedre (Derived-StDev (Derived, 7)) - ATR (2) 1 colorIIf (C, kvot, färg, 64) Plot (Upper, quotupper bandquot, colorGreen) Plot (Lower, quotlower bandquot, colorDarkRed) Köp eller sälj villkor Köp Cross (Stäng, Övre) Sälj Kors (Nedre, Låg) Köp ExRem (Köp, Sälj) Sälj ExRem (Sälj, Köp) CoverBuy ShortSell Filter Köp eller Sälj Exploration Parametrar AddTextColumn (FullName (), quotCompany Namequot) AddColumn (Köp, quotBuyquot, 1) AddColumn quotSellquot, 1) AddColumn (C, quotClosequot, 1,3) AddColumn (H, quotHighquot, 1,3) Lägg till Kolumn (Lower, quotLower Bandquot, 1.3) AddColumn (Upper, quotUpper Bandquot, 1.3) PlotShapes (IIf (Köp, shapeSquare, shapeNone), colorGreen, 0, L, Offset-40) PlotShapes (IIf (Köp, shapeSquare, shapeNone) PlotShapes (IIf (Köp, shapeUpArrow, shapeNone), colorWhite, 0, L, Offset-45) PlotShapes (IIf (Sälj, shapeSquare, shapeNone), colorRed, 0, H, Offset40) PlotShapes (IIf (Sälj, shapeSquare, shapeNone), colorOrange, 0, H, Offset50) PlotShapes (IIf (Sälj, shapeDownArrow, shapeNone), colorWhite, 0, H, Offset-45) SECTIONBEGIN (quotWaterMarkquot) GfxSetOverlayMode (1) GfxSelectFont quotTahomaquot, Status (quotpxheightquot) 12) GfxSetTextAlign (6) centruminriktning GfxSetTextColor (ColorHSB (42, 42, 42)) GfxSetBkMode (0) transparent GfxTextOut (quotBudget 2012quot, Status (quotpxwidthquot) 4, Status (quotpxheightquot) 4) Du kan ändra ditt eget visningsnamn GfxSelectFont (quotTahomaquot, Status (quotpxheightquot) 12) GfxTextOut (quot traderjiquot, Status (quotpxwidthquot) 4, Status (quotpxheig htquot) 490) Du kan ändra ditt eget visningsnamn SECTIONEND () synchParamToggle (quotSynch med Indexquot, quotNoYesquot, 0) VrParamList (quotIndex till Synchquot, List quotNSEI, NSEBANK, CNXIT, NSMIDCP, RELIANCE. NS, SBIN. NSquot, 0) SECTIONBEGIN (quotPL SettingsQuot) PerctakeProfitParam (quotTake Profitprocent, 0,65,0,3,30,0,1) PercStoplossParam (quotStopLoss Procent, 0,8,0,2,5,0,1) trades1Param (quotTrade Abovequot, 1,1,10,1) riskAmountParam (quotRisk Belopp, 240 200 , 10000,100) SEKTIONBEGIN (quotTrade Variablesquot) VolminParam (quotVolume Minquot, 0,0,10000000,50) VolmaxParam (quotVolume Maxquot, 10000000,0,10000000,50) priceRLParam (quotPrice Range Minquot, 15,1,20000,1) priceRHParam (quotPrice Range Maxquot, 20000,1,20000,1) PercChangeminParam (quotPercentage Change Min setquot, -50, -100, 100, 0,1) PercChangemaxParam (quotPercentage Ändra Max setquot, 50, -100, 100, 0,1) Programmet beräknar och visar olika prisvärden i realtid dagens öppet förflutet dag hög prioritet dag låg före dagen öppen Förra dagen Stäng Förra dagen Medel dag 1015 Hög dag 1015 Låg PlotOHLC (Öppna, Hög, Låg, Stäng, Kvot, ColorWhite, StyleCandle) Stänger 0 xpdh 90 SEKTIONSBEGIN (quotSARquot) acc Param (quotAccelerationquot, 0,02, 0, 1, 0.001) accm param (quotMax. accelerationquot, 0.2, 0, 1, 0.001) Plot (SAR (acc, accm), DEFAULTNAME (), ParamColor (quotcolorquot, colorBlack), ParamStyle (quotStylequot, styleDots styleNoLine, maskDefault styleDots styleNoLine)) AVSNITT END () SECTIONBEGIN (quotSMAquot) P ParamField (quotPrice fieldquot, -1) Period Param (quotPeriodsquot, 20, 2, 300, 1, 10) Plot (MA (P, Perioder), DEFAULTNAME (), ParamColor (quotColorquot, colorYellow), ParamStyle (quotStylequot, styleThick)) AVSNITTEND () sluttningar isSlopeUP (MA (P, Perioder) ltL) och Ref (MA (P, Perioder), - 1) gtRef (MA (P, Perioder), - 2) OCH Ref 2) gtRef (MA (P, Perioder), - 3) OCH Ref (MA (P, Perioder), - 3) gtRef (MA (P, Perioder) 4) gtRef (MA (P, Perioder), - 5) OCH Ref (MA (P, Perioder), - 5) gtRef (MA (P, Perioder), - 6) isSopDN (MA (P, Perioder) Ref (MA (P, Perioder), - 1) ltRef (MA (P, Perioder), - 2) OCH Ref (MA (P, Perioder), - 2) ltRef (MA (P, Perioder) Ref (MA (P, Perioder), - 3) ltRef (MA (P, Perioder), - 4) OCH Ref (MA (P, Perioder ), - 4) ltRef (MA (P, Perioder), - 5) OCH Ref (MA (P, Perioder), - 5) ltRef (MA (P, Perioder), - 6) isSpePE (MA (P, Perioder) lt) och ref (MA (P, Perioder), - 1) gtRef (MA (P, Perioder), - 2) OCH Ref (MA (P, Perioder), - 1) gtRef (MA (P, Perioder) 3) och Ref (MA (P, Perioder), - 1) gtRef (MA (P, Perioder), - 4) OCH Ref (MA (P, Perioder) 5) och Ref (MA (P, Perioder), - 1) gtRef (MA (P, Perioder), - 6) IsSpeDN (MA (P, Perioder) ltRef (MA (P, Perioder), - 3) OCH Ref (MA (P, Perioder), - 1) ltRef (MA (P, Perioder), - 4) OCH Ref (MA (P, Perioder), - 1) ltRef (MA (P, Perioder) ltRef (MA (P, Perioder), - 6) Omvandla data till den dagliga PlotRange (TimeNum () gt 95500 OCH TimeNum () lt 153500) OCH (DateNum () LastValue (DateNum ())) FHRange (TimeNum () gt 095500 OCH TimeNum () lt 101459) OCH (DateNum () LastValue (DateNum ())) FHPrices Hög FHRange FHMarker BarsSince (FHRangegt0) Hitta antal staplar på 60 minuter NumBars 3 600 Intervall (1) TimeFrameSet (inDaily) Upp Öppna PDH Ref (High, -1) PDL Ref (Low, -1) PDO Ref (Open, -1) PDC Ref (Stäng, -1) PDM (PDHPDL) 2 TimeFrameRestore ) isAll True isRth TimeNum () gt 095400 OCH TimeNum () lt 101459 isdRth TimeNum () gt 095400 OCH TimeNum () lt 160000 aRthL IIf (isRth, L, 1000000) aRthHIIf (isdRth, H, Null) aRthLd IIf (isdRth, L, 1000000) PDO TimeFrameExpand (PDO, inDaily, expandFirst) PDO TimeFrameExpand (PDO, inDaily, expandFirst) PDC TimeFrameExpand (PDH, inDaily, expandFirst) PDL TimeFrameExpand (PDL, inDaily, expandFirst) PDM TimeFrameExpand TimeFrameExpand (PDM, inDaily, expandFirst) FHL TimeFrameExpand (FHL, inDaily, expandFirst) DayH TimeFrameCompress (aRthH, inDaily, compressHigh) DayH TimeFrameExpand (HHV, HighDrive, NumBars), - FHMarker) FHL TimeFrameCompress (aRthL, inDaily, compressLow) (DayH, inDaily, expandFirst) DayL TimeFrameCompress (aRthLd, inDaily, compressLow) DayL TimeFrameExpand (DayL, inDaily, expandFirst ) Faktor FC1 ((PDH-PDL) 0.433) FC2 (PDH-PDL) 0.7666) FC3 ((PDH-PDL) 1.355) FC4 (FHH-FHL) NU FILTER FÖR ATT FINDA DEN ANVÄNDDA FAKTOREN F11IIf ((FC4ltFC1PDH0.005) , FC1,0) F22IIf ((FC4ltFC2PDH0.005 och FC4gtFC1PDH0.005), FC2,0) F33IIf ((FC4ltFC3 OCH FC4gtFC2PDH0.005), FC3,0) element1IIf (F11gt0, F11,0) element2IIf (F22gt0, F22,0 ) element3IIf (F33gt0, F33,0) AF (F11F22F33) sedan (TimeNum () gt 101459 OCH TimeNum () lt Limit) OCH (DateNum () LastValue (DateNum ())) rangHög-låg nr7sIIf (rangLLV (rang, 7) , formDigit7shapePositionAbove, shapeNone) nr8sIIf (Ref (nr7s, -1) OCH rangLLV (rang, 8), shapeDigit8shapePositionAbove, shapeNone) nr7IIf (synch1, nr7s, 0) nr8IIf (synch1, nr8s, 0) InsideBar Inside () nr1IIf InsideBar, shapeDigit1, shapeNone) främmande SetForeign (Vr) HaC (OHLC) 4 HaO AMA (Ref (HaC, -1), 0,5) HaH Max (H, Max (HaC, HaO)) HaL Min (L, Min (HaC, BH3HHV (LLV (HaL, 4) ATR (4), 8) BR3LLV (HHV (HaH, 4) - ATR (4), 8) coIIf (HacgtBG3, colorBrightGreen, IIf (Hac lt BR3, colorRed, colorGrey50 )) Plot (4, kvot, Co, styleAre astyleOwnScale styleNoLabel, -1, 100) RestorePriceArrays () SEKTIONSEND () ytterligare filter GLong (TOPFHL) OCH TimeNum () lt 101600 Gshort (TOPFHH) OCH TimeNum () lt 101600 GLS (AFlt (FHH-FHL)) advanceForeign (quotNAdvanced quotation quototh ) NedgångForeign (quotNSEDecliningquot, quotHquot) NU BERÄKTA ENTRY-EXIT-STOPLOSS PARAMETERS BuyPrice (DayLAF) BuyTP1 (BuyPrice (BuyPrice (PerctakeProfit100))) KöpTP2 (CgtBuyTP1 ELLER HgtBuyTP1) SäljPrice (DayH-AF) SäljPTP (SäljPris - ), SAR (acc, accm), BuyTP1) TSB1Cross (TSB, C) TSS IIf (SAR (acc, accm) (C, PDS) PDC) 100) Vol (VgtVolmin OCH VltVolmax) Procentandel (percchangegtPercChangemin OCH percchangeltPercChangemax) (C, PDC) ) PRC (CgtpriceRL OCH CltpriceRH) Köp1 (Vol och Procent OCH prc OCH sedan OCH (HacgtBG3) OCH advancegtDecline AND (Cross (C, BuyPrice)) Köp2 (Vol OCH Procent OCH prc OCH Sedan och vidareutveckling och (Cross (C, BuyPrice))) Short1 (Vol och Procent OCH prc OCH sedan OCH vidareutvecklasDecline OCH (HacltBR3) OCH (Cross (SellPrice, C)) Short2 (Vol och Procent OCH prc OCH sedan OCH vidareutvecklasDecline AND (Cross (SellPrice, C))) Köp3 IIf (synkronisera, Köp1, Köp2) Short3 IIf (synkronisera, Short1, Short2) BuyStop1 (BuyPrice - (BuyPrice (PercStoploss100))) BuyStop1IIf (BuyStop1lt SäljPris, SäljPris, KöpStop1) KöpStop2 LltBuyStop1 ELLER CltBuyStop1) SäljStop1 (SäljPris) (SellPrice) (PercStoploss100))) SäljStop1IIf (SäljStop1 gt Köppris, KöpPris, SäljStopp1) SäljStop2 (HgtSellStop1 ELLER CgtSellStop1) Kumulativa affärer TradeBase (Köp3 ELLER Short3 OCH sedan) TradesCum (TradeBase) Trades2 (Tradesgttrades1) buyTargetHit IIf (buySincegt1 och buyTPSincegt1 och buyStopSince lt 0, 1, 0) buyStoplossHit IIf (buySincegt1 OCH buyStopSincegt1 OCH buyTPSince lt 0, 1, 0) Köp (Köp3 OCH trades2 OCH isSlopeUP OCH (INTE Ref (Buy3, -1) OCH INTE Ref (Buy3 , -2) OCH INTE Ref (Köp3, -3) OCH INTE Ref (Köp3, -4) OCH INTE Ref (Köp3, -5))) Sh ort (Short3 OCH trades2 OCH isSoopDN OCH (INTE Ref (Short3, -1) OCH INTE Ref (Short3, -2) OCH INTE Ref (Short3, -3) OCH INTE Ref (Short3, -4) OCH NOT Ref -5))) KöpStopIIf ((Köp och INTE KöpTP2), BuyStop1, Null) SäljStopIIf (Kort och INTE SäljP2, SäljStop1, Noll) KöpTPIIf (Köp OCH INTE KöpStop, KöpTP2, Null) SäljTPIIf (Kort OCH Ej SäljStop, SäljPTP, Null ) experiment tradebaseB (Köp) tradesBCum (tradebaseB) BuyTP3BuyTP2 OCH TradesBgt1 tradebaseBTP (BuyTP3) tradesBTPCum (tradebaseBTP) Buystop3Buystop2 OCH TradesBgt1 tradebaseBSL (Buystop3 OCH eftersom) tradesBSLCum (tradebaseBSL) SellTP3SellTP2 OCH TradesSgt1 tradebaseSTP (SellTP3) tradesSTPCum (tradebaseSTP) Sellstop3Sellstop2 OCH TradesSgt1 tradebaseSSL ( SellStop3 OCH sedan) tradesSSLCum (tradebaseSSL) buyTriggered (TradesB1) buyTargetHit (TradesBTPgt1) buyStoplossHit (TradesBSLgt1) shortTriggered TradesS1 shortTargetHit (TradesSTPgt1) shortStoplossHit (TradesSSLgt1) baslinjens grundlinje Bars BarsSince (TimeNum) gt 95400 OCH TimeNum () lt 101459) BarIndex (), 1) OCH DateNum () LastValue (DateNum ()) x0 BarCount-LastValue (Barer) x1 BarCount-1 TOPLine LineArray (x0, LastValue (TOP), x1, LastValue (TOP), 0) PDHLine LineArray (x0, LastValue (PDH) x1, LastValue (PDL), 0) PDCLine LineArray (x0, LastValue (PDC), x1, LastValue (PDC), 0) PDMLine LineArray (x0, LastValue x0, LastValue (FHH), 0) FHLLine LineArray (x0, LastValue (FHL), x1, LastValue (FHL), x1, LastValue (PDH) ), 0) BuyPress LineLineArray (x0, LastValue (BuyPrice), x1, LastValue (BuyPrice), 0) KöpStoplineLineArray (x0, LastValue (BuyStop1), x1, LastValue (BuyStop1) , SelectedValue (TSB), 0) SellPricelineLineArray (x0, LastValue (SellPrice), x1, LastValue (SellPrice), 0) SäljStoplineLineArray (x0, LastValue (SellStop1), x1, LastValue (SellStop1), 0) SellTPlineLineArray (x0, SelectedValue TSS), x1, SelectedValue (TSS), 0) DayHlineLineArray (x0, LastValue (DayH), x1, LastValue (DayH), 0) DayLlineLineArray (x0, LastValue (DayL) , x1, LastValue (DayL), 0) Klarkoder Cshavebuy1IIf ((Cgt ((BuyStopline)) OCH HltBuyPriceline) OCH INTE Kort, Buystopline (2 ((Ref (High, -1) - Ref (Low, -1)) factor100 ), 0) Cshavesell1IIf ((Clt ((Sellstopline)) OCH LgtSellPriceline) OCH INTE Köp, SäljStopline - (2 ((Ref (High, -1) - Ref (Low, -1)) Factor100)), 0) Cshavebuy1IIf (CgtBuyStopline AND HltBuyPriceline OCH H gt BuyPriceline0.997) OCH INTE BORT OCH sedan (BuyPriceline0.997), 0) Cshavesell1IIf ((CltSellstoplin OCH LgtSellPriceline AND LltSellPriceLine1.002) OCH INTE KÖP OCH sedan (SäljPriceLine1.002), 0 ) Cshavebuy2Cshavebuy1 OCH (Ej Ref (Cshavebuy1,1) OCH isSupup) Cshavebuy3Cshavebuy1 OCH (Ej Ref (Cshavebuy1,1) OCH ((HacgtBG3) ELLER (INTE (HacgtBG3) OCH INTE (HacltBR3)) OCH ISSlopeUP) Cshavesell2CshaveSell1 OCH (Cshavesell1,1) OCH isSlopeDN) Cshavesell3CshaveSell1 OCH (Ej Ref (Cshavesell1,1) OCH ((HacltBR3) ELLER (INTE (HacgtBG3) OCH INTE (HacltBR3)) OCH ISSlopeDN) Cshavebuy IIf (Synch, Cshavebuy3, Cshavebuy2) CshavesellIIf synk, Cshavesell3, Cshavesell2) Cshav esell1 (Llt ((Sellstop1)) OCH LgtSellPrice OCH sedan) CshavebuyCshavebuy1 OCH (INTE REF (Cshavebuy1, -1) OCH INTE Ref (Cshavebuy1,1)) OCH synkroniseraSlopeUP CshavesellCshaveSell1 OCH (Ej Ref (Cshavesell1, -1) OCH INTE REF (Cshavesell1, -1)) OCH synchAND isSlopeDN-titel buySince BarsSince (Buy) buy utlöses sedan hur många barer tillbaka buyStopSince BarsSince (IIf (Buysincegt0, BuyStop2 OCH since, 0)) köp SL utlöses sedan hur många barer tillbaka buyTPSince BarsSince IIf (Buysincegt0, BuyTP2 OCH sedan, 0)) köp TP utlöses sedan hur många barer tillbaka buyTriggered IIf (buySincegt0, 1,0) buyTargetHit IIf (buySincegt0 OCH buyTPSincegt0 OCH buySince gt buyTPSince. 1, 0) buyStoplossHit IIf (buySincegt0 OCH buyStopSincegt0 OCH buySince gt buyStopSince. 1, 0) shortSince BarsSince (Short) short triggas sedan hur många barer tillbaka shortStopSince BarsSince (IIf (shortSincegt0, SellStop2 OCH since, 0)) kort SL utlöses sedan många barer tillbaka shortTPSince BarsSince (IIf (shortSincegt0, SellTP2 OCH since, 0)) kort TP utlöses sedan hur många barer tillbaka shortTriggered IIf (shortSincegt0,1,0) shortTargetHit IIf (shortSincegt0 OCH shortTPSincegt0 OCH shortSincegtshortTPSince, 1, 0) ShortStoplossHit IIf (shortSincegt0 OCH shortStopSincegt0 OCH shortSincegtshortStopSince 1, 0) Money Management lotSize round ((riskAmount (BuyPrice-BuyStop1))) PLOT LINES Plot (IIf (pShowtradeLines, BuyPriceline, Null), quotBuy Herequot, colorBrightGreen, styleDotsstyleNoRescale) Plot (pShowtradeLines, BuyStopline, Null), quotBuyStopquot, colorBrightGreen, styleDotsstyleNoRescale styleNoLine) Plot (IIf (pShowtradeLines, BuyTPline, Null), quotBuy Take profitquot, colorBrightGreen, styleDash EddyleNoRescale) Plot (IIf (pShowtradeLines, Cshavebuyline, Null), quotReady Longquot, colorLime, styleDashedstyleNoRescale) Plot (IIf (pShowtradeLines, SellPriceline, Null), quotShort Herequot, colorRed, styleDotsstyleNoRescale) Plot (IIf (pShowtradeLines, SellStopline, Null), quotShortStopquot Plot (IIf (pShowtradeLines, Cshavesellline, Null), quotReady Shortquot, colorOrange, styleDashedstyleNoRescale) Plot (IIf (pShowRangeLines, TOPLine), Plot (IIf (pfshowTradeLines, SellTPline, Null), quotShort Tar Profitquot, colorRed, styleDashedstyleNoRescale Plot (IIf (pShowRangeLines, PDLLine, Null), quotPDLquot, colorPlum, styleLinestyleNoRescale) Plot (IIf (pShowRangeLines, Null), Plot (IIf (pShowRangeLines, PDLine, Null), quotPDHquot, ColorPlum, StyleLinestyleNoRescale) DayHline, Null), quotDayHquot, colorYellow, styleLinestyleNoRescale) Plot (IIf (pShowRangeLines, DayLline, Null), quotDayLquot, colorYellow, styleLinestyleNoRescale) Plot (IIf (pShowRangeLines , FHHLine, Null), quot1015Hquot, IIf (FHRange1, Null, colorBlue), StyleLinestyleNoRescale) Plot (IIf (pShowRangeLines, FHLLine, Null), quot1015Lquot, IIf (FHRange1, Null, colorBlue), StyleLinestyleNoRescale) Former PlotShapes (nr1, 0, L) PlotShapes (nr7, colorGreen, 0, H) PlotShapes (nr8, colorRed, 0, (L - (HL) 4)) PlotShapes (IIf (pShowMarkers OCH Short, shapeDownArrow, Null), colorOrange, 0, H, Offset-15) PlotShapes (IIf (pShowMarkers OCH Cshavesell, shapeHollowSmallDownTriangle, Null), colorOrange, 0, H, Offset-35) PlotShapes (IIf (pShowMarkers OCH Cshavebuy, shapeHollowSmallUpTriangle, Null), colorWhite, 0, L, Offset-35) Alerts AlertIf (Köp, quotSOUND C: WindowsMediaWindows XP Startup. wavquot, quotBuyquot, 2) AlertIf (Short, quotSOUND C: WindowsMediaWindows XP Startup. wavquot, quotShortquot, 2) AlertIf (BuyStop, quotSOUND C: WindowsMediaRingin. wavquot, quotBuyStop Hitquot, 2) AlertIf (TSB1, quotSOUND C: WindowsMediaRingin. wavquot, q 2) AlertIf (TSS1, quotSOUND C: WindowsMediaRingin. wavquot, quotShort Take Profitquot, 2) AlertIf (Cshavebuy, quotSOUND C: WindowsMediaWindows XP-uppstart, 2) AlertIf (SellStop, quotSOUND C: WindowsMediaRingin. wavquot, quotShort Stop Hitquot. wavquot, quotGet Ready to Buyquot, 2) AlertIf (Cshavesell, quotSOUND C: WindowsMediaWindows XP Startup. wavquot, quotGet Ready to Shortquot, 2) AlertIf (GLong, quotSOUND C: WindowsMediaWindows XP Startup. wavquot, quotOpen 1015L Buyquot, 2) AlertIf (Gshort, quotSOUND C: WindowsMediaWindows XP Startup. wavquot, quotOpen 1015H Shortquot, 2) AlertIf (GLS, quotSOUND C: WindowsMediaWindows XP Startup. wavquot, quotFactorgtRange, Go Long eller Short sure shotquot, 2) om (Status (quotactionquot) actionIndicator) (Title EncodeColor (colorWhite) quotDhiraj Systemquot citationstecken () citationstecken EncodeColor (colorYellow) Interval (2) EncodeColor (colorWhite) citationstext Datum () citationstecken EncodeColor (colorYellow) quotVol quot eVal (V) citationstecken SkrivIf (Percchange, quot Förändra kvot (kvot) kvittot) WriteIf (GLS, quot - FactorFriendlyBothSides quot (kvot) kvot) WriteIf (trades, quot-Trade: quot kvot) SkrivIf (AF, kvot - AF: quot (AF) citat, kvot) WriteIf ((lotSize) OCH sedan quot - Position Size. quotIquotquotnquot WriteIf (F11, quotF1: Bäst kvotot kvot) WriteIf (F22, quotF2: Medel kvot kvot) WriteIf (F33, quotF3: Nej Goodquotquot quototot) WriteIf (F33, quotF3: Nej Goodquotquot quot, quototot) Comm2 (quotnquotquotSlope: quot) WriteIf (isSlopeUP, EncodeColor (colorBrightGreen) quotUpquot, WriteIf (isSlopeDN, EncodeColor (colorRed) quot-Downquot, EncodeColor (colorLightYellow) quottt Flat gtquot)) Comm2 (quotnquotVrquot. : quot) SkrivIf (HacgtBG3, EncodeColor (colorBrightGreen) quotUpquot, WriteIf (HacltBR3, EncodeColor (colorRed) quot-Downquot, EncodeColor (colorLightYellow) quottt Flat gtquot)) quotnquotquotnquot EncodeColor (colorBrightGreen) WriteIf (BuyPrice, quotBUY: quot kvittot) WriteIf (BuyStop1, quot - KÖP SL: quot (BuyStop1), kvot) WriteIf (TSB. quot - KÖP TP: quot (TSB) kvot kvot) quotnquot EncodeColor (colorRed) WriteIf (SellPrice, quotSHORT: quot (SellPrice) kvot) WriteIf (SäljStop1, cv HÄR SL: kvot (kvot) kvittot) WriteIf (TSS, kvot - SHORT TP: quot (quot) kvot kvot EncodeColor (colorBrightGreen) WriteIf (GLong, quotOpen1015L Bullish: quot (GLong) kvitto) EncodeColor (colorRed) WriteIf (Gshort, quotOpen1015H Bearish: quot (Gshort) kvot, kvot) quotnquot EncodeColor (colorBrightGreen) WriteIf (förskott, quotAdvance: quot (advance) kvot, kvot) EncodeColor (colorRed) WriteIf quotValuta (IIf (Cshavebuy, 82, IIf (Cshavesell, 82,01)), quotREADYquot, formatChar, (CshaveSell) WriteVal (CshaveSell) WriteVal (Buy)) prospektering AddColumn IIf (Cshavesell, colorDarkRed, colorGreen)) AddColumn (IIf (Köp, 66, IIf (Kort, 83,01)), quotACTION quot, formatChar, IIf (Short, colorDarkRed, colorGreen)) AddTextColumn (WriteIf (element1, quotF1quot, WriteIf (element2, quotF2quot, WriteIf (element3, quotF3quot, kvot)), quotELEMENTquot, 1.0, IIf ((element1 ELLER element2), colorDarkGreen, colorD arkitiv ColorDarkGreen, colorDarkRed)) AddColumn (BuyPrice, quotBuyquot, 1.2) AddColumn (BuyStop1, quotBuy SLquot, 1,2) AddColumn (TSB, quotBuy TPquot, 1,2) AddColumn (SellPrice, quotShortquot, 1,2) AddColumn (SellStop1, quotShort SLquot, 1,2) AddColumn TSS, quotShort TPquot, 1.2) AddColumn (Glong, quotOpen1015LBuyquot, 1.0) AddColumn (Gshort, quotOpen1015H Shortquot, 1.0) AddColumn (GLS, quotFactorFriendlyquot, 1,0) AddColumn (trades, quotTradeNo. quot, 1,0) Filter IIf (AFfilter2, ELLER Kort eller ELLER Cshavebuy ELLER Cshavesell ELLER buyTargetHit ELLER buyStoplossHit ELLER shortTargetHit ELLER shortStoplossHit AND (element1 ELLER element2)), ((Köp ELLER Kort ELLER Cshavebuy ELLER Cshavesell ELLER buyTargetHit ELLER buyStoplossHit ELLER shortTargetHit ELLER shortStoplossH det) OCH (element1 ELLER element2 ELLER element3))) ELLER GLONG ELLER GSHORT) OCH TRÄDER2 OCH GLS ELLER buyTargetHit ELLER buyStoplossHit ELLER shortTargetHit ELLER shortStoplossHit Filter IIf (AFfilter2, Köp ELLER Kort ELLER Cshavebuy ELLER Cshavesell AND (element1 ELLER element2), Köp ELLER Kort ELLER Cshavebuy ELLER Cshavesell AND (element1 ELLER element2 ELLER element3)) ELLER GLong ELLER GSHORT) OCH TRÄDER2 OCH GLS SECTIONBEGIN (quotEMAquot) P ParamField (quotPrice fieldquot, -1) Perioder Param (quotPeriodsquot, 15, 2, 300, 1, 10 ) Plot (EMA (P, Perioder), DEFAULTNAME (), ParamColor (quotColorquot, colorCycle), ParamStyle (quotStylequot)) AVSNITT END () SECTIONBEGIN (quotEMA1quot) P ParamField (quotPrice fieldquot, -1) Perioder Param (quotPeriodsquot, 15, 2 , 300, 1, 10) Punkt (EMA (P, Perioder), DEFAULTNAME (), ParamColor (quotColorquot, colorCycle), ParamStyle (quotStylequot)) AVSNITT END () Jag tror att det finns något fel i denna avl Fil: Dhiraj Chart SetChartBkColor (ParamColor (quotBackGround Colorquot, colorBlack)) pShowRangeLines ParamToggle (quotShow Range Linesquot, quotNoYesquot, 0) pShowtradeLines ParamToggle (quotShow Trade Linesquot, quotNoYesquot, 1) pShowMarkers ParamToggle (quotShow Markersquot, quotNoYesquot, 1) synch1ParamToggle , kvot, quotNoYesquot, 0) LimitParam (kvot Handel Till (timme) (Min) (Sek) kvot, 142500,103000,153000,100) AFfilter Param (kvotaktor Filterquot, 2,2,3,1) SECTIONBEGIN (quotforeign Index bar graphquot) synchParamToggle (quotSynch med Indexquot, quotNoYesquot, 0) VrParamList (quotIndex till Synchquot, List quotNSEI, NSEBANK, CNXIT, NSMIDCP, RELIANCE. NS, SBIN. NSquot, 0) SECTIONBEGIN (quotPL Settingsquot) PerctakeProfitParam (quotTake Profitprocent, 0,65, 0,3,30,0,1) PercStoplossParam (quotStopLoss Procent, 0,8,0,2,5,0,1) trades1Param (quotTrade Abovequot, 1,1,10,1) riskAmountParam (quotRisk Amountquot, 240,200,10000,100) SEKTIONBEGIN (quotTrade Variablesquot) VolminParam quotVolume Minqu 0,010000000,50) VolmaxParam (quotVolume Maxquot, 10000000,0,10000000,50) priceRLParam (quotPrice Range Minquot, 15,1,20000,1) priceRHParam (quotPrice Range Maxquot, 20000,1,20000,1) ) PercChangeminParam (quotPercentage Change Min setquot, -50, -100, 100, 0,1) PercChangemaxParam (quotPercentage Change Max setquot, 50, -100, 100, 0,1) Programmet beräknar och visar olika prisvärden i realtid Dagens Open Prior Day High Prior Dag Låg Föregående Dag Öppna Förra Dag Stäng Förra Dag Medel Dag 1015 Hög Dag 1015 Låg PlotOHLC (Öppna, Hög, Låg, Stäng, Kvot, ColorWhite, StyleCandle) Stänger 0 xpdh 90 SECTIONBEGIN (quotSARquot) acc Param (quotAccelerationquot, 0,02, 0, 1, 0,001) accm Param (quotMax. accelerationquot, 0.2, 0, 1, 0.001) Plot (SAR (acc, accm), DEFAULTNAME (), ParamColor (quotcolorquot, colorBlack), ParamStyle (quotStylequot, styleDots styleNoLine, maskDefault styleDots styleNoLine)) AVSNITT END () SECTIONBEGIN (quotSMAquot) P ParamField (quotPrice fieldquot, -1) Period Param (quotPeriodsquot, 20, 2, 300, 1, 10) Plot (MA (P, Perioder), DEFAULTNAME (), ParamColor (quotColorquot, colorYellow), ParamStyle (quotStylequot, styleThick)) AVSNITTEND () sluttningar isSlopeUP (MA (P, Perioder) ltL) och Ref (MA (P, Perioder), - 1) gtRef (MA (P, Perioder), - 2) OCH Ref 2) gtRef (MA (P, Perioder), - 3) OCH Ref (MA (P, Perioder), - 3) gtRef (MA (P, Perioder) 4) gtRef (MA (P, Perioder), - 5) OCH Ref (MA (P, Perioder), - 5) gtRef (MA (P, Perioder), - 6) isSopDN (MA (P, Perioder) Ref (MA (P, Perioder), - 1) ltRef (MA (P, Perioder), - 2) OCH Ref (MA (P, Perioder), - 2) ltRef (MA (P, Perioder) Ref (MA (P, Perioder), - 3) ltRef (MA (P, Perioder), - 4) OCH Ref (MA (P, Perioder ), - 4) ltRef (MA (P, Perioder), - 5) OCH Ref (MA (P, Perioder), - 5) ltRef (MA (P, Perioder), - 6) isSpePE (MA (P, Perioder) lt) och ref (MA (P, Perioder), - 1) gtRef (MA (P, Perioder), - 2) OCH Ref (MA (P, Perioder), - 1) gtRef (MA (P, Perioder) 3) och Ref (MA (P, Perioder), - 1) gtRef (MA (P, Perioder), - 4) OCH Ref (MA (P, Perioder) 5) och Ref (MA (P, Perioder), - 1) gtRef (MA (P, Perioder), - 6) IsSpeDN (MA (P, Perioder) ltRef (MA (P, Perioder), - 3) OCH Ref (MA (P, Perioder), - 1) ltRef (MA (P, Perioder), - 4) OCH Ref (MA (P, Perioder), - 1) ltRef (MA (P, Perioder) ltRef (MA (P, Perioder), - 6) Omvandla data till den dagliga PlotRange (TimeNum () gt 95500 OCH TimeNum () lt 153500) OCH (DateNum () LastValue (DateNum ())) FHRange (TimeNum () gt 095500 OCH TimeNum () lt 101459) OCH (DateNum () LastValue (DateNum ())) FHPrices Hög FHRange FHMarker BarsSince (FHRangegt0) Hitta antal staplar på 60 minuter NumBars 3 600 Intervall (1) TimeFrameSet (inDaily) Upp Öppna PDH Ref (High, -1) PDL Ref (Low, -1) PDO Ref (Open, -1) PDC Ref (Stäng, -1) PDM (PDHPDL) 2 TimeFrameRestore ) isAll True isRth TimeNum () gt 095400 OCH TimeNum () lt 101459 isdRth TimeNum () gt 095400 OCH TimeNum () lt 160000 aRthL IIf (isRth, L, 1000000) aRthHIIf (isdRth, H, Null) aRthLd IIf (isdRth, L, 1000000) PDO TimeFrameExpand (PDO, inDaily, expandFirst) PDO TimeFrameExpand (PDO, inDaily, expandFirst) PDC TimeFrameExpand (PDH, inDaily, expandFirst) PDL TimeFrameExpand (PDL, inDaily, expandFirst) PDM TimeFrameExpand TimeFrameExpand (PDM, inDaily, expandFirst) FHL TimeFrameExpand (FHL, inDaily, expandFirst) DayH TimeFrameCompress (aRthH, inDaily, compressHigh) DayH TimeFrameExpand (HHV, HighDrive, NumBars), - FHMarker) FHL TimeFrameCompress (aRthL, inDaily, compressLow) (DayH, inDaily, expandFirst) DayL TimeFrameCompress (aRthLd, inDaily, compressLow) DayL TimeFrameExpand (DayL, inDaily, expandFirst ) Faktor FC1 ((PDH-PDL) 0.433) FC2 (PDH-PDL) 0.7666) FC3 ((PDH-PDL) 1.355) FC4 (FHH-FHL) NU FILTER FÖR ATT FINDA DEN ANVÄNDDA FAKTOREN F11IIf ((FC4ltFC1PDH0.005) , FC1,0) F22IIf ((FC4ltFC2PDH0.005 och FC4gtFC1PDH0.005), FC2,0) F33IIf ((FC4ltFC3 OCH FC4gtFC2PDH0.005), FC3,0) element1IIf (F11gt0, F11,0) element2IIf (F22gt0, F22,0 ) element3IIf (F33gt0, F33,0) AF (F11F22F33) sedan (TimeNum () gt 101459 OCH TimeNum () lt Limit) OCH (DateNum () LastValue (DateNum ())) rangHög-låg nr7sIIf (rangLLV (rang, 7) , formDigit7shapePositionAbove, shapeNone) nr8sIIf (Ref (nr7s, -1) OCH rangLLV (rang, 8), shapeDigit8shapePositionAbove, shapeNone) nr7IIf (synch1, nr7s, 0) nr8IIf (synch1, nr8s, 0) InsideBar Inside () nr1IIf InsideBar, shapeDigit1, shapeNone) främmande SetForeign (Vr) HaC (OHLC) 4 HaO AMA (Ref (HaC, -1), 0,5) HaH Max (H, Max (HaC, HaO)) HaL Min (L, Min (HaC, BH3HHV (LLV (HaL, 4) ATR (4), 8) BR3LLV (HHV (HaH, 4) - ATR (4), 8) coIIf (HacgtBG3, colorBrightGreen, IIf (Hac lt BR3, colorRed, colorGrey50 )) Plot (4, kvot, Co, styleAre astyleOwnScale styleNoLabel, -1, 100) RestorePriceArrays () SEKTIONSEND () ytterligare filter GLong (TOPFHL) OCH TimeNum () lt 101600 Gshort (TOPFHH) OCH TimeNum () lt 101600 GLS (AFlt (FHH-FHL)) advanceForeign (quotNAdvanced quotation quototh ) NedgångForeign (quotNSEDecliningquot, quotHquot) NU BERÄKTA ENTRY-EXIT-STOPLOSS PARAMETERS BuyPrice (DayLAF) BuyTP1 (BuyPrice (BuyPrice (PerctakeProfit100))) KöpTP2 (CgtBuyTP1 ELLER HgtBuyTP1) SäljPrice (DayH-AF) SäljPTP (SäljPris - ), SAR (acc, accm), BuyTP1) TSB1Cross (TSB, C) TSS IIf (SAR (acc, accm) (C, PDS) PDC) 100) Vol (VgtVolmin OCH VltVolmax) Procentandel (percchangegtPercChangemin OCH percchangeltPercChangemax) (C, PDC) ) PRC (CgtpriceRL OCH CltpriceRH) Köp1 (Vol och Procent OCH prc OCH sedan OCH (HacgtBG3) OCH advancegtDecline AND (Cross (C, BuyPrice)) Köp2 (Vol OCH Procent OCH prc OCH Sedan och vidareutveckling och (Cross (C, BuyPrice))) Short1 (Vol och Procent OCH prc OCH sedan OCH vidareutvecklasDecline OCH (HacltBR3) OCH (Cross (SellPrice, C)) Short2 (Vol och Procent OCH prc OCH sedan OCH vidareutvecklasDecline AND (Cross (SellPrice, C))) Köp3 IIf (synkronisera, Köp1, Köp2) Short3 IIf (synkronisera, Short1, Short2) BuyStop1 (BuyPrice - (BuyPrice (PercStoploss100))) BuyStop1IIf (BuyStop1lt SäljPris, SäljPris, KöpStop1) KöpStop2 LltBuyStop1 ELLER CltBuyStop1) SäljStop1 (SäljPris) (SellPrice) (PercStoploss100))) SäljStop1IIf (SäljStop1 gt Köppris, KöpPris, SäljStopp1) SäljStop2 (HgtSellStop1 ELLER CgtSellStop1) Kumulativa affärer TradeBase (Köp3 ELLER Short3 OCH sedan) TradesCum (TradeBase) Trades2 (Tradesgttrades1) buyTargetHit IIf (buySincegt1 och buyTPSincegt1 och buyStopSince lt 0, 1, 0) buyStoplossHit IIf (buySincegt1 OCH buyStopSincegt1 OCH buyTPSince lt 0, 1, 0) Köp (Köp3 OCH trades2 OCH isSlopeUP OCH (INTE Ref (Buy3, -1) OCH INTE Ref (Buy3 , -2) OCH INTE Ref (Köp3, -3) OCH INTE Ref (Köp3, -4) OCH INTE Ref (Köp3, -5))) Sh ort (Short3 OCH trades2 OCH isSoopDN OCH (INTE Ref (Short3, -1) OCH INTE Ref (Short3, -2) OCH INTE Ref (Short3, -3) OCH INTE Ref (Short3, -4) OCH NOT Ref -5))) KöpStopIIf ((Köp och INTE KöpTP2), BuyStop1, Null) SäljStopIIf (Kort och INTE SäljP2, SäljStop1, Noll) KöpTPIIf (Köp OCH INTE KöpStop, KöpTP2, Null) SäljTPIIf (Kort OCH Ej SäljStop, SäljTP2, Null ) experiment tradebaseB (Köp) tradesBCum (tradebaseB) BuyTP3BuyTP2 OCH TradesBgt1 tradebaseBTP (BuyTP3) tradesBTPCum (tradebaseBTP) Buystop3Buystop2 OCH TradesBgt1 tradebaseBSL (Buystop3 OCH eftersom) tradesBSLCum (tradebaseBSL) SellTP3SellTP2 OCH TradesSgt1 tradebaseSTP (SellTP3) tradesSTPCum (tradebaseSTP) Sellstop3Sellstop2 OCH TradesSgt1 tradebaseSSL ( SellStop3 OCH sedan) tradesSSLCum (tradebaseSSL) buyTriggered (TradesB1) buyTargetHit (TradesBTPgt1) buyStoplossHit (TradesBSLgt1) shortTriggered TradesS1 shortTargetHit (TradesSTPgt1) shortStoplossHit (TradesSSLgt1) baslinjens grundlinje Bars BarsSince (TimeNum) gt 95400 OCH TimeNum () lt 101459) BarIndex (), 1) OCH DateNum () LastValue (DateNum ()) x0 BarCount-LastValue (Barer) x1 BarCount-1 TOPLine LineArray (x0, LastValue (TOP), x1, LastValue (TOP), 0) PDHLine LineArray (x0, LastValue (PDH) x1, LastValue (PDL), 0) PDCLine LineArray (x0, LastValue (PDC), x1, LastValue (PDC), 0) PDMLine LineArray (x0, LastValue x0, LastValue (FHH), 0) FHLLine LineArray (x0, LastValue (FHL), x1, LastValue (FHL), x1, LastValue (PDH) ), 0) BuyPress LineLineArray (x0, LastValue (BuyPrice), x1, LastValue (BuyPrice), 0) KöpStoplineLineArray (x0, LastValue (BuyStop1), x1, LastValue (BuyStop1) , SelectedValue (TSB), 0) SellPricelineLineArray (x0, LastValue (SellPrice), x1, LastValue (SellPrice), 0) SäljStoplineLineArray (x0, LastValue (SellStop1), x1, LastValue (SellStop1), 0) SellTPlineLineArray (x0, SelectedValue TSS),x1,SelectedValue(TSS),0) DayHlineLineArray(x0,LastValue(DayH),x1,LastValue(DayH),0) DayLlineLineArray(x0,LastValue(DayL),x1,LastValue(DayL),0) Ready codes Cshavebuy1IIf((Cgt((BuyStopline)) AND HltBuyPriceline) AND NOT Short, Buystopline(2((Ref(High,-1)-Ref(Low,-1))factor100)),0) Cshavesell1IIf((Clt((Sellstopline)) AND LgtSellPriceline) AND NOT Buy, SellStopline-(2((Ref(High,-1)-Ref(Low,-1))factor100)),0) Cshavebuy1IIf((CgtBuyStopline AND HltBuyPriceline AND H gt BuyPriceline0.997) AND NOT Short AND since,(BuyPriceline0.997),0) Cshavesell1IIf((CltSellstopline AND LgtSellPriceline AND LltSellPriceLine1.002) AND NOT Buy AND since,(SellPriceLine1.002),0) Cshavebuy2Cshavebuy1 AND (NOT Ref(Cshavebuy1,1) AND isSlopeUP) Cshavebuy3Cshavebuy1 AND (NOT Ref(Cshavebuy1,1) AND ((HacgtBG3) OR (NOT (HacgtBG3) AND NOT (HacltBR3))) AND isSlopeUP) Cshavesell2CshaveSell1 AND (NOT Ref(Cshavesell1,1) AND isSlopeDN) Cshavesell3CshaveSell1 AND (NOT Ref(Cshavesell1,1) AND ((HacltBR3) OR (NOT (HacgtBG3) AND NOT (HacltBR3))) AND isSlopeDN) Cshavebuy IIf(Synch, Cshavebuy3,Cshavebuy2) CshavesellIIf(synch, Cshavesell3,Cshavesell2) Cshav esell1 (Llt((Sellstop1)) AND LgtSellPrice AND since) CshavebuyCshavebuy1 AND (NOT Ref(Cshavebuy1,-1) AND NOT Ref(Cshavebuy1,1) ) AND synchAND isSlopeUP CshavesellCshaveSell1 AND (NOT Ref(Cshavesell1,-1) AND NOT Ref(Cshavesell1,-1)) AND synchAND isSlopeDN title buySince BarsSince(Buy ) buy is triggered since how many bars back buyStopSince BarsSince(IIf(Buysincegt0,BuyStop2 AND since,0)) buy SL is triggered since how many bars back buyTPSince BarsSince(IIf(Buysincegt0,BuyTP2 AND since,0)) buy TP is triggered since how many bars back buyTriggered IIf(buySincegt0 ,1,0) buyTargetHit IIf(buySincegt0 AND buyTPSincegt0 AND buySince gt buyTPSince. 1, 0) buyStoplossHit IIf( buySincegt0 AND buyStopSincegt0 AND buySince gt buyStopSince. 1, 0) shortSince BarsSince(Short) short is triggered since how many bars back shortStopSince BarsSince(IIf(shortSincegt0,SellStop2 AND since,0)) short SL is triggered since how many bars back shortTPSince BarsSince(IIf(shortSincegt0,SellTP2 AND since,0)) short TP is triggered since how many bars back shortTriggered IIf(shortSincegt0,1,0) shortTargetHit IIf(shortSincegt0 AND shortTPSincegt0 AND shortSincegtshortTPSince, 1, 0) shortStoplossHit IIf(shortSincegt0 AND shortStopSincegt0 AND shortSincegtshortStopSince, 1, 0) money management lotSize round((riskAmount(BuyPrice-BuyStop1))) PLOT LINES Plot(IIf(pShowtradeLines, BuyPriceline, Null),quotBuy Herequot, colorBrightGreen, styleDotsstyleNoRescale) Plot(IIf(pShowtradeLines, BuyStopline, Null),quotBuyStopquot, colorBrightGreen, styleDotsstyleNoRescale styleNoLine) Plot(IIf(pShowtradeLines, BuyTPline, Null),quotBuy Take profitquot, colorBrightGreen, styleDash edstyleNoRescale) Plot(IIf(pShowtradeLines, Cshavebuyline, Null),quotReady Longquot, colorLime, styleDashedstyleNoRescale) Plot(IIf(pShowtradeLines, SellPriceline, Null),quotShort Herequot, colorRed, styleDotsstyleNoRescale) Plot(IIf(pShowtradeLines, SellStopline, Null),quotShortStopquot, colorRed, styleDotsstyleNoRescale styleNoLine) Plot(IIf(pShowtradeLines, SellTPline, Null),quotShort Take Profitquot, colorRed, styleDashedstyleNoRescale) Plot(IIf(pShowtradeLines, Cshavesellline, Null),quotReady Shortquot, colorOrange, styleDashedstyleNoRescale) Plot(IIf(pShowRangeLines, TOPLine, Null),quotOpenquot, colorGreen, styleDashedstyleNoRescale) Plot(IIf(pShowRangeLines, PDHLine, Null),quotPDHquot, colorPlum, styleLinestyleNoRescale) Plot(IIf(pShowRangeLines, PDLLine, Null),quotPDLquot, colorPlum, styleLinestyleNoRescale) Plot(IIf(pShowRangeLines, DayHline, Null),quotDayHquot, colorYellow, styleLinestyleNoRescale) Plot(IIf(pShowRangeLines, DayLline, Null),quotDayLquot, colorYellow, styleLinestyleNoRescale) Plot(IIf(pShowRangeLines, FHHLine, Null),quot1015Hquot, IIf(FHRange1,Null, colorBlue),styleLinestyleNoRescale) Plot(IIf(pShowRangeLines, FHLLine, Null),quot1015Lquot, IIf(FHRange1,Null, colorBlue),styleLinestyleNoRescale) Shapes PlotShapes(nr1,colorGreen,0,L) PlotShapes(nr7,colorGreen,0,H) PlotShapes(nr8,colorRed,0,(L-(H-L)4)) PlotShapes(IIf(pShowMarkers AND Short, shapeDownArrow, Null), colorOrange, 0,H, Offset-15) PlotShapes(IIf(pShowMarkers AND Buy, shapeUpArrow, Null), colorWhite, 0,L, Offset-15) PlotShapes(IIf(pShowMarkers AND Cshavesell, shapeHollowSmallDownTriangle, Null), colorOrange, 0,H, Offset-35) PlotShapes(IIf(pShowMarkers AND Cshavebuy, shapeHollowSmallUpTriangle, Null), colorWhite, 0,L, Offset-35) Alerts AlertIf( Buy, quotSOUND C:WindowsMediaWindows XP Startup. wavquot, quotBuyquot,2) AlertIf( Short, quotSOUND C:WindowsMediaWindows XP Startup. wavquot, quotShortquot, 2 ) AlertIf( BuyStop, quotSOUND C:WindowsMediaRingin. wavquot, quotBuyStop Hitquot, 2 ) AlertIf( TSB1, quotSOUND C:WindowsMediaRingin. wavquot, q uotBuy Take Profitquot, 2 ) AlertIf( SellStop, quotSOUND C:WindowsMediaRingin. wavquot, quotShort Stop Hitquot, 2 ) AlertIf( TSS1, quotSOUND C:WindowsMediaRingin. wavquot, quotShort Take Profitquot, 2 ) AlertIf( Cshavebuy, quotSOUND C:WindowsMediaWindows XP Startup. wavquot, quotGet Ready to Buyquot, 2 ) AlertIf( Cshavesell, quotSOUND C:WindowsMediaWindows XP Startup. wavquot, quotGet Ready to Shortquot, 2 ) AlertIf( GLong, quotSOUND C:WindowsMediaWindows XP Startup. wavquot, quotOpen 1015L Buyquot, 2 ) AlertIf( Gshort, quotSOUND C:WindowsMediaWindows XP Startup. wavquot, quotOpen 1015H Shortquot, 2 ) AlertIf( GLS, quotSOUND C:WindowsMediaWindows XP Startup. wavquot, quotFactorgtRange, Go Long or Short sure shotquot, 2 ) if( Status(quotactionquot) actionIndicator ) ( Title EncodeColor(colorWhite) quotDhiraj Systemquot quot - quot Name() quot - quot EncodeColor(colorYellow) Interval(2) EncodeColor(colorWhite) quot - quot Date() quot - quot EncodeColor(colorYellow) quotVol quot Writ eVal(V)quot - quot WriteIf(Percchange, quot Change quot(Percchange)quot quot, quotquot) WriteIf(GLS, quot - FactorFriendlyBothSides quot(GLS)quot quot, quotquot) WriteIf(trades, quot - Trade : quot(Trades)quot quot, quotquot) WriteIf(AF, quot - AF: quot(AF)quot quot, quotquot) WriteIf((lotSize) AND since, quot - Position Size. quot( lotSize )quot quot, quotquot) quotnquotquotnquot WriteIf(F11, quotF1: Best quotquot quot, quotquot) WriteIf(F22, quotF2: Medium quotquot quot, quotquot) WriteIf(F33, quotF3: No Goodquotquot quot, quotquot) WriteIf(F33, quotF3: No Goodquotquot quot, quotquot) Comm2(quotnquotquotSlope: quot) WriteIf(isSlopeUP, EncodeColor(colorBrightGreen)quotUpquot, WriteIf(isSlopeDN, EncodeColor(colorRed)quot-Downquot, EncodeColor(colorLightYellow)quotlt Flat gtquot)) Comm2(quotnquotVrquot. Phase: quot) WriteIf(HacgtBG3,EncodeColor(colorBrightGreen)quotUpquot, WriteIf(HacltBR3,EncodeColor(colorRed)quot-Downquot, EncodeColor(colorLightYellow)quotlt Flat gtquot)) quotnquotquotnquot EncodeColor(colorBrightGreen) WriteIf(BuyPrice, quotBUY: quot(BuyPrice)quot quot, quotquot) WriteIf(BuyStop1, quot - BUY SL: quot(BuyStop1),quotquot) WriteIf(TSB. quot - BUY TP: quot(TSB)quot quot, quotquot) quotnquot EncodeColor(colorRed) WriteIf(SellPrice, quotSHORT: quot(SellPrice)quot quot, quotquot) WriteIf(SellStop1, quot - S HORT SL: quot(SellStop1)quot quot, quotquot) WriteIf(TSS, quot - SHORT TP: quot(TSS)quot quot, quotquot)quotnquot quotnquot EncodeColor(colorBrightGreen) WriteIf(GLong, quotOpen1015L Bullish: quot(GLong)quot quot, quotquot) EncodeColor(colorRed) WriteIf(Gshort, quotOpen1015H Bearish: quot(Gshort)quot quot, quotquot) quotnquot EncodeColor(colorBrightGreen) WriteIf(advance, quotAdvance: quot(advance)quot quot, quotquot) EncodeColor(colorRed) WriteIf(decline, quot - Decline: quot(Decline)quot quot, quotquot)) WriteVal(NSEAdvancing) WriteVal(CshaveSell) WriteVal(Buy)) exploration AddColumn( IIf(Cshavebuy, 82, IIf(Cshavesell, 82,01 )), quotREADYquot, formatChar, IIf(Cshavesell, colorDarkRed, colorGreen) ) AddColumn( IIf(Buy, 66, IIf(Short, 83,01 )), quotACTION quot, formatChar, IIf(Short, colorDarkRed, colorGreen) ) AddTextColumn( WriteIf(element1,quotF1quot, WriteIf(element2,quotF2quot, WriteIf(element3,quotF3quot, quotquot))),quotELEMENTquot,1.0, IIf((element1 OR element2),colorDarkGreen, colorD arkRed)) AddTextColumn( WriteIf(BuytargetHit, quotbuyTargetHitquot, WriteIf(buyStoplossHit, quotbuyStoplossHitquot, WriteIf(shortTargetHit, quotshortTargetHit quot, WriteIf(shortStoplossHit, quotshortStoplossHitquot, quotquot)))),quotStatusquot,1.0, IIf((buyTargetHit OR shortTargetHit OR BuyTriggered),colorDarkGreen, colorDarkRed)) AddColumn(BuyPrice, quotBuyquot,1.2) AddColumn(BuyStop1,quotBuy SLquot,1.2) AddColumn(TSB, quotBuy TPquot,1.2) AddColumn(SellPrice, quotShortquot,1.2) AddColumn(SellStop1,quotShort SLquot,1.2) AddColumn(TSS, quotShort TPquot,1.2) AddColumn(Glong, quotOpen1015LBuyquot,1.0) AddColumn(Gshort, quotOpen1015H Shortquot,1.0) AddColumn(GLS, quotFactorFriendlyquot,1.0) AddColumn(trades, quotTradeNo. quot,1.0) Filter IIf(AFfilter2,((Buy OR Short OR Cshavebuy OR Cshavesell OR buyTargetHit OR buyStoplossHit OR shortTargetHit OR shortStoplossHit AND (element1 OR element2))),((Buy OR Short OR Cshavebuy OR Cshavesell OR buyTargetHit OR buyStoplossHit OR shortTargetHit OR shortStoplossH it) AND (element1 OR element2 OR element3))) OR GLong OR Gshort) AND trades2 AND GLS OR buyTargetHit OR buyStoplossHit OR shortTargetHit OR shortStoplossHit Filter IIf(AFfilter2,Buy OR Short OR Cshavebuy OR Cshavesell AND (element1 OR element2),Buy OR Short OR Cshavebuy OR Cshavesell AND (element1 OR element2 OR element3)) OR GLong OR Gshort) AND trades2 AND GLS SECTIONBEGIN(quotEMAquot) P ParamField(quotPrice fieldquot,-1) Periods Param(quotPeriodsquot, 15, 2, 300, 1, 10 ) Plot( EMA( P, Periods ), DEFAULTNAME(), ParamColor( quotColorquot, colorCycle ), ParamStyle(quotStylequot) ) SECTIONEND() SECTIONBEGIN(quotEMA1quot) P ParamField(quotPrice fieldquot,-1) Periods Param(quotPeriodsquot, 15, 2, 300, 1, 10 ) Plot( EMA( P, Periods ), DEFAULTNAME(), ParamColor( quotColorquot, colorCycle ), ParamStyle(quotStylequot) ) SECTIONEND()SDA2 Trend Trading system is nothing but a trend trading system made using Standard Deviation(SD) and ATR(2) Average True range. This is just the variation of the AFBI Channel Trading system with a better performance and backtesting results. Channel has been Built using the following formula DerivedMA(((HL)2)(O-C),3) Upper(DerivedStDev(Derived,7))ATR(2)1.5 Lower(Derived-StDev(Derived,7))-ATR(2)1 And the Colour of the Candlestick will be toggled between Green and Red each time when it breaks the Upper Channel or the Lower Channel. 1)Candlestick turn green if the Candle stick breaks and closes above the Upper Channel which indicates the buy signal 2)Candlestick turn red if the Candle stick breaks and closes above the Lower Channel which indicates the sell signal 3)The stop loss for the Buy Signal is the lower Channel and the stop loss for the Sell Signal is the Upper Channel The following code is use to toggle the Candlestick colour between GreenRed colorIIf(BarsSince(Cross(Lower, C))gtBarsSince(Cros s(C, Upper)), colorBrightGreen, colorRed) Plot(C, quot, Color,64) Further Buy or Sell Signals, Scanning Functionality and Exploration has been added to the AFL code as usualSECTIONBEGIN(SMV Trading System v1.0) Den Param(Density, 1, 0.25, 100, 0.25) IBBars Param(Initial Balance Bars, 2, 0, 5, 1) EnIB Param(Show Initial Balance, 1, 0, 1, 1) EnMP Param(Show Market Profile, 1, 0, 2, 1) BarsInDay BarsSince(Day() Ref(Day(), -1)) Bot TimeFrameGetPrice(L, inDaily, 0) Top TimeFrameGetPrice(H, inDaily, 0) Vol TimeFrameGet Price(V, inDaily, 0) POC H - H VAL H - H VAH H - H CurTop HHV(H, BarsInDay1) Curbot LLV(L, BarsInDay1) Range Highest(Top-Bot) TodayRange Top - Bot AveRange Sum(Top-Bot,30)30 LAveRange AveRangeBarCount-1 if (LAveRange lt 1) else if (LAveRange lt 10) else if (LAveRange lt 20) else if (LAveRange lt 100) else if (LAveRange lt 500) else Initialization baseX 0 baseY floor(Bot0Den)Den relTodayRange 0 firstVisBar Status(firstvisiblebar) lastVisBar Status(lastvisiblebar) i0 0 i1 0 for (i0 iltBarCount i) if (BarsInDayi 0 AND i lt firstVisBar) i0 i if (BarsInDayi 0 AND i gt lastVisBar) i1 i i1 BarCount-1 for (ii0 ilti1 i) if (BarsInDayi 0) baseX i baseY floor(BotiDen)Den maxY floor(TopiDen)Den relTodayRange (maxY-baseY)Den if (EnMP 2) for (j0 jlt relTodayRange j) if (Li lt baseYjDen AND Hi gt baseYjDen) PlotText(StrExtract(A, B,C, D,E, F,G, H,I, J,K, L,M, N, BarsInDayi), baseXxj, baseYjDen, colorBlack) xj else if (EnMP 1) for (j0 jlt relTodayRange j) if (Li lt baseYjDen AND Hi gt baseYjDen) line LineArray(baseX, baseYjDen, baseXxj1, baseYjDen) Plot(line,,ParamColor(Color, colorCustom13), styleLinestyleDots) xj if (BarsInDayi IBBars1 AND EnIB 1) Line1 LineArray(i-2, curtopi-1,i10, curtopi-1,0,True) Line1aLine1dLine1 Line1bLine1-dLine1 Plot(Line1,,colorBlue, styleDotsstyleThick) Plot(Line1a,,colorBlue, styleDotsstyleThickstyleNoLabel) Plot(Line1b,,colorBlue, styleDotsstyleThickstyleNoLabel) Line1 LineArray(i-2, curboti-1,i10, curboti-1,0,True) Line1aLine1dLine1 Line1bLine1-dLine1 Plot(Line1,,colorBlue, styleDotsstyleThick) Plot(Line1a,,colorBlue, styleDotsstyleThickstyleNoLabel) Plot(Line1b,,colorBlue, styleDotsstyleThickstyleNoLabel) if ((i lt BarCount - 1 AND BarsInDayi1 0) OR i BarCount-1) maxXj 0 for (j0 jlt relTodayRange j) if (maxXj lt xj) for (ki-BarsInDayikltik) POCk baseYmaxXjDen Line1 LineArray(baseX, baseYmaxXjDen, i, baseYmaxXjDen,0,True) Line1aLine1dLine1 Line1bLine1-dLine1 Plot(Line1,,colorWhite, styleDotsstyleThick) Plot(Line1a,, colorWhite, styleDotsstyleThickstyleNoLabel) Plot(Line1b,,colorWhite, styleDotsstyleThickstyleNoLabel) SECTIONBEGIN(SDA2 Channel Trading System) DerivedWMA(((HL)2)(O-C),3) iWMA(Derived,3) Upper(DerivedStDev(Derived,7))ATR(2)1.5 Lower(Derived-StDev(Derived,7))-ATR(2)1 colorIIf(BarsSince(Cross(Lower, C))gt BarsSince(Cross(C, Upper)), colorBrightGreen, colorRed) Plot(C,,Color,64) Plot(Upper, upper band, colorGreen) Plot(Lower, lower band, colorDarkRed) Buy Cross(Close, Upper) Sell Cross(Lower, Close) Buy ExRem(Buy, Sell) Sell ExRem(Sell, Buy) Filter Buy OR Sell Exploration Parameters AddTextColumn( FullName(), Company Name ) AddColumn( Buy, Buy, 1 ) AddColumn( Sell, Sell, 1 ) AddColumn( C, Close, 1.3 ) AddColumn( H, High, 1.3 ) AddColumn( Lower, Lower Band, 1.3 ) AddColumn( Upper, Upper Band, 1.3 ) PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorGreen, 0, L, Offset-40) PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorLime, 0,L, Offset-50) PlotShapes(IIf(Buy, shapeUpArrow, shapeNone),colorWhite , 0,L, Offset-45) PlotShapes(IIf(Sell, shapeSquare, shapeNone),colorRed, 0, H, Offset40) PlotShapes(IIf(Sell, shapeSquare, shapeNone),colorOrange, 0,H, Offset50) PlotShapes(IIf(Sell, shapeDownArrow, shapeNone),colorWhite, 0,H, Offset-45) SECTIONBEGIN(Weekly MP) SetChartOptions(0,chartShowArrowschartShowDates) N(Title StrFormat( - Open g, Hi g, Lo g, Close g (.1f) , O, H, L, C, SelectedValue( ROC( C, 1 ) ) )) Plot( C, Close, ParamColor(Color, colorTurquoise), styleNoTitle ParamStyle(Style) GetPriceStyle() ) SECTIONEND() SECTIONBEGIN(Market Profile) Market Profile GraphXSpace 5 SetChartOptions(0, chartShowDates) Den Param(Density, 200, 10, 300, 10) ShowMP ParamToggle(Show MP, NoYes) ShowVP ParamToggle(Show VP, NoYes) StyleMP ParamStyle(style MP, styleLinestyleDots, maskAll) StyleVP ParamStyle(style VP, styleLinestyleDots, maskAll) NewDay DayOfWeek() gt Ref( DayOfWeek(),1) OR Cum(1) BarCount Bot TimeFrameGetPrice(L, inWeekly, 0) Top TimeFrameGetPrice(H, inWeekly, 0) Vol TimeFrameGetPrice(V, inWeekly, 0) Range Highest(Top-Bot) Box RangeDen VolumeUnit VolBarsInDay for (k 0 k lt Den k) loop through each line (price) starting at the Lowest price Line Bot kBox detect Line gt L amp Line lt H if(ShowMP True) CountMPString IIf(NewDay, Sum(detect, BarsInDay), 0) CountMPString Ref(ValueWhen(NewDay, CountMPString, 0), -1) MpLine IIf(CountMPString gt BarsInDay, Line, Null) Plot(MPLine, , colorGreen. styleMP) if(ShowVP True) CountVPString IIf(NewDay, Sum(detectV, BarsInDay)VolumeUnit, 0) CountVPString Ref(ValueWhen(NewDay, CountVPString, 0), -1) VpLine IIf(CountVPString gt BarsInDay, Line Box4, Null) Plot() Plot(VPLine, , colorBlue, styleVP) Title - - c04 Market Profile c06 Volume Profile SECTIONEND() SECTIONBEGIN(PriceVAP) SetChartOptions(0,chartShowArrowschartShowDates) N(Title StrFormat( - Open g, Hi g, Lo g, Close g (.1f) , O, H, L, C, SelectedValue( ROC( C, 1 ) ) )) Plot( C, Close, ParamColor(Color, colorOrange ), styleNoTitle styleCandle ) SECTIONBEGIN(Volume At Price) PlotVAPOverlay( Param(Lines, 300, 100, 1000, 1 ), Param(Width, 15, 1, 100, 1 ), ParamColor(Color, colorLightBlue ), ParamToggle(Side, LeftRight ) 4ParamToggle(Z-order, On topBehind, 1 ) ) SECTIONBEGIN(Magnified Market Price) FSParam(Font Size,30,11,100,1) GfxSelectFont(Times New Roman, FS, 700, True ) GfxSetBkMode( colorWhite ) GfxSetTextColor( ParamColor(Color, colorGreen) ) HorParam(Horizo ntal Position,990,1,1200,1) VerParam(Vertical Position,12,1,830,1) GfxTextOut(C, Hor. Ver ) YCTimeFrameGetPrice(C, inDaily,-1) DDPrec(C-YC,2) xxPrec((DDYC)100,2) GfxSelectFont(Times New Roman, 11, 700, True ) GfxSetBkMode( colorBlack ) GfxSetTextColor(ParamColor(Color, colorYellow) ) GfxTextOut(DD (xx), Hor. Ver45 ) SECTIONEND()
No comments:
Post a Comment