Making entry/exit reflect VWAP vs MOO or MOC
Author: tedclimo
Creation Date: 2/16/2011 9:28 AM
profile picture

tedclimo

#1
Everything that follows pertains to use of daily bars.

Not sure this is possible, but need to ask.
Is there a way(in Simulations) to make market entry/exit reflect the average of open & close on entry/exit day?
This is best way I can imagine to reflect effects of using a VWAP order in Simulations.

I have a script that relies on getting in/out in a single day(size of orders requires VWAP orders thru trade desk). MOO & MOC will both likely create slippage in real life... vs what Simulator indicates using MOO/MOC orders.

So is it possible, to code script so that it "peeks" into the future(next day/entry day) and creates entry/exit point that is average of Open && Close?

I realize this will not reflect true VWAP, but it will be close enough... and far better than MOO/MOC.

Thanks in advance,

profile picture

dansmo

#2
With Bloomberg and BBLaoder you have the option to load bloomberg´s daily VWAP and can use that as an entry with FundamentalSeries. I did not do this before but I think this should work.
profile picture

tedclimo

#3
Can you offer a snippet of code that would make this work?
Sounds like a great idea, but not sure how to implement effectively.
Assume it will also work on exits??
Here's the big ?, if instruct script to MOO or MOC, how will it know to "Market on VWAP".
Or does Bloomberg substitute OHLC w VWAP only???
Meanwhile, I'll experiment.... perhaps easier done than I imagined.
All the best to you & yours,
T!
profile picture

Cone

#4
QUOTE:
Is there a way(in Simulations) to make market entry/exit reflect the average of open & close on entry/exit day?
You can use the ExitAtPrice method in the Community.Components.
profile picture

tedclimo

#5
Thank you both!

Robert,
Will try your ExitAtPrice method 1st. It is exactly the solution I was seeking.
Will update this thread once I see results.
TTFN
profile picture

tedclimo

#6
Cone et all,
Need your help installing Priority code to the EXITATPRICE example you provided above.

I tried installing the VWAP-style entry/exit into my private script. It worked perfectly, except it does not allow me to use LastPosition.Priority coding. I use a focused portfolio of just 10 stocks (via Pos-Sizer) and this VWAP-style code comes back with errors when I include "LastPosition.Priority coding". See example below.
Can you help me correct the syntax problem?
Perhaps my error is changing Entry to Bar+1.
But in live trading, I have to use today's Technicals/Fundamentals to make a decision for entering tomorrow, hence my desire to get a VWAP-style entry price vs MOO/MOC.
CODE:
Please log in to see this code.


The actual Private script I use is far more detailed. May need to open order ticket later. In the meantime, just trying to get Priority code to cooperate with VWAP-style entry price.
profile picture

Eugene

#7
Correction:
CODE:
Please log in to see this code.
profile picture

tedclimo

#8
Embarassing that I missed a syntax error like this.
Thank you.
Your solution(&Cone's) is perfect!!!
Have a great weekend.
profile picture

gbullr

#9
Does entry and exit at price stil work?

Trying to do what the people above have done. Enter at bar+1 on next day's vwap and exit on bar+1's vwap.

Help would be appreciated.

Thanks again.

This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).