volume analisis .afl

Upload: 2008anam

Post on 14-Oct-2015

105 views

Category:

Documents


12 download

DESCRIPTION

formula per amibrocker .analisi volume e segnali di ingresso e uscita .e splendidamente dettagliata e decisamente intrigante.

TRANSCRIPT

  • 5/24/2018 Volume Analisis .Afl

    1/29

    /////////////////////////////////////////VSA////////////////////////////////////////////////////////////////Volume Price Analysis AFL - VPA Version 1.0//AFL by Karthikmarar. Detailed explanation available at www.vpanalysis.blogspot.com//====================================================================================

    _SECTION_BEGIN("Volume Price Analysis - V.1.0");SetChartBkColor(16 ) ;SetChartOptions(0,chartShowArrows|chartShowDates);//==============================================================================

    =========DTL=Param("Linear regression period",60,10,100,10);wbf=Param("WRB factor",1.5,1.3,2.5,.1);nbf=Param("NRB factor",0.7,0.3,0.9,0.1);TL=LinRegSlope(MA(C, DTL),2);Vlp=Param("Volume lookback period",15,10,300,10);Vrg=MA(V,Vlp);St = StDev(Vrg,Vlp);Vp3 = Vrg + 3*st;Vp2 = Vrg + 2*st;;Vp1 = Vrg + 1*st;;Vn1 = Vrg -1*st;Vn2 = Vrg -2*st;

    rg=(H-L);arg=Wilders(rg,30);wrb=rg>(wbf*arg);nrb=rgVrg OR V>Ref(V,-1);ucls=x12;mcls=x11.8 ;Vlcls=x1>4;Vhcls=x10 ;utcond1=Ref(utbar,-1) AND dnbar ;utcond2=Ref(utbar,-1) AND dnbar AND V>Ref(V,-1);utcond3=utbar AND V> 2*Vrg;trbar=Ref(V,-1)>Vrg AND Ref(upbar,-1) AND Ref(wrb,-1) AND dnbar AND dcls AND wrb AND tll>0 AND H==HHV(H,10);Hutbar=Ref(upbar,-1) AND Ref(V,-1)>1.5*Vrg AND dnbar AND dcls AND NOT wrb AND NOT utbar;Hutcond=Ref(Hutbar,-1) AND dnbar AND dcls AND NOT utbar;tcbar=Ref(upbar,-1) AND H==HHV(H,5)AND dnbar AND (dcls OR mcls) AND V>vrg AND NO

  • 5/24/2018 Volume Analisis .Afl

    2/29

    T wrb AND NOT Hutbar ;Scond1=(utcond1 OR utcond2 OR utcond3) ;Scond2=Ref(scond1,-1)==0;scond=scond1 AND scond2;stdn0= tllRef(V,-1) AND Ref(dnbar,-1) AND upbar AND (ucls OR mcls) ANDtlsRef(V,-1);eftupfl=Ref(eftup,-1) AND (utbar OR utcond1 OR utcond2 OR utcond3);eftdn=H0 AND tll>0,colorLime,IIf(tls>0 AND tlm>0 AND tll0 AND tlm

  • 5/24/2018 Volume Analisis .Afl

    3/29

    else if( Timeframe != "Daily" ) { VolumeFilter = 0;}// Minimum number of bars required to form a divergence pattern. For a// positive divergence, this is the number of falling bars in the context// of a rising MACD or MACD-H pattern. Vice versa for negative divergenceMACDDivMinWidth = Param("Divergence min width", 4, 1, 10, 1 );// Minimum width of negative projecting wave between two positive MACD-H waves,// otherwise two positive waves will be considered as one single wave. This// minimises invalid divergences, to ensure that "back of bears is broken".// The same applies for a positive wave between two negative waves.

    HistMinWidth = Param("Histogram min width", 4, 1, 10, 1 );PeriodEMA = Optimize( "PeriodEMA ", 13, 5, 23, 1 );// Other parametersOpenPositions = 10;ATRPeriod = 5;InitialCapital = 100000;PeriodFast = Param( "Fast EMA", 8, 2, 200, 1 );PeriodSlow = Param( "Slow EMA", 17, 2, 200, 1 );PeriodSignal = Param( "Signal EMA", 9, 2, 200, 1 );MACDInd = MACD(PeriodFast, PeriodSlow );SigInd = Signal(PeriodFast, PeriodSlow , PeriodSignal );HistInd = MACDInd - SigInd ;

    _N( macdStr = WriteVal( PeriodFast, 1.0 )+","+WriteVal( PeriodSlow , 1.0 ) );

    _N( sigStr = macdStr + ","+WriteVal( PeriodSignal , 1.0 ) );

    // Get displayed min and max value of MACD and MACD-H, to rescale it for bettervisibilityscMACDMax = LastValue(HHV(Max(MACDInd, sigInd),

    BarsSince( Status("barvisible") AND NOT Ref(Status("barvisible"),-1) )));scMACDMin = LastValue(LLV(Min(MACDInd, sigInd),

    BarsSince( Status("barvisible") AND NOT Ref(Status("barvisible"),-1) )));scaleMACD = Max( abs(scMACDMax), abs(scMACDMin) );scHistMax = LastValue(HHV(HistInd,

    BarsSince( Status("barvisible") AND NOT Ref(Status("barvisible"),-1)

    )));scHistMin = LastValue(LLV(HistInd,

    BarsSince( Status("barvisible") AND NOT Ref(Status("barvisible"),-1))));scaleHist = Max( abs(scHistMax), abs(scHistMin) );

    _SECTION_END();//////////////////////////////////////////////////////////////////////////////////////////////////////////MACD Fill///MACD Fill////////End///////////////////////////////////////////////////////////////////////////////////MACD Fill//////////////////////////////////////////////////////////////////////////////////////////////////////////MACD Fill

    _SECTION_BEGIN("Matrix Swing");//=======================================================================================================\\UpBarColor = ParamColor( "UpBar Color", colorGreen );DownBarColor = ParamColor( "DownBar Color", colorRed );MatixSwingSmoother= Param("Smoother", 20, 1, 100, 1);MatrixBuy = ParamColor( "Buy Color", colorGreen );MatrixSell = ParamColor( "Sell Color", colorRed );n=20;Var1=HHV(High,9)-LLV(Low,9);Var2=HHV(High,9)-Close;

  • 5/24/2018 Volume Analisis .Afl

    4/29

    Var3=Close-LLV(Low,9);Var4=Var2/Var1*100-70;Var5=(Close-LLV(Low,60))/(HHV(High,60)-LLV(Low,60))*100;Var6=(2*Close+High+Low)/4;Var7=WMA(Var3/Var1*100,3);Var8=LLV(Low,34);Var9=WMA(Var7,3)-WMA(Var4,9);VarA=IIf(Var9>100,Var9-100,0);VarB=HHV(High,34);AA= VarA*2;BB= EMA((Var6-Var8)/(VarB-Var8)*100,13);

    VarC=EMA(0.667*Ref(BB,-1)+0.333*BB,2);VAR1a=(HHV(High,9)-Close)/(HHV(High,9)-LLV(Low,9))*100-70;VAR2a=WMA(VAR1a,9)+100;VAR3a=(Close-LLV(Low,9))/(HHV(High,9)-LLV(Low,9))*100;VAR4a=WMA(VAR3a,3);VAR5a=WMA(VAR4a,3)+100;VAR6a=VAR5a-VAR2a;S= IIf(VAR6a>n,VAR6a-n,Var6a);barcolor=IIf(Ref(S,-1)

  • 5/24/2018 Volume Analisis .Afl

    5/29

    sito LitWick.**********************************************************/

    /*Colori candele*/whiteBody=C>=O;blackBody=O>C;

    /*Ampiezza candele*/smallBodyMaximum=0.0025;//meno di 0.25%LargeBodyMinimum=0.01;//meno di 1.0%smallBody=(O>=C*(1-smallBodyMaximum) AND whiteBody)

    OR (C>=O*(1-smallBodyMaximum) AND blackBody);largeBody=(C>=O*(1+largeBodyMinimum) AND whiteBody)OR C=C*(1+largeBodyMinimum))OR (blackBody AND H>=O*(1+largeBodyMinimum));

    largeLowerShadow=(whiteBody AND LRef(O,-1),1, IIf(Ref(whiteBody,-1) AND whiteBody AND O>Ref(C,-1),1, IIf(Ref(whiteBody,-1) AND blackBody AND C>Ref(C,-1),1,0))));

    downGap=IIf(Ref(blackBody,-1)AND whiteBody AND C

  • 5/24/2018 Volume Analisis .Afl

    6/29

    engulfing= IIf(blackBody AND Ref(blackbody,-1) AND CRef(O,-1),1, IIf(blackBody AND Ref(whiteBody,-1) AND O>Ref(C,-1) AND CRef(C,-1) AND ORef(O,-1)AND ORef(O,-1) AND ORef(C,-1) AND C

  • 5/24/2018 Volume Analisis .Afl

    7/29

    /*Concealing Baby Swallow only one trade */ConcealingBabySwallow=Ref(marabuzu,-3) AND Ref(blackbody,-3) AND Ref(MArabuzu,-2) AND Ref(blackBody,-2) AND Ref(blackBody,-1) AND Ref(downGap,-1) AND

    Ref(H,-1)>Ref(C,-2)AND Ref(blackbody,-1)ANDblackBody AND engulfing;

    /*Doji Star Bullish*/dojiStarBullish=(dojiStar AND (MLT OR MLY))OR

    (doji AND (C

  • 5/24/2018 Volume Analisis .Afl

    8/29

    stickSandwich=Ref(largeBody,-2) AND Ref(blackbody,-2) ANDRef(largeBody,-1) AND Ref(whiteBody,-1) AND

    Ref(O,-1)>=Ref(C,-2) AND O>=Ref(C,-1) AND abs(C-Ref(C,-2))Ref(C,-1);

    /* Three Outside Up Engulfing confirmation*/

    threeOutsideUp =Ref(engulfingBullish,-1) AND whiteBody AND C>Ref(C,-1);

    /* Three Stars in the South*///Rewrite???threeStarsInTheSouth= Ref(LargeBody,-2) AND Ref(blackBody,-2) AND Ref(largelowerShadow,-2) AND Ref(blackBody,-1) AND Ref(largeLowerShadow,-1) AND

    Ref(L,-1)>Ref(L,-2) AND blackBody AND smallUpperShadow AND smallLowerShadow AND L>Ref(L,-1) AND H

  • 5/24/2018 Volume Analisis .Afl

    9/29

    Ref(smallUpperShadow,-1) AND smallUppershadow AND LLV(L,12)==Ref(L,-2);

    /*Upside Gap Three Methods not very good*/upsideGapThreeMethods=Ref(Largebody,-2) AND Ref(whiteBody,-2) AND Ref(LargeBody,-1) AND Ref(whiteBody,-1) AND Ref(upGap,-1) AND blackBody AND O>Ref(O,-1) AND CRef(O,-2) ANDMHY;

    /*Three Line Strike not good signals*/threeLineStrike=NOT Ref(smallBody,-3) AND NOT Ref(smallBody,-2) AND

    NOT Ref(smallBody,-1) AND Ref(whiteBody,-3) AND Ref(whiteBody,-2) AND

    Ref(whiteBody,-1) AND Ref(C,-1)>Ref(C,-2) AND Ref(C,-2)>Ref(C,-3) AND blackBody AND O>Ref(C,-1) AND CRef(O,-1) AND C

  • 5/24/2018 Volume Analisis .Afl

    10/29

    Ref(LargeBody,-1) AND Ref(whiteBody,-1) AND Ref(C,-1)>Ref(C,-2) AND smallbody AND upGap;

    /*CounterAttackBearish*/CounterAttackBearish=MHT AND LargeBody AND blackbody AND Ref(largeBody,-1) AND Ref(whiteBody,-1) AND CRef(C,-1)*0.9975;;

    /*Doji Star Bearish*/dojiStarBearish=(dojiStar AND (MHT OR MHY))OR

    (doji AND (C>Ref(C,-1) OR O>Ref(C,-1))AND Ref(whiteBody,-1)

    AND Ref(LargeBody,-1));

    /*Engulfing Bearish*/engulfingBearish=engulfing AND largeBody AND blackBody AND

    (Ref(whitebody,-1) OR Ref(Doji,-1))AND (MHT OR MHY);

    /*Evening Doji Star check formula???*/eveningDojiStar=Ref(LargeBody,-2) AND Ref(whiteBody,-2) AND Ref(dojiStar,-1) AND Ref(GapUp(),-1) AND (MHY OR MHT);

    /*Evening Star*/eveningStar=Ref(LargeBody,-2) AND Ref(whiteBody,-2) AND Ref(upGap,-1) AND NOT Ref(largeBody,-1) AND blackBody AND NOT smallBody AND

    (MHT OR MHY);

    /*Hammer Bearish*/HammerBearish=Hammer AND HHV(H,8)==H;

    /*hangingMan*/HangingMan=NOT largeBody AND smallUpperShadow AND LargeLowerShadow AND MHT;

    /*dragonfly Doji Bearish*/dragonflyDojiBearish=doji AND smallUpperShadow AND LargeLowerShadow AND MHT;/*Harami Bearish-*/HaramiBearish=harami AND Ref(Largebody,-1) AND Ref(whiteBody,-1)AND blackBody

    AND (MHY OR MHT);

    /*HaramiCross Bearish*/HaramiCrossBearish=harami AND doji AND Ref(whiteBody,-1) AND Ref(Largebody,-1);

    /*Identical three black crows*/idendicalThreeBlackCrows=Ref(blackBody,-2) AND Ref(blackBody,-1) AND blackBody AND abs(Ref(C,-2)-Ref(O,-1))

  • 5/24/2018 Volume Analisis .Afl

    11/29

    shootingStarGap=shootingStar AND GapUp() AND MHT;

    /*Gravestone Doji*/gravestoneDoji=doji AND largeUpperShadow AND smallLowerShadow AND GapUp()AND MHT;

    /*Three Inside Down Bearish*/threeInsideDownBearish=Ref(HaramiBearish,-1) AND blackBody AND CRef(O,-1) AND CRef(C,-2)AND Ref(C,-2)>Ref(C,-3) AND LargeBody AND blackBody AND O>Ref(C,-4) AND

    O

  • 5/24/2018 Volume Analisis .Afl

    12/29

    /*On Neck Bearish not good*/OnNeckBearish=Ref(LargeBody,-1) AND Ref(blackBody,-1) AND whiteBody AND ORef(O,-1)*0.9975 AND O

  • 5/24/2018 Volume Analisis .Afl

    13/29

    homingPigeon ORinvertedHammer ORmeetingLinesbullish ORpiercingLine ORstickSandwich ORthreeStarsInTheSouth ORtriStarBullish ORthreeriverBottom ORseparatingLinesBullish ORupsideGapThreeMethods ORthreeLineStrike OR

    tweezerBottom ORupsideTasukiGap;

    /************************************Regole di Short (bassa e media affidabilit)*************************************Short=advanceBlockBearish ORbeltHoldBearish ORbreakAwayBearish ORHangingMan ORdeliberationBearish ORCounterAttackBearish OR

    engulfingBearish ORHammerBearish ORdragonflyDojiBearish ORHaramiBearish ORHaramiCrossBearish ORMeetingLinesBearish ORshootingStarGap ORgravestoneDoji ORtriStarBearish ORtwoCrows ORdojiStarBearish ORdownsideGapThreeMethods ORdownsideTasukiGap OR

    inNeckBearish OROnNeckBearish ORseparatingLinesBearish ORsideBySideWhiteLinesBearish ORthreeLineStrike ORthrustingBearish ORtweezerTop;

    /************************************Regole di Sell (alta affidabilit)*************************************Sell=AbandonedBabyBearish OR

    darkCloudCover OReveningDojiStar OReveningStar ORidendicalThreeBlackCrows ORkickingBearish ORthreeInsideDownBearish ORthreeoutsideDownBearish ORupsideGapTwoCrows ORfallingThreeMethods ORthreeBlackCrows;

  • 5/24/2018 Volume Analisis .Afl

    14/29

    */

    _SECTION_END();

    ///////////////////////////////////////////Candle Des//////////////////////////////////////////////////////////////////////////////////End////////////////////////////////////////////////////////////////////

    // Trend Detection// Graham Kavanagh 11 Jan 05// I am using version 4.66.2, but believe this will work with last offical Version.

    function Rise( Pd, perd, Pl, perl ){MAD = DEMA(Pd,perd);MAL = LinearReg(Pl,perl);CondR = ROC(MAD,1)>0 AND ROC(MAL,1)>0;CondF = ROC(MAD,1)

  • 5/24/2018 Volume Analisis .Afl

    15/29

    for(i=1;i 0 AND ROC(Confirm,5) > 0;

    Downward = ROC(Confirm,1) < 0 AND ROC(Confirm,5) < 0;

    Select = Rs AND Ref(Fs,-1);Caution = Fs AND Ref(Rs,-1);

    Change = IIf( Rs, H/ValueWhen(Fs,L)*100, L/ValueWhen(Rs,H)*100 );

    //Plot( C, "close", IIf( Rs, colorGreen, IIf( Fs, colorRed, colorBlack )), styleBar);

    //GraphXSpace=10;//_N( Title = "{{NAME}} - {{INTERVAL}} {{DATE}} Trend Plot - "+prdd+" Day" );

    Filter = Select OR Caution;AddColumn( Select, "UpTurn", 1 );AddColumn( Caution, "DownTurn", 1 );

    // ---indicator end---//"Rise = " + Rs;//"Fall = " + Fs;//"Current Trend Bars = " + Bs;//"Trend Move = " + Change + " %";/*

    Heikin-Ashi(Koma-Ashi) with Moving Average Type

    */

    UpCandle = ParamColor("Up Color", colorBrightGreen );DownCandle = ParamColor("Down Color", colorRed );Consolidation = ParamColor("Consolidation", colorWhite );

    MACDColorUp = ParamColor("MACD Up", colorDarkGreen );MACDColorDown = ParamColor("MACD Down", colorDarkRed );Prd1=Param("ATR Period",4,1,20,1);Prd2=Param("Look Back",8,1,20,1);

  • 5/24/2018 Volume Analisis .Afl

    16/29

    SetChartOptions(2, chartWrapTitle);

    // Calculate Moving AverageMAPeriod = Param("MA Period", 4, 1, 100);MAOpen = EMA(Open, MAPeriod);MAHigh = EMA(High, MAPeriod);MALow = EMA(Low, MAPeriod);MAClose = EMA(Close, MAPeriod);

    HaClose = (MAOpen + MAHigh + MALow + MAClose) / 4;HaOpen = AMA(Ref(HaClose, -1), 0.5);

    // for graph collapse//for(i = 0; i BrightGreen ,UpCandle,IIf(C < BrightRed,DownCandle,Consolidation));

    //SetBarFillColor( );SetBarFillColor(IIf(Mbuy,colorBlue,IIf(MSell, colorYellow,IIf(MACDInd >SigInd, MACDColorUp,MACDColorDown))));

    PlotOHLC( HaOpen, HaHigh, HaLow, HaClose, "", barcolor, styleCandle|styleNoLabel);

    //////////////////////////////////////////////////////////////////////////////

  • 5/24/2018 Volume Analisis .Afl

    17/29

    _SECTION_BEGIN("Pivot");nBars = Param("Number of bars", 12, 5, 40);bShowTCZ = Param("Show TCZ", 1, 0, 1);nExploreBarIdx = 0;nExploreDate = 0;nCurDateNum = 0;DN = DateNum();DT = DateTime();bTCZLong = False;bTCZShort = False;nAnchorPivIdx = 0;

    ADX8 = ADX(8);if(Status("action")==1) {bDraw = True;bUseLastVis = 1;

    } else {bDraw = False;bUseLastVis = False;bTrace = 1;nExploreDate = Status("rangetodate");for (i=LastValue(BarIndex());i>=0;i--) {

    nCurDateNum = DN[i];if (nCurDateNum == nExploreDate) {

    nExploreBarIdx = i;

    }}}GraphXSpace=7;if (bDraw) {}aHPivs = H - H;aLPivs = L - L;aHPivHighs = H - H;aLPivLows = L - L;aHPivIdxs = H - H;aLPivIdxs = L - L;aAddedHPivs = H - H;

    aAddedLPivs = L - L;aLegVol = H - H;aRetrcVol = H - H;nHPivs = 0;nLPivs = 0;lastHPIdx = 0;lastLPIdx = 0;lastHPH = 0;lastLPL = 0;curPivBarIdx = 0;aHHVBars = HHVBars(H, nBars);aLLVBars = LLVBars(L, nBars);aHHV = HHV(H, nBars);

    aLLV = LLV(L, nBars);nLastVisBar = LastValue(

    Highest(IIf(Status("barvisible"), BarIndex(), 0)));curBar = IIf(nlastVisBar > 0 AND bUseLastVis, nlastVisBar,

    IIf(Status("action")==4 AND nExploreBarIdx > 0, nExploreBarIdx,LastValue(BarIndex())));

    curTrend = "";if (aLLVBars[curBar] < aHHVBars[curBar])

    curTrend = "D";else

  • 5/24/2018 Volume Analisis .Afl

    18/29

    curTrend = "U";if (curBar >= 120) {

    for (i=0; i 0 AND bUseLastVis,

    nlastVisBar-i,IIf(Status("action")==4 AND nExploreBarIdx > 0,nExploreBarIdx-i,LastValue(BarIndex())-i));

    if (aLLVBars[curBar] < aHHVBars[curBar]) {if (curTrend == "U") {

    curTrend = "D";

    curPivBarIdx = curBar - aLLVBars[curBar];aLPivs[curPivBarIdx] = 1;aLPivLows[nLPivs] = L[curPivBarIdx];aLPivIdxs[nLPivs] = curPivBarIdx;nLPivs++;

    }} else {

    if (curTrend == "D") {curTrend = "U";curPivBarIdx = curBar - aHHVBars[curBar];aHPivs[curPivBarIdx] = 1;aHPivHighs[nHPivs] = H[curPivBarIdx];aHPivIdxs[nHPivs] = curPivBarIdx;

    nHPivs++;}}

    }}curBar =

    IIf(nlastVisBar > 0 AND bUseLastVis,nlastVisBar,IIf(Status("action")==4 AND nExploreBarIdx > 0,nExploreBarIdx,LastValue(BarIndex())));

    if (nHPivs >= 2 AND nLPivs >= 2) {

    lastLPIdx = aLPivIdxs[0];lastLPL = aLPivLows[0];lastHPIdx = aHPivIdxs[0];lastHPH = aHPivHighs[0];nLastHOrLPivIdx = Max(lastLPIdx, lastHPIdx);nAddPivsRng = curBar - nLastHOrLPivIdx;aLLVAfterLastPiv = LLV(L, nAddPivsRng);nLLVAfterLastPiv = aLLVAfterLastPiv[curBar];aLLVIdxAfterLastPiv = LLVBars(L, nAddPivsRng);nLLVIdxAfterLastPiv = curBar - aLLVIdxAfterLastPiv[curBar];aHHVAfterLastPiv = HHV(H, nAddPivsRng);nHHVAfterLastPiv = aHHVAfterLastPiv[curBar];aHHVIdxAfterLastPiv = HHVBars(H, nAddPivsRng);

    nHHVIdxAfterLastPiv = curBar - aHHVIdxAfterLastPiv[curBar];if (lastHPIdx > lastLPIdx) {

    /* There are at least two possibilities here. One is that the previous high was higher, indicating that this is a

    possible short retracement or one in the making. The other is that the previous high was lower, indicatin

    gthat this is a possible long retracement in the working.

  • 5/24/2018 Volume Analisis .Afl

    19/29

    However, both depend on opposing pivots. E.g., if I find

    higher highs, what if I have lower lows?

    If the highs are descending, then I can consider: - a lower low, and leave it at that - a higher high and higher low - a lower low and another lower high

    */if (aHPivHighs[0] < aHPivHighs[1]) {

    if (nLLVAfterLastPiv < aLPivLows[0] AND(nLLVIdxAfterLastPiv - lastHPIdx - 1) >= 1AND nLLVIdxAfterLastPiv != curBar ) {

    // -- OK, we'll add this as a pivot.// Mark it for plotting...aLPivs[nLLVIdxAfterLastPiv] = 1;aAddedLPivs[nLLVIdxAfterLastPiv] = 1;

    // ...and then rearrange elements in the// pivot information arraysfor (j=0; j aLPivLows[0] AND(nLLVIdxAfterLastPiv - lastHPIdx - 1) >= 1AND nLLVIdxAfterLastPiv != curBar ) {

    // -- OK, we'll add this as a pivot.// Mark it for plotting...aLPivs[nLLVIdxAfterLastPiv] = 1;aAddedLPivs[nLLVIdxAfterLastPiv] = 1;

    // ...and then rearrange elements in the// pivot information arraysfor (j=0; j

  • 5/24/2018 Volume Analisis .Afl

    20/29

    nLPivs++;

    // -- Test whether to add piv given last piv is high// AND we have lower highs}

    // -- The last piv is a high and we have higher highs// OR lower highs}

    /* ****************************************************************Still finding missed pivot(s). Here, the last piv is a low piv.

    **************************************************************** */} else {

    // -- First casevar, lower highsif (aHPivHighs[0] < aHPivHighs[1]) {

    if (nHHVAfterLastPiv < aHPivHighs[0] AND(nHHVIdxAfterLastPiv - lastLPIdx - 1) >= 1AND nHHVIdxAfterLastPiv != curBar ) {

    // -- OK, we'll add this as a pivot.// Mark that for plottingaHPivs[nHHVIdxAfterLastPiv] = 1;

    aAddedHPivs[nHHVIdxAfterLastPiv] = 1;

    // ...and then rearrange elements in the// pivot information arraysfor (j=0; j aHPivHighs[0] AND

    (nHHVIdxAfterLastPiv - lastLPIdx - 1) >= 1

    AND nHHVIdxAfterLastPiv != curBar ) {

    // -- OK, we'll add this as a pivot.// Mark it for plotting...aHPivs[nHHVIdxAfterLastPiv] = 1;aAddedHPivs[nHHVIdxAfterLastPiv] = 1;

    // ...and then rearrange elements in the// pivot information arraysfor (j=0; j

  • 5/24/2018 Volume Analisis .Afl

    21/29

    aHPivHighs[nHPivs-j] = aHPivHighs[nHPivs-(j+1)];

    aHPivIdxs[nHPivs-j] = aHPivIdxs[nhPivs-(j+1)];

    }aHPivHighs[0] = nHHVAfterLastPiv;aHPivIdxs[0] = nHHVIdxAfterLastPiv;nHPivs++;

    // -- Test whether to add piv given last piv is high// AND we have lower highs

    }

    }

    }

    // -- If there are at least two of each}

    /* ****************************************// -- Done with finding pivots***************************************** */

    if (bDraw) {PivotEntry = ParamColor( "Entry Color", colorBrightGreen );PivotEntry2 = ParamColor( "Entry Color2", colorYellow );PivotExit = ParamColor( "Exit Color", colorRed );PivotExit2 = ParamColor( "Exit Color2", colorYellow );

    // -- OK, let's plot the pivots using arrowsPlotShapes(

    IIf(aHPivs==1, shapeSquare, shapeNone),PivotExit, 0, High, Offset=30);

    PlotShapes(IIf(aAddedHPivs==1, shapeSquare, shapeNone),

    PivotExit2, 0, High, Offset=30);PlotShapes(

    IIf(aLPivs==1, shapeSquare , shapeNone),PivotEntry, 0, Low, Offset=-30);

    PlotShapes(IIf(aAddedLPivs==1, shapeSquare , shapeNone),

    PivotEntry2, 0, Low, Offset=-30);

    PlotShapes(IIf(aHPivs==1, shapeSquare, shapeNone),

    colorBlack, 0, High, Offset=35);PlotShapes(

    IIf(aAddedHPivs==1, shapeSquare, shapeNone),colorBlack, 0, High, Offset=35);

    PlotShapes(

    IIf(aLPivs==1, shapeSquare , shapeNone),colorBlack, 0, Low, Offset=-35);

    PlotShapes(IIf(aAddedLPivs==1, shapeSquare , shapeNone),

    colorBlack, 0, Low, Offset=-35);

    PlotShapes(IIf(aAddedHPivs==1, shapeSmallCircle, shapeNone),

    PivotExit2, 0, High, Offset=30);

  • 5/24/2018 Volume Analisis .Afl

    22/29

    PlotShapes(IIf(aAddedLPivs==1, shapeSmallCircle , shapeNone),

    colorYellow, 0, Low, Offset=-30);

    }

    /* ****************************************// -- Done with discovering and plotting pivots***************************************** */

    _SECTION_END();

    _SECTION_BEGIN("Bollinger Bands");P = ParamField("Price field",-1);Periods = Param("Periods", 15, 2, 100, 1 );Width = Param("Width", 2, 0, 10, 0.05 );Color = ParamColor("Color", colorCycle );Style = ParamStyle("Style");Plot( BBandTop( P, Periods, Width ), "BBTop" + _PARAM_VALUES(), colorWhite, styleThick );Plot( BBandBot( P, Periods, Width ), "BBBot" + _PARAM_VALUES(), colorWhite, styleThick );

    _SECTION_END();

    //////////////////////////////////////////////////////////////////////////_SECTION_BEGIN("Peak");

    PK = HaHigh > Ref(HaHigh,-1) AND Ref(HaHigh,1) < HaHigh;//PeakPKV0 = ValueWhen(PK,HaHigh,0);//PeakValue0PKV1 = ValueWhen(PK,HaHigh,1);//PeakValue1PKV2 = ValueWhen(PK,HaHigh,2);//PeakValue2MPK = PKV2 < PKV1 AND PKV1 > PKV0 ;//MajorPeakMPKV = ValueWhen(Ref(MPK,-1) == 0 AND MPK == 1, PKV1,1); //MajorPeakValueMPKD = ValueWhen(Ref(MPK,-1) == 0 AND MPK == 1, DateNum(),1); //MajorPeakDateSD = IIf(DateNum() < LastValue(MPKD,lastmode = True ), Null, LastValue(MPKV,Lastmode = True));//SelectedDate

    Plot(SD, "LastMinorResistance",colorDarkGrey,styleLine);

    //PLOT THE SECOND LAST MAJOR PEAK RESISTANCE LINEMPKV2 = ValueWhen(Ref(MPK,-1) == 0 AND MPK == 1, PKV1,2); //MajorPeakValueMPKD2 = ValueWhen(Ref(MPK,-1) == 0 AND MPK == 1, DateNum(),2); //MajorPeakDateSD2 = IIf(DateNum() < LastValue(MPKD2,lastmode = True ), Null, LastValue(MPKV2,Lastmode = True));//SelectedDatePlot(SD2, "LastMajorResistance",colorDarkGrey,styleLine);

    _SECTION_END();

    _SECTION_BEGIN("Support");SP = Ref(HaLow,1) > HaLow AND HaLow < Ref(HaLow,-1);//PeakSPV0 = ValueWhen(SP,HaLow,0);//PeakValue0

    SPV1 = ValueWhen(SP,HaLow,1);//PeakValue1SPV2 = ValueWhen(SP,HaLow,2);//PeakValue2MSP = SPV2 > SPV1 AND SPV1 < SPV0 ;//MajorPeakMSPV = ValueWhen(Ref(MSP,-1) == 0 AND MSP == 1, SPV1,1);MSPD = ValueWhen(Ref(MSP,-1) == 0 AND MSP == 1, DateNum(),1);SD = IIf(DateNum() < LastValue(MSPD,lastmode = True ), Null, LastValue(MSPV,Lastmode = True));Plot(SD,"LastMinorSupport",colorDarkGrey,styleLine);

  • 5/24/2018 Volume Analisis .Afl

    23/29

    MSPV2 = ValueWhen(Ref(MSP,-1) == 0 AND MSP == 1, SPV1,2);MSPD2 = ValueWhen(Ref(MSP,-1) == 0 AND MSP == 1, DateNum(),2);SD2 = IIf(DateNum() < LastValue(MSPD2,lastmode = True ), Null, LastValue(MSPV2,Lastmode = True));Plot(SD2,"LastMajorSupport",colorDarkGrey,styleLine);

    _SECTION_END();

    _N(Title = StrFormat("\\c02**AAA2nd.formula**...{{NAME}} | {{DATE}} | {{VALUES}}",O, H, L, C, SelectedValue( ROC( C, 1 )) )

    +"\n"+EncodeColor(colorOrange) +"Open = " + EncodeColor(colorWhite) + O +"\n"+EncodeColor(colorOrange) +"High = " + EncodeColor(5) + H +"\n"+EncodeColor(colorOrange) +"Low = " + EncodeColor(colorRed) + L+"\n"+WriteIf( Ref(C,-1)Vp2,EncodeColor(colorLime)+"Very High",WriteIf(V>Vp1,EncodeColor(colorLime)+" High",WriteIf(V>Vrg,EncodeColor(colorLime)+"Above Average",

    WriteIf(VVn1,EncodeColor(colorRed)+"Less than Average",WriteIf(V

  • 5/24/2018 Volume Analisis .Afl

    24/29

    +EncodeColor(colorRed)+WriteIf(utcond2 , "Also here the volume is high( Above Average).\nThis is a sure sign of weakness. \nThe Smart Money is locking in Traders into \npoor positions","")+EncodeColor(colorBrightGreen)+WriteIf(stdn, "Strength Bar. The stock has been in a down Trend. \nAn upbar with higher Volume closing near the High \nis a signof strength returning. \nThe downtrend is likely to reverse soon. ","")+EncodeColor(colorBrightGreen)+WriteIf(stdn1,"Here the volume is very much aboveaverage. \nThis makes this indication more stronger. ","")+EncodeColor(colorBrightGreen)+WriteIf(bycond,"The previous bar saw strength coming back. \nThis upbar confirms strength. ","")+EncodeColor(colorRed)+WriteIf(Hutbar," A pseudo Upthrust. This normally appears

    after an Up Bar \nwith above average volume. This looks like \nan upthrust barclosing down near the Low. \nBut the Volume is normally Lower than average. \nthis is a sign of weakness.If the Volume is High then weakness increases. \nSmartMoney is trying to trap the retailers \ninto bad position. ","")+EncodeColor(colorRed)+WriteIf(Hutcond, "A downbar after a pseudo Upthrust Confirms weakness. \nIf the volume is above average the weakness is increased. ","")+EncodeColor(colorBrightGreen)+WriteIf(Lvtbar2,"The previous bar was a successful Test of supply.\n The current bar is a upbar with higher volume. \nThis confirms strength","")+EncodeColor(colorPink)+WriteIf(dbar,"A wide range, high volume bar in a up trend closing \ndown is an indication the Distribution is in progress. \nThe smart money is Selling the stock to the late Comers rushing \nto Buy the stock NOT to be Left Out Of a \nBullish move. ","")

    +EncodeColor(colorBrightGreen)+WriteIf(Lvtbar1, "Test for supply in a uptrend. Sign of Strength. ","")+EncodeColor(colorRed)+WriteIf(tcbar,"The stock has been moving up on high volume. \nThe current bar is a Downbar with high volume. \nIndicates weakness and probably end of the up move","")+EncodeColor(colorBrightGreen)+WriteIf(eftup,"Effort to Rise bar. This normallyfound in the \nbeginning of a Markup Phase and is bullish sign.\nThese may be found at the top of an Upmove as the \nSmart money makes a last effort to move theprice \nto the maximum","")+EncodeColor(colorRed)+WriteIf(eftdn,"Effort to Fall bar. This normally found in\nthe beginning of a Markdown phase.","")+EncodeColor(colorGreen)+WriteIf(nsbar,"No Supply. A no supply bar indicates supply \nhas been removed and the Smart money can markup the price. \nIt is better

    to wait for confirmation","")+EncodeColor(colorPink)+WriteIf(stvol,"Stopping Volume. This will be an downbar\nduring a bearish period closing towards the Top accompanied \nby High volume.A stopping Volume normally \nindicates that smart money is absorbing the supplywhich is a Indication that they are Bullishon the MArket. Hence we Can expect areversal in the down trend. ","")+EncodeColor(colorRed)+WriteIf(ndbar, "No Demand Brief \nDescription: Any up barwhich closes in the middle OR Low, \nespecially if the Volume has fallen off, \nis a potential sign of weakness.\nThings to Look Out for:if the market is stillstrong, \nyou will normally see signs of strength in the next\n few bars, whichwill most probably show itself as a:\n * Down bar with a narrow spread, closingin the middle OR High. \n* Down bar on Low Volume.","")+EncodeColor(colorRed)+WriteIf (eftupfl, "Effort to Move up has failed. Bearish

    sign ","")//+WriteIf (stvol, "Stopping volume. Normally indicates end of bearishness is nearing. ","")++EncodeColor(colorRed)+WriteIf (utcond2 AND NOT utcond1, " A High Volume downbarafter an Upthrust. Confirm weakness.","")+EncodeColor(colorBrightGreen)+WriteIf (stdn0 AND NOT stdn, "Strength seen returning after a down trend. ","")+EncodeColor(colorBrightGreen)+WriteIf (stdn AND NOT stdn1, "Strength seen returning after a long down trend. ","")+EncodeColor(colorBrightGreen)+WriteIf (Lvtbar, "Test for supply. ","")

  • 5/24/2018 Volume Analisis .Afl

    25/29

    +EncodeColor(colorBrightGreen)+WriteIf (stdn2, "High volume upbar closing on thehigh indicates strength. ","")

    +"\n"+"\n"+"\n"+"\n"+/**************************************************Standards of Cover (Moderate and low Reliability)/***************************************************/EncodeColor(colorBrightGreen)+WriteIf(beltHoldBullish,"(+) Belt Hold Bullish. Pattern reversal.\nThe wider the

    candle, the more significant.\nReliability second LitWick: Low. \n","") +WriteIf(breakAwayBullish,"(+) breakvar Away Bullish. Pattern reversal.\nReliability second LitWick: Moderate \n","") +WriteIf(dojiStarBullish,"(+) Bullish doji Star. Pattern reversal.\nNison: Requires confirmation. Best sign on top.\nReliability second LitWick: Moderate \n","")+WriteIf(hammerBullish,"(+) Bullish Hammer. Pattern reversal.\nNison: The longerthe tail lower (shadow), is shorter than the upper tail AND smaller the body ofthe candle, the more significant the pattern. The candles are white rialziste more than the black body with candles.\nReliability Second LitWick: Low. \n","") +WriteIf(dragonflyDoji,"(+) Dragonfly Doji. Reliability second LitWick: Moderate\n","") +WriteIf(haramiBullish, "(+) Harami Bullish. Pattern reversal.\nNison: Insignific

    ant. The pattern requires confirmation. \nReliability second LitWick: Low. \n","") +WriteIf(HaramiCross,"(+) Harami Cross. Pattern reversal.\nNison: Best indicatorHarami. Best on the maximum signal that the minimum. \nReliability second LitWick: Low. \n","") +WriteIf(homingPigeon,"(+) Homing Pigeon. Pattern reversal.\nReliability second LitWick: Moderate \n","") +WriteIf(invertedHammer,"(+) Inverted Hammer. Pattern reversal.\nNison: Requiresconfirmation bullish.\nReliability second LitWick: Low. \n","") +WriteIf(meetingLinesbullish,"(+) Meeting Lines bullish. Pattern reversal.\nReliability second LitWick: Moderate \n","") +WriteIf(piercingLine,"(+) Piercing Line. Pattern reversal.\nNison: a pattern ofstrong inversion.\nReliability second LitWick: Moderate \n","") +

    WriteIf(stickSandwich,"(+) Stick Sandwich. Pattern reversal.\nReliability secondLitWick: Moderate \n","") +WriteIf(threeStarsInTheSouth,"(+) 3 Stars in the South. Pattern reversal.\nReliability second LitWick: Moderate \n","") +WriteIf(triStarBullish,"(+) Tri-Star Bullish. Pattern reversal.\nNison: Patternsof significant reversal.\nReliability second LitWick: Moderate \n","") +WriteIf(threeriverBottom,"(+) 3 River Bottom. Pattern reversal.\nNison: The selling pressure is decreasing.\nReliability Second LitWick: Moderate \n","") +WriteIf(separatingLinesBullish,"(+) Separating Lines Bullish. Pattern continued.\nReliability second LitWick: Low. \n","") +WriteIf(upsideGapThreeMethods,"(+) Upside Gap 3 Methods. Pattern continued.\nReliability second LitWick: Moderate \n","") +WriteIf(threeLineStrike,"(+) 3 Line Strike. Pattern continued.\nReliability seco

    nd LitWick: Low. \n","") +WriteIf(tweezerBottom,"(+) Tweezer Bottom. Pattern reversal. Together with othercandles reversal may indicate a level of support.\nNison: Requires confirmation. \n","") +WriteIf(upsideTasukiGap,"(+) Upside Tasuki Gap. Pattern continued.\nNison: the bodies of two candles in the gap should be of similar magnitude.\nReliability second LitWick: Moderate \n","") +

  • 5/24/2018 Volume Analisis .Afl

    26/29

    /************************************** Commenti*************************************** Candles bullish - Bullish****************************************/EncodeColor(colorGreen)+WriteIf(abandonedBabybullish,"(+) Abandoned Baby Bullish. Pattern reversal.\nReliability second LitWick: high. \n","") +WriteIf(ConcealingBabySwallow,"(+) Concealing Baby Swallow. Pattern reversal.\nReliability second LitWick: high. \n","") +WriteIf(engulfingBullish,"(+) Bullish Engulfing. Pattern reversal.\nNison: The f

    actors that increase the effect of the pattern are\n 1) The first day (before) the candle has a small body on the second day and has a wide body.\n 2) The pattern appears after a move very fast or very protracted. \n 3) High Volume on the second day (current).\n 4)The days seconfo covers (Engulfs) more of a candle.\n Reliability second LitWick: Moderate \n","") +WriteIf(morningDojiStar,"(+) Morning Doji Star. Pattern reversal.\nImportant sign of reversal.\nReliability second LitWick: high. \n","") +WriteIf(morningStar,"(+) Morning Star. Pattern reversal.\nNison: Better according to increase the size of the white candle (third).\nReliability Second LitWick: high. \n","") +WriteIf(threeInsideUp,"(+) 3 Inside Up. Pattern reversal.\nReliability second LitWick: high. \n","") +WriteIf(threeOutsideUp,"(+) 3 Outside Up. Pattern reversal.\nReliability second

    LitWick: High. \n","") +WriteIf(MAtHoldBullish,"(+) Mat Hold Bullish. Pattern continued.\nNison: 2-4 mayhave black candles.\nReliability Second LitWick: High. \n","") +WriteIf(risingThreeMethods,"(+) Rising Three Methods. Pattern continued.>\nNison: Ha maggior significato se il volume delle candele bianche maggiore rispetto aquello delle candele nere.\nReliability second LitWick: High. \n","") +WriteIf(sideBySideWhiteLines,"(+) Side by Side White Lines. Pattern continued.\nNison: if in a downtrend may be caused by ricoperture be Short.\nReliability Second LitWick: High. \n","") +WriteIf(threeWhiteSoldiers,"(+) 3 White Soldiers. Pattern continued.\nNison: Positive, but pay attention to such negative pattern of stalemate and subsequent pattern of the block.\nReliability second LitWick: High. \n","") +/***************************************

    Candle Down - Bearish********************************************/EncodeColor(colorRed)+

    WriteIf(AbandonedBabyBearish,"(-) Abandoned Baby Bearish. Pattern reversal.\nNison: Extremely rare.\nReliability second LitWick: High. \n","") +WriteIf(advanceBlockBearish,"(-) Advancing Block Bearish. Pattern reversal.\nNison: Rally has problems. A sign of weakness could be a gradual decrease in the bodies of white candles OR the presence of relatively higher long queues on the last two white candles. NOT necessarily a reversal pattern.\nReliability Second LitWick: Moderate \n","") +WriteIf(darkCloudCover,"(-) Dark Cloud Cover. Pattern reversal.\nNison: Factorsthat indicate the importance of this signal is: \n 1) Magggior penetration of th

    e first candle in the second. \n 2) If both candles are marabozu. \n 3) The bodyof the second candle on a significant level of resistance. \n 4) High-volume days in socondo.\nReliability second LitWick: High. \n","") +WriteIf(eveningDojiStar,"(-) Evening Doji Star. Pattern reversal.\nNison: must be confirmed by a long black candle.\nReliability second LitWick: High. \n","") +WriteIf(eveningStar,"(-) Evening Star. Pattern reversal.\nNison: the gap betweenthe second and third candle body is not always present.\nReliability second LitWick: High. \n","") +WriteIf(HammerBearish,"(-) Bearish Hammer. Pattern reversal.\nNison: more bearish if the hammer is black. E 'bearish confirmation needed. A significant gap down

  • 5/24/2018 Volume Analisis .Afl

    27/29

    the next day will be confirmed. \n","") +WriteIf(dragonflyDojiBearish,"(-) Dragonfly Bearish. Pattern reversal.\nNison: as in 'Hanging Man'.\nReliability Second LitWick: Moderate \n","") +WriteIf(HaramiBearish,"(-) Harami Bearish. Pattern reversal.\nNison: not as significant as' hanging man 'and' engulfing '.\nReliability second LitWick: Low. \n","") +WriteIf(idendicalThreeBlackCrows,"(-) Identical 3 Black Crows. Pattern di inversione in uptrend.\nNison: very bearish.\nReliability Second LitWick: High. \n","") +WriteIf(kickingBearish,"(-) Kicking Bearish. Pattern reversal.\nReliability second LitWick: High. \n","") +

    WriteIf(threeInsideDownBearish,"(-) 3 Inside Down. Pattern reversal.\nReliability second LitWick: High. \n","") +WriteIf(threeoutsideDownBearish,"(-) 3 Outside Down. Pattern reversal.\nReliability second LitWick: High. \n","") +WriteIf(upsideGapTwoCrows,"(-) Upside Gap 2 Crows. Pattern reversal.\nNison: requires confirmation with inversion continued on the third day.\nReliability second LitWick: High. \n","") +WriteIf(fallingThreeMethods,"(-) Falling 3 Methods. Pattern continued.\nReliability second LitWick: High. \n","") +WriteIf(threeBlackCrows,"(-) 3 Black Crows. Pattern reversal.\nNison: should look after a rise 'mature'.\nReliability Second LitWick: High. \n","") +/*********************************************** Short sell

    **************************************************/EncodeColor(colorPink)+WriteIf(beltHoldBearish,"(-) Belt Hold Bearish. Pattern reversal.\nNison: The longer the height of the candle is the most significant pattern.\nReliability second LitWick: Low. \n","") +WriteIf(breakAwayBearish,"(-) breakvar Away Bearish. Pattern reversal.\nReliability second LitWick: Moderate \n","") +WriteIf(HangingMan,"(-) Hanging Man. Pattern reversal.\nNison: Such a 'bearish hammer' with a significant gap down the next day. \nReliability second LitWick: Low. \n","") +WriteIf(deliberationBearish,"(-) Deliberation Bearish. Pattern reversal.\nNison:It is not a real pattern of reversal, but a sign that the rally is weakening. \

    n Reliability second LitWick: Moderate \n","") +WriteIf(CounterAttackBearish,"(-) Counter Attack Bearish.\nNison: un potenzialestallo del rally. \n","") +WriteIf(engulfingBearish,"(-) Engulfing Bearish. Pattern reversal.\nNison: Important sign of reversal. The factors that increase the importance of the patternsare: \n 1) above the candle has a very small body AND the Second candle is a very large body. \n 2) the pattern appears after a protracted OR moving very fast.\n 3 ) High volumes in the Second Day. \n 4) on the Second Day covers the body more than a body of candles before.\nReliability Second LitWick: Moderate \n","")+WriteIf(HaramiCrossBearish,"(-) Harami Cross Bearish. Pattern reversal.\nNison:more significant downtrend pattern of 'Harami'. The second day, the candle can be white or black.\nReliability second LitWick: Moderate \n","") +

    WriteIf(MeetingLinesBearish,"(-) Meeting Lines Bearish. Pattern reversal.\nReliability second LitWick: moderate, but not so strong as' Dark Cloud Cover '. \n","") +WriteIf(shootingStarGap,"(-) Shooting Star. Pattern reversal.\nNison: not so important as an 'evening star'. Ideally, the body of the candle should be in a gapfrom the body of the candle before. It should appear after a positive trend.\nReliability second LitWick: Low. \n","") +WriteIf(gravestoneDoji,"(-) Gravestone Doji. Pattern reversal.\nNison: more significant when touching a new all-time high.\nReliability second LitWick: Moderate\n","") +

  • 5/24/2018 Volume Analisis .Afl

    28/29

    WriteIf(triStarBearish,"(-) Tri-Star Bearish. Pattern reversal.\nNison: patternof very significant reversal.\nReliability second LitWick: Moderate \n","") +WriteIf(twoCrows,"(-) 2 Crows. Pattern reversal.\nReliability second LitWick: Moderate \n","") +WriteIf(dojiStarBearish,"(-) Doji Star Bearish. Pattern reversal.\nNison: Requires confirmation.\nReliability second LitWick: Moderate \n","") +WriteIf(downsideGapThreeMethods,"(-) Downside Gap 3 Methods. Pattern continued.\nReliability second LitWick: Moderate \n","") +WriteIf(downsideTasukiGap,"(-) Downside Tasuki Gap. Method of continuation.\nNison: if the last Day we closed the gap, the pattern to continuevar is denied.\nReliability Second LitWick: Moderate \n","") +

    WriteIf(inNeckBearish,"(-) In Neck Bearish. Pattern continued.\nNison: as in 'piercing pattern' but more bearish on the second day because there is no penetration.\nReliability second LitWick: Moderate \n","") +WriteIf(OnNeckBearish,"(-) On Neck Bearish. Pattern continued. Similar to 'piercing'ma more bearish because there is no penetration on the second day.\nReliability second LitWick: Moderate \n","") +WriteIf(separatingLinesBearish,"(-) Separating Lines Bearish. \n","") +WriteIf(sideBySideWhiteLinesBearish,"(-) Side by Side White Lines Bearish. Pattern continued.\nNison: very rare.\nReliability Second LitWick: Moderate \n","") +WriteIf(threeLineStrike,"(-) 3 Line Strike. Pattern continued.\nReliability second LitWick: Low. \n","") +WriteIf(thrustingBearish,"(-) Thrusting. Pattern continued.\nNison: is not a dayof reversal because the second day does not engage the midpoint of the first da

    y.\nReliability second LitWick: Low. \n","") +WriteIf(tweezerTop,"(-) Tweezer Top. Pattern reversal.\nNison: Requires confirmation. \n","")

    +"\n"+"\n"+"\n"+"\n"

    );

    ////////////////////////////////////////////////////////////////////////////////

    ///////_SECTION_BEGIN("WMA1");P = ParamField("Price field",-1);//Periods = Param("Periods",8, 2, 300, 1, 10 );Plot( WMA( P, 8 ), "WMA(8)", colorOrange, ParamStyle("Style") );

    _SECTION_END();

    _SECTION_BEGIN("WMA3");P = ParamField("Price field",-1);//Periods = Param("Periods", 12, 2, 300, 1, 10 );Plot( WMA( P, 12 ), "WMA(12)", colorGreen, ParamStyle("Style") );

    _SECTION_END();

    _SECTION_BEGIN("WMA4");P = ParamField("Price field",-1);//Periods = Param("Periods", 15, 2, 300, 1, 10 );Plot( WMA( P, 15 ), "WMA(15)", colorRed, ParamStyle("Style") );

    _SECTION_END();

    _SECTION_BEGIN("WMA");P = ParamField("Price field",-1);//Periods = Param("Periods", 200, 2, 300, 1, 10 );Plot( WMA( P, 200), "WMA(200)", colorYellow, 8 );

  • 5/24/2018 Volume Analisis .Afl

    29/29

    _SECTION_END();

    _SECTION_BEGIN("WMA6");P = ParamField("Price field",-1);//Periods = Param("Periods", 50, 2, 300, 1, 10 );Plot( WMA( P, 50 ), "WMA(50)", colorPink, ParamStyle("Style") );

    _SECTION_END();

    _SECTION_BEGIN("WMA7");P = ParamField("Price field",-1);//Periods = Param("Periods", 100, 2, 300, 1, 10 );

    Plot( WMA( P, 100 ), "WMA(100)", ParamColor( "Color", colorCycle ), ParamStyle("Style") );_SECTION_END();

    _SECTION_BEGIN("004");//****** Copyright 9Trading.com ******/

    MaxGraph = 12;BuyOffSet = 18;//Optimize("BuyOffSet",18,15,20,1);SellOffset = BuyOffSet;//Optimize("SellOffset",2,2,14,2);RegLength = 5;//Optimize("RegLength",5, 2,11,2);BuyATRPeriod = 2;//Optimize("BuyATRPeriod",2,2,5,1);SellATRPeriod = BuyATRPeriod;//Optimize("SellATRPeriod",4,2,11,2);

    ATRMultiplier = 0.5;//Optimize("ATRMultiplier",1,0.7,1.25,.05);G8 = HHV(H-ATRMultiplier*ATR(BuyATRPeriod),BuyOffset); /* RED */G9 = LLV(L+ATRMultiplier*ATR(SellATRPeriod),SellOffset); /* GREEN */ave=(G8+G9)/2;

    nn=21;mmm=120;TYP=(High + Low + 2*Close)/4;CI=(TYP-MA(TYP,14))/(0.015*StDev(TYP,14));CCCI=EMA(CI,5)+mmm;Hh=HHV(H,nn);Ll=LLV(L,nn);MM=(Hh+Ll)/2;

    CCCC=EMA(CCCI*(Hh-Ll)/(2*mmm)+Ll,5);

    Buy = (Cccc>Ref(Cccc,-1) AND Ref(Cccc,-1)