Sda2 channel trading system


SeçãoBEGIN (quotSDA2 Canal Trading System ver 2.0quot) SetChartOptions (0, chartShowArrowschartShowDates) trailing0 N (Título StrFormat (quot - Abrir g, Hi g, Lo g, Fechar g (.1f) quot, O, H, L, C SelectedValue (ROC (C, 1)))) SetTradeDelays (1, 1, 1, 1) BuyPrice Abrir SellPrice Abrir DerivedWMA (WMA (WL) (2), 2) iWMA Derivado, 3) Superior (DerivedStDev (Derivado, 7)) ATR (2) 1.5 Baixo (Derivado-StDev (Derivado, 7)) - ATR (2) 1 colorIIf (C, superior)), colorBrightGreen, colorRed) Plot (C, quotquot, color, 64) Plot (Upper, quotupper bandquot, colorGreen) Plot (Lower, quotlower bandquot, colorDarkRed) Vender cruz (mais baixo, mais baixo) Comprar ExRem (comprar, vender) Vender ExRem (Vender, Comprar) CoverBuy ShortSell Filtro Comprar OU Vender Exploração Parâmetros AddTextColumn (FullName (), quotCompany Namequot) AddColumn (Buy, quotBuyquot, QuotSell, 1) AddColumn (C, quotClosequot, 1,3) AddColumn (H, quotHighquot, 1,3) Adicionar Column (Lower, quotLower Bandquot, 1.3) AddColumn (Upper, quotUpper Bandquot, 1.3) PlotShapes (IIf (Buy, shapeSquare, shapeNone), colorGreen, 0, L, Offset-40) 0, L, Offset-50) PlotShapes (IIf (Venda, shapeSquare, shapeNone), colorRed, 0, H, Offset40) PlotShapes (IIf (Buy, shapeUpArrow, shapeNone) PlotShapes (IIf (Sell, shapeDownArrow, shapeNone), colorWhite, 0, H, Offset-45) SECTIONBEGIN (quotWaterMarkquot) GfxSetOverlayMode (1) GfxSelectFont QuotThoomaquot, Status (quotpxheightquot) 12) GfxSetTextAlign (6) alinhamento central GfxSetTextColor (ColorHSB (42, 42, 42)) GfxSetBkMode (0) transparente GfxTextOut (quotBudget 2017quot, Status (quotpxwidthquot) 4, Seu próprio nome de exibição GfxSelectFont (quotTahomaquot, Status (quotpxheightquot) 12) GfxTextOut (quot traderjiquot, Status (quotpxwidthquot) 4, Status (quotpxheig Htquot) 490) você pode mudar seu próprio nome de exibição SECTIONEND () synchParamToggle (quotSynch com Indexquot, quotNoYesquot, 0) VrParamList (quotIndex para Synchquot, List quotNSEI, NSEBANK, CNXIT, NSMIDCP, RELIANCE. NS, SBIN. NSquot, 0) SECTIONBEGIN (QuotPL Settingsquot) PerctakeProfitParam (quotTake Profit Percentquot, 0.65,0.3,30,0.1) PercStoplossParam (quotStopLoss Percentual, 0.8,0.2,5,0.1) trades1Param (quotTrade Abovequot, 1,1,10,1) riskAmountParam (quotRisk Amountquot, 240,200 , 10000,100) SECTIONBEGIN (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 Change Max setquot, 50, -100, 100, 0,1) Programa calcula e Exibe vários valores de preço em tempo real Hoje Aberto Dia anterior Dia de alta prioridade Dia de prioridade baixa aberto Prior Day Close Dia anterior Dia médio 1015 Dia alto 1015 Low PlotOHLC (Open, High, Low, Close, quotquot, colorWhite, styleCandle) Barras 0 xpdh 90 SECTIONBEGIN (quotSARquot) acc Param (quotAccelerationquot, 0.02, 0, 1, 0.001) acc Param (quotMax. Parâmetro (quotcolorquot, colorBlack), ParamStyle (quotStylequot, styleDots styleNoLine, maskDefault estiloDots styleNoLine)) SECTIONEND () SECTIONBEGIN (quotSMAquot) P ParamField (quotPrice fieldquot, -1) Parâmetros Param (quotPeriodsquot, 20, 2, 300, 1, 10) Trama (MA (P, Períodos), DEFAULTNAME (), ParamColor (quotColorquot, colorYellow), ParamStyle (quotStylequot, styleThick) (MA (P, Períodos) l) E Ref (MA (P, Períodos), - 1) gtRef (MA (P, Períodos) 2) gtRef (MA (P, Períodos), - 3) E Ref (MA (P, Períodos), - 3) gtRef 4) gtRef (MA (P, Períodos), - 5) e Ref (MA (P, Períodos), - 5) gtRef (MA (P, Períodos), - 6) isSlopeDN Ref (MA (P, Períodos), - 1) ltRef (MA (P, Períodos), - 2) E Ref (MA (P, Períodos), - 2) ltRef Ref (MA (P, Períodos), - 3) ltRef (MA (P, Períodos), - 4) E Ref (MA (P, Períodos ), - 4) ltRef (MA (P, Períodos), - 5) E Ref (MA (P, Períodos) LtC) E Ref (MA (P, Períodos), - 1) gtRef (MA (P, Períodos), - 2) E Ref (MA (P, Períodos) 3) E Ref (MA (P, Períodos), - 1) gtRef (MA (P, Períodos), - 4) E Ref (MA (P, Períodos) 5) AND Ref (MA (P, Períodos), - 1) gtRef (MA (P, Períodos), - 6) isSlpeDN (MA (P, Períodos) gtC) LtRef (MA (P, Períodos), - 2) E Ref (MA (P, Períodos), - 1) LtRef (MA (P, Períodos), - 4) E Ref (MA (P, Períodos), - 1) Converte dados para PlotRange diário (TimeNum () gt 95500 E TimeNum () lt 153500) E (DateNum () LastValue (DateNum ())) FHRange (TimeNum () gt 095500 AND TimeNum () lt 101459) E (DateNum () LastValue (DateNum ())) FHPrices FHRange alto FHMarker BarsSince (FHRangegt0) Encontre o número de barras em 60 minutos NumBars 3 600 (1) TimeFrameSet (inDaily) TOP PDH Ref (Abaixo, -1) PDF Ref (Abaixo, -1) PDF Ref (Abaixo, -1) ) IsAtTal True isRth TimeNum () gt 095400 E TimeNum () lt 101459 isdRth TimeNum () gt 095400 E TimeNum () lt 160000 aRthL IIf (isRth, L, 1000000) aRthH IIf (isdRth, H, Null) aRthLd IIf (isdRth, PDF TimeFrameExpand PDO TimeFrameExpand PDO TimeFrameExpand PDO TimeFrameExpand PDO TimeFrameExpand (PDC, inDaily, expandFirst) PDM TimeFrameExpand (PDD, inDaily, expandFirst) PDM TimeFrameExpand (PDD, inDaily, expandFirst) TimeFrameExpand (FHL, inDaily, expandFirst) FHL TimeFrameExpand (FHL, inDaily, expandFirst) FHL TimeFrameCompression (aRthL, inDaily, compressLow) DayH TimeFrameExpand (aRthH, inDaily, compressHigh) (DayH, inDaily, expandFirst) DayL TimeFrameCompress (aRthLd, inDaily, compressLow) DayL TimeFrameExpand (DayL, inDaily, expandFirst ) Fator de achado FC1 ((PDH-PDL) 0,433) FC2 ((PDH-PDL) 0,7666) FC3 ((PDH-PDL) 1,355) FC4 (FHH - FHL) FILTRO AGORA PARA ENCONTRAR O FATOR APLICÁVEL F11IIf ((FC4ltFC1PDH0.005) , FC1,0) F22IIf ((FC4ltFC2PDH0,005 E FC4gtFC1PDH0,005), FC2,0) F33IIf ((FC4ltFC3 E FC4gtFC2PDH0,005), FC3,0) elemento1IIf (F11gt0, F11,0) element2IIf (F22gt0, F22,0 ) E (DateNum () LastValue (DateNum ())) rangHigh-Low nr7sIIf (rangLLV (rang, 7)) F3F0F33) Desde (TimeNum () gt 101459 E TimeNum () , ShapeDigit7shapePositionAbove, shapeNone) nr8sIIf (Ref (nr7s, -1) E rangLLV (rang, 8), shapeDigit8shapePositionAbove, shapeNone) nr7IIf (synch1, nr7s, 0) nr8IIf (synch1, nr8s, 0) (HaC, -1), 0,5) HaH Max (H, Max (HaC, HaO)) HaL Min (L, Min (HaC, HaO)) BG3HHV (HACGTBG3, colorBrightGreen, IIf (Haclt BR3, colorRed, colorGrey50), (BH3HHV (LLV (HaL, 4) ATR (4), 8) BR3LLV (HHV (HaH, 4) - ATR (4) )) Plot (4, quotquot, Co, styleAre AstyleOwnScale styleNoLabel, -1, 100) RestorePriceArrays () SETOREND () filtros adicionais GLong (TOPFHL) E TimeNum () lt 101600 Gshort (TOPFHH) E TimeNum () lt 101600 GLS (AFLT (FHH-FHL)) advanceForeign (quotNSEAdvancingquot, quotHquot ) DeclareForeign (quotNSEDecliningquot, quotHquot) AGORA CALCULE OS PARÂMETROS ENTRY-EXIT-STOPLOSS BuyPrice (DayLAF) BuyTP1 (BuyPrice (BuyPrice (PerctakeProfit100))) BuyTP2 (CgtBuyTP1 OU HgtBuyTP1) SellPrice (DayH-AF) SellTP1 (SellPrice - ))) SellTP2 (CltSellTP1 OU LltSellTP1) TSB IIf (SAR, accm) gtBuyTP1 E SAR (acc, accm) ltL, SAR (acc, accm), BuyTP1) TSB1Cross (TSB, C) (C-PDC) PDC) 100) Vol (VgtVolmin E VltVolmax) Porcentagem (percchangegtPercChangemin E percchangeltPercChangemax ) Prc (CgtpriceRL E CltpriceRH) Buy1 (Vol. E Porcentagem E prc E desde AND (HacgtBG3) E advancegtDecline E (Cruz (C, BuyPrice))) Buy2 (VOL E Percentagem E prc AND (Cross (C, BuyPrice))) Short1 (VOL E Percentagem E prc E desde AND advanceltDecline E (HacltBR3) E (Cross (SellPrice, C) BuyStop1 (BuyPrice - (BuyPrice (PercStoploss100))) BuyStop1IIf (BuyStop1lt SellPrice, SellPrice, BuyStop1) BuyStop1 (BuyPrice - (BuyPrice, C)) Buy3 IIf (synch, Buy1, Buy2) SellStop1 (SellPart (SellPrice (PercStoploss100))) SellStop1IIf (SellStop1 gt BuyPrice, BuyPrice, SellStop1) SellStop2 (HgtSellStop1 OU CgtSellStop1) negociação cumulativa tradebase (Buy3 OU Short3 E desde) tradesCum (tradebase) trades2 (tradesgttrades1) buyTargetHit IIf (BuySincegt1 E buyTPSincegt1 E buyStopSince lt 0, 1, 0) buyStoplossHit IIf (buySincegt1 E buyStopSincegt1 E buyTPSince lt 0, 1, 0) Comprar (Buy3 AND trades2 AND isSlopeUP E (NÃO Ref (Buy3, -1) E NÃO Ref (Buy3 , -2) E NÃO REF (Buy3, -3) E NÃO REF (Buy3, -4) E NÃO Ref (Buy3, -5))) Sh (Short3 AND) e NOT Ref (Short3, -1) E NÃO Ref (Short3, -2) AND NOT Ref (Short3, -3) E NÃO Ref (Short3, BuyStopIIf (Buy AND NOT BuyTP2), BuyStop1, Null) SellStopIIf (curto e não SellTP2, SellStop1, Null) BuyTPIf (compra e não BuyStop, BuyTP2, nulo) SellTPIIf (curto e não SellStop, SellTP2, ) tradebaseB experimento (Buy) tradesBCum (tradebaseB) BuyTP3BuyTP2 E TradesBgt1 tradebaseBTP (BuyTP3) tradesBTPCum (tradebaseBTP) Buystop3Buystop2 E TradesBgt1 tradebaseBSL (Buystop3 E desde então) tradesBSLCum (tradebaseBSL) SellTP3SellTP2 E Sellstop3Sellstop2 TradesSgt1 tradebaseSTP (SellTP3) tradesSTPCum (tradebaseSTP) E TradesSgt1 tradebaseSSL ( Sellstop3 E desde) tradesSSLCum (tradebaseSSL) buyTriget (TradesB1) buyTargetHit (TradesBTPgt1) buyStoplossHit (TradesBSLgt1) shortTriggered TradesS1 shortTargetHit (TradesSSPgt1) shortStoplossHit (TradesSSLgt1) final linha fundo da trama Bares BarsSince (TimeNum gt 95400 AND TimeNum lt 101459) BarIndex (), 1) E DateNum () LastValue (DateNum ()) x0 BarCount-LastValue (barras) x1 BarCount-1 TopLine LineArray (x0, LastValue (TOP), x1, LastValue (TOP), 0) PDHLine LineArray (x0, LastValue (PDH) (PDC), x1, LastValue (PDC), x1, LastValue (PDH), 0) PDML Line LineArray (x0, LastValue (PDL), x1, LastValue (PDL) (FHL), x1, LastValue (FHH), 0) FHL Line LineArray (x0, LastValue (FHL), x1, LastValue (FHL) ), 0) BuyPricelineLineArray (x0, LastValue (BuyPrice), x1, LastValue (BuyPrice), 0) BuyStoplineLineArray (x0, LastValue (BuyStop1), x1, LastValue (BuyStop1), 0) BuyTPlineLineArray (x0, SelectedValue (TSB) (0, SellValue), 0) SellPricelineLineArray (x0, LastValue (SellPrice), x1, LastValue (SellPrice), 0) SellStoplineLineArray (x0, LastValue (SellStop1), x1, LastValue TSS), x1, SelectedValue (TSS), 0) DayHlineLineArray (x0, LastValue (DayH), x1, LastValue (DayH), 0) DayLlineLineArray (x0, LastValue (DayL) , X1, LastValue (DayL), 0) Códigos prontos Cshavebuy1IIf ((Cgt (BuyStopline)) e não HltBuyPriceline) e não curto, Buystopline (2 ((Ref (High, -1) )), 0) Cshavasell1IIf ((Clt ((Sellstopline)) E LgtSellPriceline) E NÃO Comprar, SellStopline - (2 ((Ref (Alto, -1) - Ref (Baixo, -1)), 0) Cshavebuy1IIf (CgtBuyStopline E HltBuyPriceline E H gt BuyPriceline0.997) E NÃO curto E desde, (BuyPriceline0.997), 0) Cshavesell1IIf ((CltSellstopline E LgtSellPriceline AND LltSellPriceLine1.002) E NÃO Comprar E desde, (SellPriceLine1.002), 0 ) Cshavebuy2Cshavebuy1 AND (NOT Ref (Cshavebuy1,1) E isSlopeUP) Cshavebuy3Cshavebuy1 E (NOT Ref (Cshavebuy1,1) E ((HacgtBG3) OU (NÃO HacgtBG3) AND NOT (HacltBR3))) (Cshavesell1,1) AND isSlopeDN) Cshavesell3CshaveSell1 AND (NOT Ref (Cshavesell1,1) E ((HacltBR3) OR (NOT (HacgtBG3) AND NOT (HacltBR3))) E isSlopeDN) Cshavebuy IIf (Synch, Cshavebuy3, Cshavebuy2) CshavesellIIf Sincronização, Cshavesell3, Cshavesell2) Cshav E LgtSellPrice E desde) CshavebuyCshavebuy1 AND (NOT Ref (Cshavebuy1, -1) AND NOT Ref (Cshavebuy1,1)) E synchAND isSlopeUP CshavesellCshaveSell1 E (NOT Ref (Cshavesell1, -1) AND NOT Ref (Cshavesell1, -1)) AND synchAND isSlopeDN título buySince BarsSince (Buy) buy é acionado desde quantas barras de volta buyStopSince BarsSince (IIS (Buysincegt0, BuyStop2 E desde, 0)) buy SL é acionado desde quantas barras de volta buyTPSince BarsSince IIf (Buysincegt0, BuyTP2 E desde, 0)) comprar TP é acionado desde quantas barras de volta buyTriggered IIf (buySincegt0, 1,0) buyTargetHit IIf (buySincegt0 E buyTPSincegt0 E buySince gt buyTPSince. 1, 0) buyStoplossHit IIf (buySincegt0 E buyStopSinceGt0 E buySince gt buyStopSince.) ShortSince BarsSince (Short) curto é acionado desde quantas barras de volta shortStopSince BarsSince (IIf (shortSincegt0, SellStop2 E desde, 0)) SL curto é acionado Desde quantas barras atrás shortTPSince BarsSince (IIf (shortSincegt0, SellTP2 E desde, 0)) TP curto é acionado desde quantas barras de volta shortTriggered IIf (shortSincegt0,1,0) shortTargetHit IIf (shortSincegt0 E shortTPSincegt0 E shortSincegtshortTPSince, 1, 0) ShortStoplossHit IIf (shortSincegt0 AND shortStopSincegt0 E shortSincegtshortStopSince, 1, 0) gerenciamento de dinheiro lotSize round ((riskAmount (BuyPrice-BuyStop1))) Plot (IIf (pShowtradeLines, BuyPriceline, Null), quotBuy Herequot, colorBrightGreen, styleDotsstyleNoRescale) (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 (pShowtrangeLines, SellTPline, Null), quotShort Take Profitquot, colorRed, styleDashedstyleNoRescale) Plot (IIf (pShowtradeLines, Cshavesellline, Null), quotReady Shortquot, colorOrange, styleDashedstyleNoRescale) Plot (IIf (pShowRangeLines, PDLLine, Null), quotOpenquot, colorGreen, styleDashedstyleNoRescale) Plot (IIf (pShowRangeLines, PDHLine, Null), quotPDHquot, colorPlum, styleLinestyleNoRescale) DayHline, Null), quotDayHquot, colorYellow, styleLinestyleNoRescale) Plot (IIf (pShowRangeLines, DayLline, Null), quotDayLquot, colorYellow, styleLinestyleNoRescale) , FHHLine, Null), quot1015Hquot, IIf (FHRange1, Null, colorBlue), styleLinestyleNoRescale) Plot (IIf (pShowRangeLines, FHLLine, Null), quot1015Lquot, IIf (FHRange1, Null, colorBlue), styleLinestyleNoRescale Formas PlotShapes (nr1, colorGreen, 0, L) PlotShapes (nf7, colorGreen, 0, H) PlotShapes (nr8, colorRed, 0, (L - (HL) 4)) PlotShapes (IIf (pShowMarkers E Short, shapeDownArrow, Offset-15) PlotShapes (IIf (pShowMarkers E Cshavesell, shapeHollowSmallDownTriangle, Null), colorOrange, 0, H, Offset-15) PlotShapes (IIf (pShowMarkers AND Buy, shapeUpArrow, Null), colorWhite, PlotShapes (IIf (pShowMarkers E Cshavebuy, shapeHollowSmallUpTriangle, Null), colorWhite, 0, L, Offset-35) Alertas AlertIf (Comprar, 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 ou Short sure shotquot, 2) if (Status (quotactionquot) actionIndicator) (Título EncodeColor (colorWhite) quotDhiraj Systemquot quot - quot Nome () quot - quot EncodeColor (colorYellow) Intervalo (2) EncodeColor (colorWhite) quot - quot Data () quot - quot EncodeColor (colorYellow) quotVol quot Writ EVal (V) quot - quot WriteIf (Perccambio, quot Troque quot (Perccambio) quot quotquot) WriteIf (GLS, quot - FactorFriendlyBothSides quot (GLS) quot quotquot WriteIf (trades, quot - Trade: Quot quot, quotquot) WriteIf (AF, quot - AF: quot (AF) quot quotquot) WriteIf ((lotSize) E desde, quot - Position Size. Quot, quot, quotquotquotnot WriteIf (F11, quotF1: Best quotquot quotquot) WriteIf (F22, quotF2: Medium quotquot quotquot) WriteIf (F33, quotF3: No Goodquot quotquot) WriteIf (F33, QuotUpquot, WriteIf (isSlopeDN, EncodeColor (colorRed) quot-Downquot, EncodeColor (colorLightYellow) quotlt Flat gtquot)) Comm2 (quotnquotVoquot) Fase (quotnquotquotSlope: quot) : Quot) WriteIf (HacgtBG3, EncodeColor (colorBrightGreen) quotUpquot, WriteIf (HacltBR3, EncodeColor (colorRed) quot-Downquot, EncodeColor (colorLightYellow) quotlt Flat gtquot)) quotnquotquotnquot EncodeColor (colorBrightGreen) WriteIf (BuyPrice, quotBUY: quot Quot, quotquot) WriteIf (BuyStop1, quot - BUY SL: quot (BuyStop1), quotquot) WriteIf (SellPrice, quotSHORT: quot (SellPrice) quot quot, quotquot) WriteIf (SellStop1, quot - S HORT SL: quot (SellStop1) quot, quotquot) WriteIf (TSS, quot - SHORT TP: quot (TSS) quot quotquot quotnquot quotnquot EncodeColor (colorBrightGreen) WriteIf (GLong, quotOpen1015L Bullish: Quotquot) EncodeColor (colorRed) WriteIf (Gshort, quotOpen1015H Bearish: quot (Gshort) quot quot quotquot EncodeColor (colorBrightGreen) WriteIf (adiantar, quotAdvance: quot (avançar) quot quotquot EncodeColor (colorRed) WriteIf (declínio, Quot - Declínio: quot (Decline) quot quotquot) WriteVal (NSEAdvancing) WriteVal (CshaveSell) WriteVal (Buy)) exploração AddColumn (IIf (Cshavebuy, 82, IIf (Cshavesell, 82,01) 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))), quotELEMENTtot, 1.0, IIf ((element1 OU element2), colorDarkGreen, colorD arkRed)) AddTextColumn (WriteIf (BuytargetHit, quotbuyTargetHitquot, WriteIf (buyStoplossHit, quotbuyStoplossHitquot, WriteIf (shortTargetHit, quotshortTargetHit quot, WriteIf (shortStoplossHit, quotshortStoplossHitquot, quotquot)))), quotStatusquot, 1,0, IIf ((buyTargetHit OU shortTargetHit OU BuyTriggered), AddColumn (BuyPrice, quotBuyquot, 1.2) AddColumn (BuyStop1, quotBuy SLquot, 1.2) AddColumn (TSB, quotBuy TPquot, 1.2) AddColumn (SellPrice, quotShortquot, 1.2) AddColumn (SellStop1, quotSquot 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) Filtro IIf (AFfilter2, OU OUTROS OU ORDINÁRIOS OU ORDINÁRIOS OU ORDINÁRIOS OU ORGÂNICOS OU ORIENTATIVOS () OU (OUTROS OU ORDINÁRIOS OU ORGÂNICOS OU ORDINÁRIOS OU ORDINÁRIOS OU ORDINÁRIOS OU ORDINÁRIOS) E) (OU elemento OU elemento2 OU elemento3))) e trades2 E GLS OU buyTargetHit OU buyStoplossHit OU shortTargetHit OU shortStoplossHit Filtro IIf (AFfilter2, Buy OU Short OU Cshavebuy OU Cshavesell AND (element1 OU element2), Buy OU Short OR Cshavebuy OU Cshavesell E (element1 OU element2 OU element3)) OU GLong OU Gshort) E trades2 E GLS SECTIONBEGIN (quotEMAQ) P ParamField (quotPrice fieldquot, -1) Periods Param (quotPeriodsquot, 15, 2, 300, 1, 10 ) Parâmetro Parâmetro (quotPeriodsquot, 15, 2) Parâmetro Parâmetro Parâmetro Parâmetro Parâmetro Parâmetro Parâmetro Parâmetro Parâmetro Parâmetro Parâmetro , 300, 1, 10) Plot (EMA (P, Períodos), DEFAULTNAME (), ParamColor (quotColorquot, colorCycle), ParamStyle (quotStylequot)) SECTIONEND () eu acho que há algum erro nessa afl plz verificar este afl. Arquivo: Dhiraj Gráfico SetChartBkColor (ParamColor (quotBackGround Colorquot, colorBlack)) pShowRangeLines ParamToggle (quotShow Faixa Linesquot, quotNoYesquot, 0) pShowtradeLines ParamToggle (quotShow Trade Linesquot, quotNoYesquot, 1) pShowMarkers ParamToggle (quotShow Markersquot, quotNoYesquot, 1) synch1ParamToggle (quotShow NR , Squot, quotNoYesquot, 0) LimitParam (quot Trade Till (Hour) (Min) (Sec) quot, 142500,103000,153000,100) AFfilter Param (quotFactor Filterquot, 2,2,3,1) SECTIONBEGIN Graphquot) synchParamToggle (quotSynch com Indexquot, quotNoYesquot, 0) VrParamList (quotIndex para Synchquot, List quotNSEI, NSEBANK, CNXIT, NSMIDCP, RELIANCE. NS, SBIN. NSquot, 0) SECTIONBEGIN (quotPL Settingsquot) PerctakeProfitParam (quotTake Profit Percentquot, 0,3,30,0,1) PercStoplossParam (quotStopLoss Percentual, 0,8,0,2,5,0,1) trades1Param (quotTrade Abovequot, 1,1,10,1) riskAmountParam (quotRisk Amountquot, 240,200,10000,100) SECTIONBEGIN (quotTrade Variablesquot) VolminParam QuotVolume Minqu Ot, 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 Change Max setquot, 50, -100, 100, 0.1) Programa calcula e exibe vários valores de preços em tempo real Dia Baixo Anterior Dia Aberto Antes Dia Fechar Antes Dia Dia médio 1015 Alto dia 1015 Baixo PlotOHLC (Open, High, Low, Close, quotquot, colorWhite, styleCandle) Barras 0 xpdh 90 SECTIONBEGIN (quotSARquot) acc Param (quotAccelerationquot, 0.02, 1, 0,001) accm Param (quotMax. Parâmetro (quotcolorquot, colorBlack), ParamStyle (quotStylequot, styleDots styleNoLine, maskDefault estiloDots styleNoLine)) SECTIONEND () SECTIONBEGIN (quotSMAquot) P ParamField (quotPrice fieldquot, -1) Parâmetros Param (quotPeriodsquot, 20, 2, 300, 1, 10) Trama (MA (P, Períodos), DEFAULTNAME (), ParamColor (quotColorquot, colorYellow), ParamStyle (quotStylequot, styleThick) (MA (P, Períodos) l) E Ref (MA (P, Períodos), - 1) gtRef (MA (P, Períodos) 2) gtRef (MA (P, Períodos), - 3) E Ref (MA (P, Períodos), - 3) gtRef 4) gtRef (MA (P, Períodos), - 5) e Ref (MA (P, Períodos), - 5) gtRef (MA (P, Períodos), - 6) isSlopeDN Ref (MA (P, Períodos), - 1) ltRef (MA (P, Períodos), - 2) E Ref (MA (P, Períodos), - 2) ltRef Ref (MA (P, Períodos), - 3) ltRef (MA (P, Períodos), - 4) E Ref (MA (P, ), - 4) ltRef (MA (P, Períodos), - 5) E Ref (MA (P, Períodos) LtC) E Ref (MA (P, Períodos), - 1) gtRef (MA (P, Períodos), - 2) E Ref (MA (P, Períodos) 3) E Ref (MA (P, Períodos), - 1) gtRef (MA (P, Períodos), - 4) E Ref (MA (P, Períodos) 5) AND Ref (MA (P, Períodos), - 1) gtRef (MA (P, Períodos), - 6) isSlpeDN (MA (P, Períodos) gtC) LtRef (MA (P, Períodos), - 2) E Ref (MA (P, Períodos), - 1) LtRef (MA (P, Períodos), - 5) E Ref (MA (P, Períodos), - 1) Converte dados para PlotRange diário (TimeNum () gt 95500 E TimeNum () lt 153500) E (DateNum () LastValue (DateNum ())) FHRange (TimeNum () gt 095500 AND TimeNum () lt 101459) E (DateNum () LastValue (DateNum ())) FHPrices FHRange alto FHMarker BarsSince (FHRangegt0) Encontre o número de barras em 60 minutos NumBars 3 600 (1) TimeFrameSet (inDaily) TOP PDH Ref (Abaixo, -1) PDF Ref (Abaixo, -1) PDF Ref (Abaixo, -1) ) IsAtTal True isRth TimeNum () gt 095400 E TimeNum () lt 101459 isdRth TimeNum () gt 095400 E TimeNum () lt 160000 aRthL IIf (isRth, L, 1000000) aRthH IIf (isdRth, H, Null) aRthLd IIf (isdRth, PDF TimeFrameExpand PDO TimeFrameExpand PDO TimeFrameExpand PDO TimeFrameExpand PDO TimeFrameExpand (PDC, inDaily, expandFirst) PDM TimeFrameExpand (PDD, inDaily, expandFirst) TimeFrameExpand (FHL, inDaily, expandFirst) FHL TimeFrameExpand (FHL, inDaily, expandFirst) FHL TimeFrameCompression (aRthL, inDaily, compressLow) DayH TimeFrameExpand (aRthH, inDaily, compressHigh) (DayH, inDaily, expandFirst) DayL TimeFrameCompress (aRthLd, inDaily, compressLow) DayL TimeFrameExpand (DayL, inDaily, expandFirst ) Fator de achado FC1 ((PDH-PDL) 0,433) FC2 ((PDH-PDL) 0,7666) FC3 ((PDH-PDL) 1,355) FC4 (FHH - FHL) FILTRO AGORA PARA ENCONTRAR O FATOR APLICÁVEL F11IIf ((FC4ltFC1PDH0.005) , FC1,0) F22IIf ((FC4ltFC2PDH0,005 E FC4gtFC1PDH0,005), FC2,0) F33IIf ((FC4ltFC3 E FC4gtFC2PDH0,005), FC3,0) elemento1IIf (F11gt0, F11,0) element2IIf (F22gt0, F22,0 ) E (DateNum () LastValue (DateNum ())) rangHigh-Low nr7sIIf (rangLLV (rang, 7)) F3F0F33) Desde (TimeNum () gt 101459 E TimeNum () , ShapeDigit7shapePositionAbove, shapeNone) nr8sIIf (Ref (nr7s, -1) E rangLLV (rang, 8), shapeDigit8shapePositionAbove, shapeNone) nr7IIf (synch1, nr7s, 0) nr8IIf (synch1, nr8s, 0) (HaC, -1), 0,5) HaH Max (H, Max (HaC, HaO)) HaL Min (L, Min (HaC, HaO)) BG3HHV (HACGTBG3, colorBrightGreen, IIf (Haclt BR3, colorRed, colorGrey50), (BH3HHV (LLV (HaL, 4) ATR (4), 8) BR3LLV (HHV (HaH, 4) - ATR (4) )) Plot (4, quotquot, Co, styleAre AstyleOwnScale styleNoLabel, -1, 100) RestorePriceArrays () SETOREND () filtros adicionais GLong (TOPFHL) E TimeNum () lt 101600 Gshort (TOPFHH) E TimeNum () lt 101600 GLS (AFLT (FHH-FHL)) advanceForeign (quotNSEAdvancingquot, quotHquot ) DeclareForeign (quotNSEDecliningquot, quotHquot) AGORA CALCULE OS PARÂMETROS ENTRY-EXIT-STOPLOSS BuyPrice (DayLAF) BuyTP1 (BuyPrice (BuyPrice (PerctakeProfit100))) BuyTP2 (CgtBuyTP1 OU HgtBuyTP1) SellPrice (DayH-AF) SellTP1 (SellPrice - ))) SellTP2 (CltSellTP1 OU LltSellTP1) TSB IIf (SAR, accm) gtBuyTP1 E SAR (acc, accm) ltL, SAR (acc, accm), BuyTP1) TSB1Cross (TSB, C) (C-PDC) PDC) 100) Vol (VgtVolmin E VltVolmax) Porcentagem (percchangegtPercChangemin E percchangeltPercChangemax ) Prc (CgtpriceRL E CltpriceRH) Buy1 (Vol. E Porcentagem E prc E desde AND (HacgtBG3) E advancegtDecline E (Cruz (C, BuyPrice))) Buy2 (Vol. E Porcentagem E prc AND (Cross (C, BuyPrice))) Short1 (VOL E Percentagem E prc E desde AND advanceltDecline E (HacltBR3) E (Cross (SellPrice, C) BuyStop1 (BuyPrice - (BuyPrice (PercStoploss100))) BuyStop1IIf (BuyStop1lt SellPrice, SellPrice, BuyStop1) BuyStop1 (BuyPrice - (BuyPrice, C)) Buy3 IIf (synch, Buy1, Buy2) SellStop1 (SellPart (SellPrice (PercStoploss100))) SellStop1IIf (SellStop1 gt BuyPrice, BuyPrice, SellStop1) SellStop2 (HgtSellStop1 OU CgtSellStop1) negociação cumulativa tradebase (Buy3 OU Short3 E desde) tradesCum (tradebase) trades2 (tradesgttrades1) buyTargetHit IIf (BuySincegt1 E buyTPSincegt1 E buyStopSince lt 0, 1, 0) buyStoplossHit IIf (buySincegt1 E buyStopSincegt1 E buyTPSince lt 0, 1, 0) Comprar (Buy3 AND trades2 AND isSlopeUP E (NÃO Ref (Buy3, -1) E NÃO Ref (Buy3 , -2) E NÃO REF (Buy3, -3) E NÃO REF (Buy3, -4) E NÃO Ref (Buy3, -5))) Sh (Short3 AND) e NOT Ref (Short3, -1) E NÃO Ref (Short3, -2) AND NOT Ref (Short3, -3) E NÃO Ref (Short3, BuyStopIIf (Buy AND NOT BuyTP2), BuyStop1, Null) SellStopIIf (curto e não SellTP2, SellStop1, Null) BuyTPIf (compra e não BuyStop, BuyTP2, nulo) SellTPIIf (curto e não SellStop, SellTP2, ) tradebaseB experimento (Buy) tradesBCum (tradebaseB) BuyTP3BuyTP2 E TradesBgt1 tradebaseBTP (BuyTP3) tradesBTPCum (tradebaseBTP) Buystop3Buystop2 E TradesBgt1 tradebaseBSL (Buystop3 E desde então) tradesBSLCum (tradebaseBSL) SellTP3SellTP2 E Sellstop3Sellstop2 TradesSgt1 tradebaseSTP (SellTP3) tradesSTPCum (tradebaseSTP) E TradesSgt1 tradebaseSSL ( Sellstop3 E desde) tradesSSLCum (tradebaseSSL) buyTriget (TradesB1) buyTargetHit (TradesBTPgt1) buyStoplossHit (TradesBSLgt1) shortTriggered TradesS1 shortTargetHit (TradesSSPgt1) shortStoplossHit (TradesSSLgt1) final linha fundo da trama Bares BarsSince (TimeNum gt 95400 AND TimeNum lt 101459) BarIndex (), 1) E DateNum () LastValue (DateNum ()) x0 BarCount-LastValue (barras) x1 BarCount-1 TopLine LineArray (x0, LastValue (TOP), x1, LastValue (TOP), 0) PDHLine LineArray (x0, LastValue (PDH) (PDC), x1, LastValue (PDC), x1, LastValue (PDH), 0) PDML Line LineArray (x0, LastValue (PDL), x1, LastValue (PDL) (FHL), x1, LastValue (FHH), 0) FHL Line LineArray (x0, LastValue (FHL), x1, LastValue (FHL) ), 0) BuyPricelineLineArray (x0, LastValue (BuyPrice), x1, LastValue (BuyPrice), 0) BuyStoplineLineArray (x0, LastValue (BuyStop1), x1, LastValue (BuyStop1), 0) BuyTPlineLineArray (x0, SelectedValue (TSB) (0, SellValue), 0) SellPricelineLineArray (x0, LastValue (SellPrice), x1, LastValue (SellPrice), 0) SellStoplineLineArray (x0, LastValue (SellStop1), x1, LastValue 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()

Comments