I am having issues with figuring out how to code my calculation for the amount of shares to trade when entering into a position (long or short).
I want the share size to be calculated by taking the Previous Candle High and subtracting it from the Previous 5sma. I would then take the desired Risk Amount and divide it by the difference to get the share size.
So in essence it should look something like this.
((Risk)/(High[1]-SMA5[1]))
However, when I try to add this into the EnterLong script, it doesn't work.
Ex. EnterLong((120)/High[1]-SMA5[1])), @"");
Can anyone help me get this to work?
Comment