Is the stop trailing the High of the day? I want to output an exploration for the next day to adjust stop_loss at the exchange but I'm wondering how to calculate it.
If I went with
trail_level = H - 0.4*ATR(10);
trailing_stop_level = HighestSince(Buy,trail_level);
then I am assuming I am getting the value for my stop loss which I can send to the exchange?
not high of the day, high since entry. ( for a long trade )
But ApplyStop() is a backtester function. It is not going to send signals.
For live trading, why do you want to calculate anything?
Use the Brokers Bracket order or something similar and set the points while placing the order.
If you don't have CO/BO, then you need to go deep sea fishing. (it's going to be more complex if you will track this yourself)