I have been doing a lot of testing using price in terms of open v. close, price v. vwap and for some reason in september 2012 my algo seems to always diverge from the benchmark.
Any thoughts?
I have been doing a lot of testing using price in terms of open v. close, price v. vwap and for some reason in september 2012 my algo seems to always diverge from the benchmark.
Any thoughts?
Hello Steven,
You may be exceeding the margin limit a broker would allow. I added a function that tracks the capital used (credit to Dennis C.) and added some plots. It appears that you are using capital (your initial and loaned by the broker) that is unrealistic.
I'll see if I can fix up the algo so that the limits are realistic.
Grant
Hi Steven,
There was a posting on how to handle margin in a more robust way than the "notional" approach. When I get the chance, I'll see if I can find it for you (or someone else can assist).
Grant
Here's the reference:
https://www.quantopian.com/posts/template-limiting-leverage-by-brandon-ogle-and-dan-sandberg
I have not used it, but glancing through the comments, it seems to be o.k.