I'm attempting to set the order Quantity relative to whatever my cash value is at the moment. ( Essentially Cash value divided by the current asking price, rounded to a whole number would be the number of shares I'd like to execute on each long)
In Initialize() I have AccountSize = 40000
then for OnBarUpdate() at the end of my code I have my conditions and the line to long the stock as seen below:
EnterLong("",math.round(GetAccountValue(AccountIte m.CashValue)/Ask[0]), "");
When I run the script it just orders 1 share every time, so its clearly not working...
Could someone assist me, I'm not sure if my logic is correct. I might be going about this all wrong.
Cheers,
Mike
Comment