I need to calculate my position based on money loss at the stop level. To be more specific, my position sizing strategy consists of risking a fixed % of the account balance at the stop loss, given that there is enough margin available. If there is not enough margin the position will use only a fraction of margin available. 

In the platform, I can only see position sizing based on target, which is not what I am looking for. What would be the fastest way to implement this?

thanks in advance for your support.