Day Trading Futures

Status
Not open for further replies.

XRAY27

Well-Known Member
hi.
today trades 6094 short 6062 covered and 6100 PE 74.6 Buy and sell 94.

PTS 6089 ....(positional trade sell )of yesterday
 

pratapvb

Well-Known Member
BNF 10240 is vwap series....so booked out for now.....

 


PRATAP SIR I HAVE THIS AFL , but i want only yellow line vwap afl code seperatly , so can u
do it for me ??

*******
_SECTION_BEGIN("VWAP 3Days");

SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );

nb = Param("ToDay+Number of Bars",151,1,1500,75);
ND = Day() != Ref(Day(), -1);

///// VWAP and SDs /////

P = (H + L) / 2;
VWP = P * V;
BI = BarIndex();
BeginBI = ValueWhen(Ref(ND,-1+nb), BI);
BeginBI = BeginBI[BarCount -1];
GfxTextOut("BI"+BI,5,150);
if(BeginBI < BarCount - 1)
{
InRange = BI >= BeginBI;
CumV = Cum(V * InRange);
CumVWP = Cum(VWP * InRange);
VWAP = CumVWP / CumV;
S = Cum(Ref(CumV, -1) * V * (P - Ref(VWAP, -1))^2 / CumV);
Variance = S / CumV;
SD = sqrt(Variance);
VWAP = IIf(InRange, VWAP, Null);
//PPC = ValueWhen( nd == True, Ref(VWAP, -1), 1);
//Plot ( PPC, "PPC", colorBlue, styleDots|styleNoLine|styleNoRescale );

Plot(VWAP, "VWAP", colorYellow, styleNoTitle + styleNoRescale);
Plot(VWAP + SD, "+1SD", colorGreen, styleDashed + styleNoTitle + styleNoRescale);
Plot(VWAP - SD, "-1SD", colorRed, styleDashed + styleNoTitle + styleNoRescale);
Plot(VWAP + 2*SD, "+2SD", colorSeaGreen, styleDashed + styleNoTitle + styleNoRescale);
Plot(VWAP - 2*SD, "-2SD", colorOrange, styleDashed + styleNoTitle + styleNoRescale);
//Plot(VWAP + 3*SD, "+3SD", colorPaleGreen, styleDashed + styleNoTitle + styleNoRescale);
//Plot(VWAP - 3*SD, "-3SD", colorLightOrange, styleDashed + styleNoTitle + styleNoRescale);
}
GraphXSpace=10;
_SECTION_END();

_SECTION_BEGIN("VWAP IT");

SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );


ND = Day() != Ref(Day(), -1);

///// VWAP and SDs /////

P = (H + L) / 2;
VWP = P * V;
BI = BarIndex();
BeginBI = ValueWhen(ND, BI);
BeginBI = BeginBI[BarCount -1];
if(BeginBI < BarCount - 1)
{
InRange = BI >= BeginBI;
CumV = Cum(V * InRange);
CumVWP = Cum(VWP * InRange);
VWAP = CumVWP / CumV;
S = Cum(Ref(CumV, -1) * V * (P - Ref(VWAP, -1))^2 / CumV);
Variance = S / CumV;
SD = sqrt(Variance);
VWAP = IIf(InRange, VWAP, Null);
Plot(VWAP, "VWAP", colorBlack, styleNoTitle + styleNoRescale);
Plot(VWAP + SD, "+1SD", colorGreen, styleDashed + styleNoTitle + styleNoRescale);
Plot(VWAP - SD, "-1SD", colorRed, styleDashed + styleNoTitle + styleNoRescale);
Plot(VWAP + 2*SD, "+2SD", colorSeaGreen, styleDashed + styleNoTitle + styleNoRescale);
Plot(VWAP - 2*SD, "-2SD", colorOrange, styleDashed + styleNoTitle + styleNoRescale);
Plot(VWAP + 3*SD, "+3SD", colorPaleGreen, styleDashed + styleNoTitle + styleNoRescale);
Plot(VWAP - 3*SD, "-3SD", colorLightOrange, styleDashed + styleNoTitle + styleNoRescale);
}
_SECTION_END();

_SECTION_BEGIN("BACK COLR");
SetChartBkGradientFill( ParamColor("BgTop", ColorRGB( 172,172,172 )),

ParamColor("BgBottom", ColorRGB( 172,172,172 )),ParamColor("titleblock",ColorRGB( 172,172,172 )));
_SECTION_END();
 

pratapvb

Well-Known Member


PRATAP SIR I HAVE THIS AFL , but i want only yellow line vwap afl code seperatly , so can u
do it for me ??

*******
_SECTION_BEGIN("VWAP 3Days");

SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );

nb = Param("ToDay+Number of Bars",151,1,1500,75);
ND = Day() != Ref(Day(), -1);

///// VWAP and SDs /////

P = (H + L) / 2;
VWP = P * V;
BI = BarIndex();
BeginBI = ValueWhen(Ref(ND,-1+nb), BI);
BeginBI = BeginBI[BarCount -1];
GfxTextOut("BI"+BI,5,150);
if(BeginBI < BarCount - 1)
{
InRange = BI >= BeginBI;
CumV = Cum(V * InRange);
CumVWP = Cum(VWP * InRange);
VWAP = CumVWP / CumV;
S = Cum(Ref(CumV, -1) * V * (P - Ref(VWAP, -1))^2 / CumV);
Variance = S / CumV;
SD = sqrt(Variance);
VWAP = IIf(InRange, VWAP, Null);
//PPC = ValueWhen( nd == True, Ref(VWAP, -1), 1);
//Plot ( PPC, "PPC", colorBlue, styleDots|styleNoLine|styleNoRescale );

Plot(VWAP, "VWAP", colorYellow, styleNoTitle + styleNoRescale);
Plot(VWAP + SD, "+1SD", colorGreen, styleDashed + styleNoTitle + styleNoRescale);
Plot(VWAP - SD, "-1SD", colorRed, styleDashed + styleNoTitle + styleNoRescale);
Plot(VWAP + 2*SD, "+2SD", colorSeaGreen, styleDashed + styleNoTitle + styleNoRescale);
Plot(VWAP - 2*SD, "-2SD", colorOrange, styleDashed + styleNoTitle + styleNoRescale);
//Plot(VWAP + 3*SD, "+3SD", colorPaleGreen, styleDashed + styleNoTitle + styleNoRescale);
//Plot(VWAP - 3*SD, "-3SD", colorLightOrange, styleDashed + styleNoTitle + styleNoRescale);
}
GraphXSpace=10;
_SECTION_END();

_SECTION_BEGIN("VWAP IT");

SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );


ND = Day() != Ref(Day(), -1);

///// VWAP and SDs /////

P = (H + L) / 2;
VWP = P * V;
BI = BarIndex();
BeginBI = ValueWhen(ND, BI);
BeginBI = BeginBI[BarCount -1];
if(BeginBI < BarCount - 1)
{
InRange = BI >= BeginBI;
CumV = Cum(V * InRange);
CumVWP = Cum(VWP * InRange);
VWAP = CumVWP / CumV;
S = Cum(Ref(CumV, -1) * V * (P - Ref(VWAP, -1))^2 / CumV);
Variance = S / CumV;
SD = sqrt(Variance);
VWAP = IIf(InRange, VWAP, Null);
Plot(VWAP, "VWAP", colorBlack, styleNoTitle + styleNoRescale);
Plot(VWAP + SD, "+1SD", colorGreen, styleDashed + styleNoTitle + styleNoRescale);
Plot(VWAP - SD, "-1SD", colorRed, styleDashed + styleNoTitle + styleNoRescale);
Plot(VWAP + 2*SD, "+2SD", colorSeaGreen, styleDashed + styleNoTitle + styleNoRescale);
Plot(VWAP - 2*SD, "-2SD", colorOrange, styleDashed + styleNoTitle + styleNoRescale);
Plot(VWAP + 3*SD, "+3SD", colorPaleGreen, styleDashed + styleNoTitle + styleNoRescale);
Plot(VWAP - 3*SD, "-3SD", colorLightOrange, styleDashed + styleNoTitle + styleNoRescale);
}
_SECTION_END();

_SECTION_BEGIN("BACK COLR");
SetChartBkGradientFill( ParamColor("BgTop", ColorRGB( 172,172,172 )),

ParamColor("BgBottom", ColorRGB( 172,172,172 )),ParamColor("titleblock",ColorRGB( 172,172,172 )));
_SECTION_END();

Option 1 :

just comment out the Plot lines other than the 1st that draws the VWAP

Option 2:
use my vwap 2day rolling AFL set NDays = 3 and set out params that you don't want to NO
 
Status
Not open for further replies.

Similar threads