Hey, all. I have several live algos trading at Quantopian and am porting everything here. The conversion process is going slower than expected, so I am reaching out for help. I do not have a programming background, so these questions may seem naive. Many thanks!

The attached algo is simple. Buy SPY at 10am every day when the 1d MA >= 5d MA and exit if not. Questions:

1. How do I set a variable to equal the current price for SPY at 10am (when the scheduler calls the "Rebalance" function)?

2. How do I write a "for stock in" loop in the "Rebalance" function that (a) generates 1d MA and 5d MA for SPY and QQQ in "self.equities" (using "stock" rather than the hard coded SPY you see) and (b) places orders for SPY and QQQ if logic is met (again using "stock" rather than hard coded SPY)? 

3. How do you get comfortable that your trading logic is working when you cannot print the data like on Quantopian? For example, after someone (hopefully) shows me how to get the current price at 10am, how do I know that code is producing the right output. If I understand correctly, the data cannot be viewed in QC.

For Jared and Team QC, props on the platform! Very sophisticated. Would like to see more algo examples in Python (presumably with time via the community, but right now vast majority in C#) and a de-bugger for the IDE (I know this is on your priority list). Just being able to search for Python algos ONLY would also be a big help. I'm having trouble finding enough examples. Finally, looking forward to more order types on IB, esp the best efforts VWAP, in November.

Author