// Time filter in_session = (time >= time_filter_start) and (time <= time_filter_end)
// Entry Conditions buy_signal = ta.crossover(fastEMA, slowEMA) and rsi > 50 and in_session sell_signal = ta.crossunder(fastEMA, slowEMA) and rsi < 50 and in_session
// Exit conditions (calculated but not triggered in this script) long_take_profit = close + (atr * take_profit_multiplier) long_stop_loss = close - (atr * stop_loss_multiplier)
short_take_profit = close - (atr * take_profit_multiplier) short_stop_loss = close + (atr * stop_loss_multiplier)
// Arrays to track historical trades var float[] long_trade_entries = array.new_float(0) var float[] short_trade_entries = array.new_float(0)
if (buy_signal) array.push(long_trade_entries, close)
if (sell_signal) array.push(short_trade_entries, close)
// Plot EMAs plot(fastEMA, color=color.green, title="Fast EMA (8)") plot(slowEMA, color=color.red, title="Slow EMA (21)")