// Plot Heikin Ashi candles on the price chart plotcandle(open=heikinOpen, high=heikinHigh, low=heikinLow, close=heikinClose, color=heikinClose >= heikinOpen ? color.green : color.red, wickcolor=color.black, title="Heikin Ashi Candles")
// Calculate RSI and SMA rsi = ta.rsi(close, rsiLength) sma = ta.sma(rsi, smaLength)
// Conditions for buy and sell signals sellSignal = ta.crossover(sma, rsi) // RSI crosses below SMA buySignal = ta.crossunder(sma, rsi) // RSI crosses above SMA
// Track the last signal var string lastSignal = ""
// Ensure signal is only given after the candle closes sellSignalClose = barstate.isconfirmed and sellSignal and (lastSignal != "SELL") // Confirm signal only on completed bar, and must be different from previous signal buySignalClose = barstate.isconfirmed and buySignal and (lastSignal != "BUY") // Confirm signal only on completed bar, and must be different from previous signal
// Update the last signal if (buySignalClose) lastSignal := "BUY" if (sellSignalClose) lastSignal := "SELL"
// Plot RSI and SMA on RSI pane plot(rsi, color=color.blue, linewidth=2, title="RSI") plot(sma, color=color.orange, linewidth=2, title="SMA")
// Plot buy and sell signals only when the candle closes plotshape(series=sellSignalClose, location=location.abovebar, color=color.red, style=shape.labeldown, title="Sell Signal", text="SELL") plotshape(series=buySignalClose, location=location.belowbar, color=color.green, style=shape.labelup, title="Buy Signal", text="BUY")
סקריפט קוד פתוח
ברוח TradingView אמיתית, היוצר של הסקריפט הזה הפך אותו לקוד פתוח, כך שסוחרים יכולים לבדוק ולאמת את הפונקציונליות שלו. כל הכבוד למחבר! למרות שאתה יכול להשתמש בו בחינם, זכור שפרסום מחדש של הקוד כפוף לכללי הבית שלנו.
לגישה מהירה לגרף, הוסף את הסקריפט הזה למועדפים שלך - למד עוד כאן.
המידע והפרסומים אינם אמורים להיות, ואינם מהווים, עצות פיננסיות, השקעות, מסחר או סוגים אחרים של עצות או המלצות שסופקו או מאושרים על ידי TradingView. קרא עוד בתנאים וההגבלות.
ברוח TradingView אמיתית, היוצר של הסקריפט הזה הפך אותו לקוד פתוח, כך שסוחרים יכולים לבדוק ולאמת את הפונקציונליות שלו. כל הכבוד למחבר! למרות שאתה יכול להשתמש בו בחינם, זכור שפרסום מחדש של הקוד כפוף לכללי הבית שלנו.
לגישה מהירה לגרף, הוסף את הסקריפט הזה למועדפים שלך - למד עוד כאן.
המידע והפרסומים אינם אמורים להיות, ואינם מהווים, עצות פיננסיות, השקעות, מסחר או סוגים אחרים של עצות או המלצות שסופקו או מאושרים על ידי TradingView. קרא עוד בתנאים וההגבלות.