Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Theta weighted exponential z scores with XIV, long only

Theta weighted exponential z scores with XIV, long only, If someone wants to add a shot with UVXY I'd be more than happy

13 responses

Tweaked

changed TZA to SH and experienced less decay, need to find a better short close signal

same time frame as initial with leverage

Hey everyone who is listening to this thread, I have been optimizing my code and trying to set trigger records of when z6, (current price-200dma)/200std, crosses z2exp, z2exps, or z2w (derivatives of (50dma-200dma)/200std) to set shorts. Although, I have not been able to get the shorts working correctly. I'm not completely done with the trigger logic and will rework it. Long only with leverage. Also, this handles the crash in 2011 better. Any thoughts on a short signal?

old strategy with xiv and uvxy

promising algo that needs some work. If anyone wants to tweak, please share the results, I have to run. currently only trading off of 9dma zscore. Ordering the resistances and placing trigger logic on where where the current price zscore is coming from still needs to be done and there are. The beginning workings of the code in there.

Note: might have better luck with a smoother zscore*0.8-0.5 cutoffs

Went in a different direction with this after talking to a programmer friend of mine and then trying to implement my idea. The ordering logic hasn't been put together yet, but the basis of this is it record the min max minutely z-scores for the last 20 days and trades based off of when it goes above/below 20% and switches positions(long<>short) along ((dma20-dma200)/std200)+-.5 based off trigger logic that rests when the upper/lower line is breached . It looks VERY promising.

So after I wrote some trading logic for that last post, this is the comprehensive analysis. I am holding on to my code as of now.

Get the margin-leverage under control with minimal Max Intraday Leverage code or PvR.

2017-01-12 06:31 pvr:333 INFO PvRp 0.5066 %/day 2011-12-09 to 2017-01-12 $1500 2017-01-27 22:10 US/Eastern
2017-01-12 06:31 pvr:334 INFO Profited 73788 on 11371 activated/transacted for PvR of 648.9%
2017-01-12 06:31 pvr:335 INFO QRet 4919.22 PvR 648.92 CshLw -22334 MxLv 7.58 RskHi 11371 Shrts 0
2017-01-12 06:31 pvr:430 INFO
Runtime 0 hr 3.3 min End: 2017-01-27 22:13 US/Eastern

Thanks Blue

Hi ryan,

Could you please describe a little bit about your algo's stratergy? Or just simply the "Theta weighted exponential z scores"?

Cheers

Hey Thomas There are actually multiple strategies here, but the theta wieghted one I stated out with was an exponential z score (z2exp=z2*z2*z2*1.2-timer/60) where z2 = 50 day zscore against the 200dma. The issue I had with trading the dma's was that they were slow, hence the exponential form to try increase the cutoff when it is >1. Also when the price was below the cutoff I had to find a way to bring the moving average down because money has a time value, so the timer would increase the longer the account was holding cash. It worked to some extent, but I don't trust it with real money. I have it running on q paper trade to see how it will preform over the next year or so. Also please forgive any of my algorithms' messiness as I only started coding in December.