Primitive entry model that uses bracketed orders.
Highlights:
• I think I've plugged all the open order holes. I don't see negative cash or 1.0+ leverage which would indicate doubling up of orders. Not that this can't happen as this is not a true OCA type capability.
• Using standalone methods with schedule_function to drive all processing. I've confirmed that the methods are called in sequence of their registration.
• Trailing stop is self contained. Just schedule the running of that method (and include the two globals).
• Still testing the use of expando properties on the data[stock] objects. Seems to work in bask test mode. Real time is another matter.
Enhancements:
• Use the fundamental retrieval to select a set of better performing securities.
• Swap in realistic entry model.
• Convert to minutely data.