I'm trying to get my head around how to program a strategy to enter a number of shares based upon my current account size and stop loss risk for the trade being considered.
For a long, instead of:
EnterLongLimit ( DefaultQuantity, LimitPrice, "Long")
I'm trying:
int shares = Math.Round ( AccountSize * 0.01 / (Entry - Stop), 0 )
EnterLongLimit ( shares, LimitPrice, "Long")
... However, the compiler doesn't like it as it " cannot convert implicitly from double to int " or something like that.
Could anyone give me any pointers? Thanks!
Olly

Comment