Hi,

I really like the AssetClassmomentum strategy (https://www.quantconnect.com/tutorials/strategy-library/asset-class-momentum) but would like to modify it in order to avoid some lack of liquidity situtation in which it tries to buy more shares that avaiable margin permits.

In order to do that I need the last price of the symbol being traded from inside the Rebalance method however I don't know how to call the OnData method and get the tradebar data back or if there is a better way to do it.

I have been through the tutorials but so far I have not found any examples in which tradebar data is accessed outside of OnData.

In the attached backtest I am simply setting a global variable to the first symbol in  self.symbols just to have some price value but this does not provide the solution I need.

Any help on this matter will be truly appreciated.

Cheers,

Andres