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

Daily RSI

_SECTION_BEGIN("Unnamed 2"); ////////////////////////////////////////////////////////////////// TimeFrameSet(inDaily); dRSI = RSI(14); TimeFrameRestore(); TimeFrameSet(inDaily); DailyRSI = RSI(14); TimeFrameRestore(); TimeFrameSet(inDaily); dRSI = RSI(14); TimeFrameRestore(); Plot( TimeFrameExpand(dRSI ,inDaily),"daily RSI 14",colorGreen,styleHistogram|styleThick); Plot( RSI(14),"RSI 14",colorRed,styleThick); Plot( TimeFrameExpand(dRSI ,inDaily),"daily RSI 14",colorGreen); Plot( TimeFrameExpand(DailyRSI ,inDaily),"daily RSI 14",colorBlue); Filter=1; AddColumn( TimeFrameExpand(dRSI ,inDaily), "daily RSI 14"); AddColumn( TimeFrameExpand(dRSI ,inDaily), "daily RSI 14"); ////////////////////////////////////////////////////////////////// _SECTION_END();

STAN WEINSTEIN'S STRATEGY - Halan Manoj Kumar

// THIS AFL INCORPORATES MOST OF THE CONCEPTS OF STAN WEINSTEINS TRADING METHODOLOGY. // USE ONLY WEEKLY CHART. // THIS AFL DOES NOT GUARANTEE ANY POSITIVE RETURNS. // USE THIS AFL AT YOUR OWN RISK // THIS AFL WAS DEVELOPED BY HALAN MANOJ KUMAR, MSC,CAIIB,FRM,PRM,CMA,ACMA. HOWEVER IN SOME CASES INDIVIDUAL CODE SNIPPETS ARE FROM DIFFERENT SOURCES AND I THANK THOSE DEVELOPERS. // ANY CONCEPTUAL QUERIES OR COMMENTS CAN BE MAILED TO scorpiomanoj73@gmail.com _SECTION_BEGIN("CHART"); SetChartOptions(0,chartShowArrows|chartShowDates); _N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%)", O, H, L, C, SelectedValue( ROC( C, 1 ) ) )); Plot( C, "Close", ParamColor("Color", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() ); _SECTION_END(); //RELATIVE STRENGTH // IF YOUR NIFTY TRADING SYMBOL IS DIFFERENT, PLEASE USE THAT INSTEAD OF ONE MENTIONED HERE. rsmaPeriod...

Renko Chart

_SECTION_BEGIN("www.trendnifty.com"); SetBarsRequired(100000,100000); //------------------------------------------------------------------+ // Block 1 | //------------------------------------------------------------------+ VR=ParamToggle("View Renko","Bricks|Lines/Bars",0); FV=Param("Initial size volatility",5,5,5,5); MV=Param("Method calculation volatility",0,0,2,1); PeriodVol=Param("Period calculation volatility",14,2,100,1); Multiplier=Param("Multiplier volatility",1,0.1,10,0.1); MR=ParamToggle("Method Renko","floating|fixed",1); SG=ParamToggle("Show gap","No|Yes",1); CG=ParamColor("Colour show gap",11); MaxBS=Param("Maximum size brick",0,0,10,0.1); MinBS=Param("Minimum size brick",0,0,10,0.1); RenkoUp=ParamColor("Colour Renko upwards",colorGreen); RenkoDown=ParamColor("Colour Renko downwards",colorRed); SB=ParamStyle(...