Hey guys first post here. Really like the platform and hope to be contributing member of the community.
I have zero experience coding but was able to make some minor adjustments to some sample algorithims and arrived at this.
So I had a few questions on how to implement certain improvements.
1) Why is not always trading the front contract? If you look at the trades the algo makes it skips trading for a month everytime the contract it is trading expires. I feel like I am missing something here.
2) I tried to come up with a line to close all current positions if you are x days within expiry of the current contract but could not get the syntax correct, any suggestions?
3) How do I track the future itself for the SMA as opposed to an equity equivalent? I tried changing
equity = self.AddEquity("USO", Resolution.Minute) to equity = self.AddFuture("CL", Resolution.Minute)
but it ended up not trading at all. I am assuming there has to be some specfication of the contract but I am unsure how to implement.
Any and all feedback is appreciated.