Stock Portfolio Organizer
The ultimate porfolio management solution.
Shares, Margin, CFD's, Futures and Forex
EOD and Realtime
Dividends and Trust Distributions
And Much More ....
WiseTrader Toolbox
#1 Selling Amibroker Plugin featuring:
Advanced Adaptive Indicators
Advanced Pattern Exploration
Neural Networks
And Much More ....
volume for Amibroker (AFL)
Copy & Paste Friendly
Back
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 | _SECTION_BEGIN ( "Volume" ); SetChartBkColor (16); GraphXSpace = Param ( "Zoom" ,2,-100); VLP= Param ( "VLP" ,14,10,50,1); Volumefactor= Param ( "volume factor upper" ,1,0.5,4,0.05); Volumefactor2= Param ( "volume factor lower" ,1,0.5,4,0.05); Vcurve= Param ( "v curve factor" ,0.5,-2,6,0.1); Vcurve2= Param ( "v curve factor2" ,-0.5,-2,6,0.1); Vcurve3= Param ( "v curve factor5" ,2.5,-4,8,0.1); Vcurve4= Param ( "v curve factor4" ,4,-4,8,0.1); SetChartBkColor (16 ) ; lookback = 8; Use2Bars = "Yes" ; LowVol = "Yes" ; ClimaxUp = "Yes" ; ClimaxDown = "Yes" ; Churn = "Yes" ; ClimaxChurn = "Yes" ; LowVolColor = colorYellow ; ClimaxUpColor = colorRed ; ClimaxDownColor = colorWhite ; ChurnColor = colorGreen ; ClimaxChurnColor = colorViolet ; DefaultBarColor = 7; AvgColor = 0; Range = High - Low ; Value1 = IIf ( Close >= Open , Volume * ((Range) / ((2+(Range*Range)/10) * Range + ( Open - Close ))), Volume * (((Range + Close - Open )) / (2+(Range*Range)/10) * Range + ( Close - Open ))); Value2 = Volume - Value1; Value3 = Value1 + Value2; Value4 = Value1 * Range; Value5 = (Value1 - Value2) * Range; Value6 = Value2 * Range; Value7 = (Value2 - Value1) * Range; Value8 = IIf (Range != 0, Value1 / Range, 1); Value9 = IIf (Range != 0, (Value1 - Value2) / Range, 1); Value10 = IIf (Range != 0, Value2 / Range, 1); Value11 = IIf (Range != 0, (Value2 - Value1) / Range, 1); Value12 = IIf (Range != 0, Value3 / Range, 1); Value13 = IIf (Use2Bars== "Yes" , Value3 + Ref (Value3,-1),1); Value14 = IIf (Use2Bars== "Yes" , (Value1 + Ref (Value1,-1))*( HHV ( High ,2)- LLV ( Low ,2)),1); Value15 = IIf (Use2Bars== "Yes" , (Value1 + Ref (Value1,-1)-Value2- Ref (Value2,-1))*( HHV ( High ,2)- LLV ( Low ,2)),1); Value16 = IIf (Use2Bars== "Yes" , (Value2 + Ref (Value2,-1))*( HHV ( High ,2)- LLV ( Low ,2)),1); Value17 = IIf (Use2Bars== "Yes" , (Value2 + Ref (Value2,-1)-Value1-Value1[1])*( HHV ( High ,2)- LLV ( Low ,2)),1); Value18 = IIf ((Use2Bars== "Yes" AND ( HHV ( High ,2)!= LLV ( Low ,2))),(Value1+ Ref (Value1,-1))/( HHV ( High ,2)- LLV ( Low ,2)),1); Value19 = IIf ((Use2Bars== "Yes" AND ( HHV ( High ,2)!= LLV ( Low ,2))),(Value1+ Ref (Value1,-1)-Value2- Ref (Value2,-1))/( HHV ( High ,2)- LLV ( Low ,2)),1); Value20 = IIf ((Use2Bars== "Yes" AND ( HHV ( High ,2)!= LLV ( Low ,2))),(Value2+ Ref (Value2,-1))/( HHV ( High ,2)- LLV ( Low ,2)),1); Value21 = IIf ((Use2Bars== "Yes" AND ( HHV ( High ,2)!= LLV ( Low ,2))),(Value2+ Ref (Value2,-1)-Value1- Ref (Value1,-1))/( HHV ( High ,2)- LLV ( Low ,2)),1); Value22 = IIf ((Use2Bars== "Yes" AND ( HHV ( High ,2)!= LLV ( Low ,2))),Value13/( HHV ( High ,2)- LLV ( Low ,2)),1); Condition1 = IIf (Value3 == LLV (Value3, Lookback), 1, 0); Condition2 = IIf ((Value4 == HHV (Value4, Lookback) AND Close > Open ), 1, 0); Condition3 = IIf ((Value5 == HHV (Value5, Lookback) AND Close > Open ), 1, 0); Condition4 = IIf ((Value6 == HHV (Value6, Lookback) AND Close < Open ), 1, 0); Condition5 = IIf ((Value7 == HHV (Value7, Lookback) AND Close < Open ), 1, 0); Condition6 = IIf ((Value8 == LLV (Value8, Lookback) AND Close < Open ), 1, 0); Condition7 = IIf ((Value9 == LLV (Value9, Lookback) AND Close < Open ), 1, 0); Condition8 = IIf ((Value10 == LLV (Value10, Lookback) AND Close > Open ), 1, 0); Condition9 = IIf ((Value11 == LLV (Value11, Lookback) AND Close > Open ), 1, 0); Condition10 = IIf (Value12 == HHV (Value12, lookback), 1, 0); Condition11 = IIf (Use2Bars== "Yes" AND (Value13== LLV (Value13,Lookback) AND Close > Open AND Ref ( Close ,-1) > Ref ( Open ,-1)),1,0); Condition12 = IIf (Use2Bars== "Yes" AND (Value14== HHV (Value14,Lookback) AND Close > Open AND Ref ( Close ,-1) > Ref ( Open ,-1)),1,0); Condition13 = IIf (Use2Bars== "Yes" AND (Value15== HHV (Value15,Lookback) AND Close > Open AND Ref ( Close ,-1) < Ref ( Open ,-1)),1,0); Condition14 = IIf (Use2Bars== "Yes" AND (Value16== LLV (Value16,Lookback) AND Close < Open AND Ref ( Close ,-1) < Ref ( Open ,-1)),1,0); Condition15 = IIf (Use2Bars== "Yes" AND (Value17== LLV (Value17,Lookback) AND Close < Open AND Ref ( Close ,-1) < Ref ( Open ,-1)),1,0); Condition16 = IIf (Use2Bars== "Yes" AND (Value18== LLV (Value18,Lookback) AND Close < Open AND Ref ( Close ,-1) < Ref ( Open ,-1)),1,0); Condition17 = IIf (Use2Bars== "Yes" AND (Value19== LLV (Value19,Lookback) AND Close > Open AND Ref ( Close ,-1) < Ref ( Open ,-1)),1,0); Condition18 = IIf (Use2Bars== "Yes" AND (Value20== LLV (Value20,Lookback) AND Close > Open AND Ref ( Close ,-1) > Ref ( Open ,-1)),1,0); Condition19 = IIf (Use2Bars== "Yes" AND (Value21== LLV (Value21,Lookback) AND Close > Open AND Ref ( Close ,-1) > Ref ( Open ,-1)),1,0); Condition20 = IIf (Use2Bars== "Yes" AND (Value22== LLV (Value22,Lookback)), 1,0); Color22= IIf (ClimaxChurn== "Yes" AND (Condition10 OR Condition20) AND (Condition2 OR Condition3 OR Condition4 OR Condition5 OR Condition6 OR Condition7 OR Condition8 OR Condition9), colorViolet , IIf (ClimaxUp== "Yes" AND (Condition2 OR Condition3 OR Condition8 OR Condition9 OR Condition12 OR Condition13 OR Condition18 OR Condition19) , colorRed , IIf (ClimaxDown== "Yes" AND (Condition4 OR condition5 OR Condition6 OR Condition7 OR Condition14 OR Condition15 OR Condition16 OR Condition17) , colorWhite , IIf (Churn== "Yes" AND Condition10 OR Condition20, colorBlue , IIf ( V < Ref ( V ,-1) AND V < Ref ( V ,-2) , colorYellow , colorGrey50 ))))); PlotVOL = ParamToggle ( "plot Volume?" , "No| Yes" ,1); VolScale = Param ( "1/Vol. Height (TimeBar chart)(fraction of window) 5=1/5=20%" ,5, -2, 200, 1.0) ; // Timebars volAvg = MA ( V ,Vlp); volMean = StDev (volAvg,Vlp); y= MA ( V ,1)+ StDev ( MA ( V ,1),2); z= MA ( V ,1)+ StDev ( MA ( V ,1),3); vp1 = (volAvg + Vcurve2*volMean*Volumefactor2); vp2 = (volAvg + Vcurve*volMean*Volumefactor2); vp3 = (volAvg + Vcurve3*volMean*Volumefactor); vp4 = (volAvg + Vcurve4*volMean*Volumefactor); ultraHighVolume = V >vp4; VeryhighVolume = V >vp3 AND V <vp4; highvolume = V >vp2 AND V <vp3; averagevolume = V >Vp1 AND V >Volavg AND V <vp2; lowvolume2 = V <volavg; Plot ( MA ( Volume ,VLP), "MAV" , colorLightBlue ); Plot ( V , "V" ,Color22, styleNoTitle | styleThick | ParamStyle ( "VStyle" , styleHistogram , maskHistogram ) ); PlotOHLC (vp1,vp1,vp2,vp2, "vp1-vp2" , ParamColor ( "color1" , colorYellow ), styleCloud ); PlotOHLC (vp3,vp3,vp4,vp4, "vp3-vp4" , ParamColor ( "color2" , colorPink ) , styleCloud ); Title=( "\n Volume: " )+ WriteIf (ultraHighVolume, EncodeColor ( colorLime )+ "ultra High" , WriteIf (veryhighvolume, EncodeColor ( colorLime )+ "very High" , WriteIf (highVolume, EncodeColor ( colorLime )+ "High" , WriteIf (averagevolume , EncodeColor ( colorRed )+ "Average" , WriteIf (lowVolume2, EncodeColor ( colorRed )+ "Low" , "Very Low" ))))); |