Guys, how should I use a value in supertrend as initial stop loss?
I don’t wanna close the order when close crosses over/under it, what I want is to use the value of Supertrend (or a moving average) at the bar of opening order as a level for stop loss.
A the time you open an order, calculate the stoploss size by substracting the supertrend to the current Close:
if condition then
buy at market
stoploss = close-supertrend[3,10]
set stop loss stoploss
endif
(for a buy order, considering the Supertrend is below the price).