I wanted to investigate how order_target_percent works when I try to order more than the size of my portfolio. I found out it just orders more than the size of my portfolio! This is not what I expected. Is there a way to prevent that from happening? I am wondering how my algorithm will behave in live trading, because my broker will not allow me to order more than I have in cash!
I tried modifying the context.account object in initialize, hoping if I set the buying_power variable from infinity to my available_funds it will prevent this excessive ordering. But it seems to have no effect, I am thinking the account object is not for setting only getting. Can anyone comment on that?
Thanks for any help!!