Combining Trend-VWAP-Ranges - Pratap's method

vijkris

Learner and Follower

vijkris

Learner and Follower
Here's a chart


SRSARTFtj afl
Please change the tf and color according to your needs
There is syntax error in the code posted, so rectified it and posting it again.

Code:
usetf = ParamToggle("Use TF", "No|Yes", 1) ;

// Author: Pratap Balakrishnan
// Copyright: All rights reserved. Not to be circulated or shared or posted on websites without the author's written permission.
// email id: [email protected]
//
/*
This creates a band of period-moving average for the given TF 
(TF should be equal to or higher than current chart TF).

*/
alloff = ParamToggle("All off", "No|Yes", 0) ;

//	Rh = ParamField("High", 1) ;
//	Rl = ParamField("Low", 2) ;

tf = Param("TF", 3, 1, 100000, 1);
Periods = Param("Periods", 13, 2, 1000, 1 );
showzone = ParamToggle("Show Zone", "No|Yes", 1) ;
Layer = Param("Layer", -2, -5, 5, 1) ;
shift = Param("Shift", 0, -100, 100, 1) ;
showtitle = ParamToggle("Show Title", "No|Yes", 0) ;
showlabel = ParamToggle("Show Label", "No|Yes", 1) ;
isema = ParamToggle("MA Type", "MA|EMA", 1) ;
MAstyle = ParamStyle("MA Style", styleThick|styleDashed) ;
MAwidthper = Param("MA Width %", 0, 0, 10, 1) ;
MAwidth = SelectedValue(C) * MAwidthper /100 ;
Clrup = ParamColor( "Color Up", colorPaleGreen);
Clrdown = ParamColor( "Color Down", colorPaleGreen);
Clrsw = ParamColor( "Color SW", colorPaleGreen);
isexpandLast = ParamToggle("Expand Mode", "First|Last", 0); 

styledisp = 0 ;
if (NOT showtitle)
styledisp |= styleNoTitle ;

if (NOT showlabel)
styledisp |= styleNoLabel ;

expandmode = expandFirst ;
if (isexpandLast)
expandmode = expandLast ;

if (NOT alloff)
{
Oldintrvl = Interval() ;

if (usetf)
{
tfs = tf *in1Minute ;
TimeFrameSet(tfs) ;
}
else
tfs = Interval() ;

if (isema)
MAhtf = EMA(H, Periods) ;
else
MAhtf = MA(H, Periods) ;

if (isema)
MAltf = EMA(L, Periods) ;
else
MAltf = MA(L, Periods) ;

str = NumToStr(tf, 1.0)+"Min"+"-P"+NumToStr(Periods, 1.0) ;
Clr = IIf(MAltf > Ref(MAltf, -1 ), ClrUp, 
IIf(MAhtf < Ref(MAhtf, -1 ), ClrDown,
Clrsw)) ;

if (usetf)
TimeFrameRestore() ; //TimeFrameSet(Oldintrvl) ;

if (usetf)
MAhtfe = TimeFrameExpand(MAhtf, tfs, expandmode ) ;
else
MAhtfe = MAhtf ;

if (usetf)
MAltfe = TimeFrameExpand(MAltf, tfs, expandmode ) ;
else
MAltfe = MAltf ;

if (usetf)
Clre = TimeFrameExpand(Clr, tfs, expandmode ) ;
else
Clre = Clr ;

RefMAhtfe = MAhtfe ;
RefMAltfe = MAltfe ;
RefClre = Clre ;

Plot( RefMAhtfe, str+" High", RefClre, MAstyle|styledisp|styleNoRescale, 0, 0, shift, 1 ); 
Plot( RefMAltfe, str+" Low", RefClre, MAstyle|styledisp|styleNoRescale, 0, 0, shift, 1 ); 
if (showzone)
PlotOHLC(RefMAhtfe, RefMAhtfe, RefMAltfe, RefMAltfe, "", RefClre, styleCloud|styleNoLabel|styledisp|styleNoRescale,Null, Null, shift, Layer) ;
if (MAwidth > 0)
{
PlotOHLC(RefMAhtfe+MAwidth, RefMAhtfe+MAwidth, RefMAhtfe-MAwidth, RefMAhtfe-MAwidth, "", RefClre, styleCloud|styleNoLabel|styledisp|styleNoRescale,Null, Null, shift) ;
PlotOHLC(RefMAltfe+MAwidth, RefMAltfe+MAwidth, RefMAltfe-MAwidth, RefMAltfe-MAwidth, "", RefClre, styleCloud|styleNoLabel|styledisp|styleNoRescale,Null, Null, shift) ;
}	
showext = ParamToggle("Show Extension", "No|Yes", 1) ;
showextband = ParamToggle("Show Extension Band", "No|Yes", 1) ;
extend = Param("Extend", 20, 0, 100, 1) ;
showparam = ParamToggle("Show Key Param", "No|Yes", 1) ;

if (showext)
{
x0 = BarCount - (extend+1) ;
x1 = BarCount -1 ;

Hdlast = SelectedValue(RefMAhtfe) ;
Ldlast = SelectedValue(RefMAltfe) ;

Hplot = LineArray(x0, Hdlast, x1, Hdlast) ;
Plot(Hplot, "", RefClre, styleLine|styleNoLabel|styledisp|styleNoRescale, 0,0,extend) ;
LPlot = LineArray(x0, Ldlast, x1, Ldlast) ;
Plot(LPlot, "", RefClre, styleLine|styleNoLabel|styledisp|styleNoRescale, 0,0,extend) ;

if (showextband)
PlotOHLC(HPlot, HPlot, LPlot, LPlot, "", RefClre, styleCloud|styleNoLabel|styledisp|styleNoRescale, 0,0,extend,Layer ) ;

}

showparam = ParamToggle("Show Key Param", "No|Yes", 0) ;

if (showparam)
{
y = (SelectedValue(RefMAhtfe)+ SelectedValue(RefMAltfe)) /2 ;
tfsd = tfs ;
if (tfsd < Interval())
tfsd = Interval() ;

str = "TF = " + NumToStr(tfsd/in1Minute, 1.0) + " P = " + NumToStr(Periods, 1.0) ;
PlotText(str, BarCount+2, y, colorBlack) ;
}


}
 
Sir I couldn't download from that post can u pls forward Pratap sirs VWAP PDF sir pls help me sir

My ID is [email protected]
Dear TJ members,

I made a PDF of Pratapbhai's VWAP thread some time back. Given that the thread cannot be recovered, I have uploaded the PDF on dropbox and the link is shared below. Hope it helps. All credit to Pratapbhai who selflessly spent months explaining this method on TJ.

The AFLs are posted above by Wisp. If required, I have the AFLs and can post them here. A word of caution for those who are new to this method. As Pratapbhai had said in his thread, please go through the theory and examples and understand the method before trying to trade with the AFLs.

Pratapbhai, if there is any objection, please let me know and I will delete.

Link to PDF:

https://www.dropbox.com/s/xnv9loj1hqvm8by/Pratap.pdf?dl=0

Regards,

Rajesh
Sent from my MotoG3 using Tapatalk
 
Dear Pratap and seniors
I found the system very useful. Many thanks for the system. I am learning the system. My question is whether 3 min. Band crossing above the extreme of 15 min. Band indicate up trend or 3 min band coming up above lower band of 15 min.
Which time frame is best suited for intraday Gold, nickel, copper & cruide trading through this method
Thanks
 

VJAY

Well-Known Member
Dear Pratap and seniors
I found the system very useful. Many thanks for the system. I am learning the system. My question is whether 3 min. Band crossing above the extreme of 15 min. Band indicate up trend or 3 min band coming up above lower band of 15 min.
Which time frame is best suited for intraday Gold, nickel, copper & cruide trading through this method
Thanks
Take some time watching charts in live for some days if you understood method or go for some months....you will find the way to trade it ...bands are only for graphical help...real trading is how you get ideas from it.........
 
Vijay Sir,
Thanks for valuable suggestion. I am busy 9 to 6 for living, therefore I watch MCX live only after 6. I learnt in the thread that use 3 min. TF BNF & 5 min. for NF as such what TF I should prefer for intraday for some MCX scripts such as cruide, Gold, Copper, Nikel etc., for study with this system
as suggested by you.
Thanks
 

Similar threads