OTP (One Trade Perday) based on Open, Low and High values

mastermind007

Well-Known Member
#41
15 years of Self learning in Excel. No formal training done. If you have a requirement (the What part) and the Energy (Motivation), it is actually speaking very simple ( I am not exaggerating). Today with Internet everything is available in the internet.

My boost or energy came from the motivation that I was NOT able to find a single tool in the market which does the magic. I am trying to trade from 2009 onwards. So far not succeeded. So If I develop my own tool and If I fail I don't have to blame at least somebody else :). Actually most of the time I failed or lost money because I follow my own intuition rather than following what the tool says. If I blindly follow the tool, I will surely succeed but then for that I need to Master my mind. So Trading is 90% a mental game.

Of course you also need to have "Hacker mindset". For example the most difficult part of the tool was downloadin the data from Google. And recently the data Futures data downloaded from NSEIndia site.

My recent challenge is howto get the VWAP from the NSEindia site so that the OTP Tool can improved.
Which city are you based in? Is VWAP another name for ATP? If yes, I have a small script that extracts it from NSE EOD BhavCopy file very easily.
 

mastermind007

Well-Known Member
#43
duplicate entry
 

mastermind007

Well-Known Member
#44
From Chennai. Yes it could be the same as ATP. VWAP is the Volume Waited Average Price. So I would need the Real Time Data like the Real time Futures Data
not Waited! Its more likely that it is Weighted. Volume Weighted Average Price. ATP does combine tick price with volume.

Anyways, here are few EOD ATP values for 20 JUN closing... Check and confirm that it is what you want. I get Real Time ATP feed from the Broker itself which I do not save as of now. Only cut-pasting first few lines out of 1000+ lines.

Code:
SYMBOL,Date,ATP,Open,High,Low,Close
ABAN,20130620,[B]267.352[/B],270.25,271.1,264.5,265.65,6.6
ABB,20130620,[B]595.043[/B],610,610,586,589.5,24
ABBOTINDIA,20130620,[B]1423.6[/B],1435,1459.8,1402.05,1418.6,57.75
ABCIL,20130620,80.0379,80,81.5,79,79.35,2.5
ABGSHIP,20130620,292.297,294,297,283,294.75,14
ABIRLANUVO,20130620,1074.85,1070,1079.7,1061.25,1077.1,18.45
ACC,20130620,1182.87,1203.15,1204,1170.1,1178.05,33.9
ACCELYA,20130620,452.576,443.55,459.8,440.1,453.5,19.7
ACE,20130620,11.6306,12,12,11.45,11.5,0.55
ACROPETAL,20130620,4.78057,4.9,5.15,4.65,4.75,0.5
ADANIENT,20130620,182.401,189.9,189.9,179.2,183.05,10.7
ADANIPORTS,20130620,148.525,149.9,151.4,146.85,148.9,4.55
ADANIPOWER,20130620,42.2095,43.75,43.75,41,41.5,2.75
ADFFOODS,20130620,43.4663,44.6,45.8,42.55,43.05,3.25
ADHUNIK,20130620,23.409,23.9,24.75,23.05,23.25,1.7
ADORWELD,20130620,119.306,120,123.95,118.05,119,5.9
ADSL,20130620,10.8577,11,11,10.2,10.5,0.8
ADVANIHOTR,20130620,28.7,28.7,28.7,28.7,28.7,0
 

a1b1trader

Well-Known Member
#46
One can use following AFL to get real time VWAP values of the scrip

Code:
_SECTION_BEGIN("Price");
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() ); 
_SECTION_END();

_SECTION_BEGIN("VWAP");
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+C) / 3;
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", colorBlue, 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();
 

SaravananKS

Well-Known Member
#47
Super. Thanks Saravanan. That would greatly help. Is it possible to do the backtests with the calls that we are getting around 10 AM.
As Promised,

Here is back test Result for the Conditions as you have gave

See Below the Equity curve



Back test Period

From Mar First week to 20-6-2013

the Back result shows a profit of 25400( with out deducting brokerage )
for the Investment of Rs 1 Lakh taking 30% leverage.

I have taken back test from following counters

ABAN
ABB
AXISBANK
BALRAMCHIN
BANKBARODA
BANKINDIA
BHEL
DLF
HDFC
HINDALCO
ICICIBANK
JPASSOCIAT
PNB
RCOM
RELCAPITAL
RELINFRA
SBIN
TATAMOTORS
UCOBANK

Total Trades 56
Wins 24
Loss 32

Thank you Healthraj for this Strategy
 

mastermind007

Well-Known Member
#48
One can use following AFL to get real time VWAP values of the scrip
a1b1

Maybe you can help. I had intended to use ATP as filter to remove high-risk trades and essentially what I was doing was that I would not go long unless close was above ATP and would not go short unless close was below ATP. In Intraday, what usually happens is that prices touch do rarely touch EOD ATP and if they do touch, they'd go ranging at that point. So, this idea did not work as I had expected.

BTW, have you tried built in VWAP function of Ami? I use that on nifty chart and its good.

Code:
segments = IIf( Interval() < inDaily, Day(), Month() );
segments = segments != Ref( segments , -1 );

PlotVAPOverlayA( segments , Param("Lines", 300, 100, 1000, 1 ), Param("Width", 80, 1, 100, 1 )
   , ParamColor("Color", colorGold ), ParamToggle("Side", "Left|Right" )
 | 2 * ParamToggle("Style", "Fill|Lines", 0) | 4*ParamToggle("Z-order", "On top|Behind", 1 ) );
P.S. segments is same as ND but will also work in case of EOD chart.
 

mastermind007

Well-Known Member
#50

Similar threads