What is the right code for a stop loss that is set after the opening bar.
long entry condition is met and position is opened. If after that first bar ( whichever time frame is set) the first candle is green then the SL is set at the opening price. If the first candle is red the SL is set at the close price minus x pips.