I've just started using NinjaScript for backtesting and I want to program in a trailing stop loss that is (for example)- Twice the 14 day ATR. I can set a stop loss that is the ATR of 'x' days but I am unable to set it as a multiple of this; any suggestions?
Also, I want to control the position size (number of contracts bought or sold on an entry signal) by making sure that the risk (distance from order entry price to stop loss) is for example 1% of the account size. I am completely lost as to how I can control these variables which decide position size and risk control; I would appreciate any suggestions.
Many thanks,
Comment