QuantConnect / Documentation

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

Improve Financial Advisors #1526

Closed AlexCatarino closed 9 months ago

AlexCatarino commented 11 months ago

Expected Behavior

Financial Advisors provides examples of how Allocation Methods work.

Actual Behavior

Not enough information to make it clear.

Proposed Solution

See examples in https://interactivebrokers.github.io/tws-api/financial_advisor.html. We could copy them, and explain how it works in Lean

The algorithm receives the order events for each order that aggregates all orders according to the allocation method. For example, if we use:

self.DefaultOrderProperties.FaMethod = "EqualQuantity"self.
MarketOrder("ABC", 400)

for a group of 4, each account will buy 100 shares of ABC. The algorithm will receive events of filling the 400 shares, OrderStatus.Filled when all 400 shares are bought.

Let's say account B can't buy 10 out of 100 shares. I suppose 10 shares will be rejected/cancel, so your algorithm will have 390 shares of ABC.

Checklist