QuantConnect / Documentation

QuantConnect Wiki Style Documentation Behind QuantConnect
https://www.quantconnect.com/docs/v2/
Apache License 2.0
173 stars 139 forks source link

Add Section On Setting Initial Holdings #1744

Closed AlexCatarino closed 6 months ago

AlexCatarino commented 6 months ago

Expected Behavior

Under Portfolio > Holdings, we show how to set initial holdings programmatically.

It should be a new H3: "Set Holdings"

if not self.live_mode:
    self.portfolio["SPY"].set_holdings(average_price=500, quantity=100)

We can explain that this can be useful to mimic a complex portfolio initial state of a factual account.

Under Initialization we could have the same text, so this should be a resource. In this case, the H3 should be "Set Initial Holdings".

Actual Behavior

Missing example.

Checklist