Hello, I have a question about creating a study based on open PnL. What I would like to do is to have a study/strategy that closes out any open position when the open PnL crosses below a certain level. I haven't see any existing programs like this but maybe I've missed it? Would this be a difficult thing to program?
If I was able to create an indicator showing the open PnL it would be easy enough to set an alert to buy/sell once the threshold was exceeded. The only issue would be making sure it is set to either buy or sell correctly based on how the entry was made, and have the correct number of contracts specified. Maybe there is a way to integrate a "close all positions" command into this?
Thanks,
Alex
If I was able to create an indicator showing the open PnL it would be easy enough to set an alert to buy/sell once the threshold was exceeded. The only issue would be making sure it is set to either buy or sell correctly based on how the entry was made, and have the correct number of contracts specified. Maybe there is a way to integrate a "close all positions" command into this?
Thanks,
Alex