Ultra-Fast Scalper
indicator("Ultra-Fast Scalper + 7-Day WinRate", overlay=true)
fast_len = input.int(3, title="Fast EMA Length")
slow_len = input.int(8, title="Slow EMA Length")
rsi_len = input.int(7, title="RSI Length")
tp_diff = input.float(0.00002, title="Take Profit Price Diff")
sl_diff = input.float(0.00020, title="Stop Loss Price Diff")
ema_fast = talib.ema(close, fast_len)
ema_slow = talib.ema(close, slow_len)
rsi_val = talib.rsi(close, rsi_len)
plot(ema_fast, color=color.yellow, linewidth=1, title="EMA 3")
plot(ema_slow, color=color.blue, linewidth=2, title="EMA 8")
longCondition = talib.crossover(ema_fast, ema_slow) and rsi_val > 50
plotshape(series=longCondition, title="BUY Signal", shape=shape.arrowup, location=location.belowbar, color=color.lime, text="BUY")
static float entry_price = na
static bool in_long = false
if longCondition and not in_long {
entry_price := close
in_long := true
}
tp_price = in_long ? entry_price + tp_diff : na
sl_price = in_long ? entry_price - sl_diff : na
plot(tp_price, color=color.green, linewidth=1, title="Take Profit")
plot(sl_price, color=color.red, linewidth=1, title="Stop Loss")
tp_hit = in_long and high >= tp_price
sl_hit = in_long and low <= sl_price
plotshape(series=tp_hit, title="TP Hit", shape=shape.circle, location=location.abovebar, color=color.green, text="TP")
plotshape(series=sl_hit, title="SL Hit", shape=shape.circle, location=location.belowbar, color=color.red, text="SL")
if tp_hit or sl_hit {
in_long := false
entry_price := na
}
alertcondition(longCondition, title="Long Entry", message="Ultra-Fast Scalper BUY signal")
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by GoCharting. Read more in the Terms of Use.
Comments (0)
Loading comments…
