Skip to main content

Vwap

_SECTION_BEGIN("VWAP");

Bars_so_far_today = 1 + BarsSince( Day() != Ref(Day(), -1));
StartBar = ValueWhen(TimeNum() == 091500, BarIndex());
TodayVolume = Sum(V,Bars_so_far_today);
IIf (BarIndex() >= StartBar, VWAP = Sum (C * V, Bars_so_far_today ) / TodayVolume,0);
Plot (VWAP,"VWAP",colorOrange, styleThick);

_SECTION_END();

dn = DateTime();

sd = SelectedValue( dn );

start = dn == sd;

mp = C;

PV = mp * V;
CV = Cum( V );
VSS = CV - ValueWhen( start, CV );

denom = IIf( VSS == 0, 1, VSS );
num = Cum( PV ) - ValueWhen( start, Cum( PV ) );

M = IIf( BarsSince( start ), num/denom, mp );

Plot( C, Date() + " Close", colorYellow, styleBar );
Plot( M, "M" + _PARAM_VALUES(), colorYellow, styleThick );

Comments

Popular posts from this blog

TB 100.1.1 tsf tema linear

_SECTION_BEGIN("Magnified Market Price"); //by Vidyasagar, vkunisetty@yahoo.com// SetChartOptions(0,chartShowArrows|chartShowDates); FS=Param("Font Size",30,11,100,1); GfxSelectFont("Times New Roman", FS, 700, True ); GfxSetBkMode( colorWhite ); GfxSetTextColor( ParamColor("Color",colorWhite) ); Hor=Param("Horizontal Position",750,1,1200,1); Ver=Param("Vertical Position",7,1,830,1); GfxTextOut(""+C , Hor , Ver ); YC=TimeFrameGetPrice("C",inDaily,-1); DD=Prec(C-YC,2); xx=Prec((DD/YC)*100,2); GfxSelectFont("Times New Roman", 11, 700, True ); GfxSetBkMode( colorWhite ); GfxSetTextColor(ParamColor("Color",colorWhite) ); //GfxTextOut("Open - "+O+" High - "+H+" Low - "+L+" Close - "+C, Horr , Verr-14 ); //GraphXSpace = Param("Graph Space",500,-10,500,1); _SECTION_END(); _SECTION_BEGIN("Trend Blaster V1.2"); SetChartBkColor(...

ALMA KAMA

_SECTION_BEGIN("KAMA - Kaufman Adaptive Moving Average"); LBPeriods = Param( "LB Periods", 81, 1, 200, 1 ); FSCPeriods = Param( "FSC Periods", 15, 1, 200, 1 ); SSCPeriods = Param( "SSC Periods", 30, 1, 200, 1 ); FastSmoothConst = 2 / ( FSCPeriods + 1 ); SlowSmoothConst = 2 / ( SSCPeriods + 1 ); Direction = abs( Close - Ref( Close, -LBPeriods ) ); Volatility = Sum( abs( Close - Ref( Close, -1 ) ), LBPeriods ); EfficiencyRatio = Direction / Volatility; SC = ( EfficiencyRatio * ( FastSmoothConst - SlowSmoothConst ) + SlowSmoothConst ) ^ 2; KAMA = AMA( Close, SC ); Plot( KAMA, "KAMA", ParamColor( "Color", colorRed ), styleLine ); _SECTION_END(); "Arnaud Legoux Moving Average"; /*________________________________________________________________________________________________ AFL code by hiscores. Originally posted here http://finance.groups.yahoo.com/grou...message/154257 Minor mod by rmike to Modify the AFL in conform...

QQE LINE

function QQELine( indiValue, deltaRSIValue, smoothPeriod ) { local prevVal, prevIndi, qqeValue, indi_sum; local indi_diff, higherCond, lowerCond, result; prevVal = prevIndi = 0; qqeValue = Null; indi_sum = indiValue + deltaRSIValue; indi_diff = indiValue - deltaRSIValue; for ( i = 1; i < BarCount; i++ ) { prevVal = qqeValue[i - 1]; prevIndi = indiValue[i - 1]; higherCond = prevIndi > prevVal AND indiValue[i] > prevVal; lowerCond = prevIndi < prevVal AND indiValue[i] < prevVal; qqeValue[i] = Iif( indiValue[i] == prevVal, prevVal, Iif( lowerCond, Min( prevVal, indi_sum[i] ), Iif( higherCond, Max( prevVal, indi_diff[i] ), Iif( indiValue[i] > prevVal, indi_diff[i], indi_sum[i] ) ) ) ); } result = EMA( qqeValue, smoothPeriod );// EL XAverage is EMA return result; } // Modified Exponential Moving Average function MEMA( Price, Period ) { local smoothing, result; smoothing = 1 / Max( 1, Period ); result = AMA( Pric...