Hello everyone. I am new to this and I try this algorithm. After I saw this algorithm's comments, I came across a problem. Suppose the algorithm's cash limit is 1000000 USD and in the algorithm's code we define context.max_notional = 1000000.1.
the code is:
if price < vwap * 0.995 and notional > context.min_notional:
elif price > vwap * 1.005 and notional < context.max_notional:
Suppose I have cost my cash to buy shares and in the account only remain 1000 USD. If the code "order(context.aapl,+100) " work, and in order to buy 100 shares of aapl , I have to spend 2000 USD. The account cash's limit is 1000000 USD, after the "order(context.aapl,+100)" work, I spent 1001000 USD actually. I think this is a problem. Maybe I am wrong. Can you help me?