Untitled

 avatar
unknown
plain_text
a year ago
957 B
99
Indexable
// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © furkankesgin

//@version=5
indicator("RSI Basic Signals", overlay=true)

[macdLine, signalLine, histLine] = ta.macd(close, 12,26,9)
buyMacd = ta.crossover(macdLine,signalLine)
sellMacd = ta.crossunder(macdLine, signalLine)
macdBuyBar = ta.barssince(buyMacd)
macdSellBar = ta.barssince(sellMacd)

plotshape(buyMacd, title="BUY", style = shape.labelup, text="BUY", location = location.belowbar, textcolor = color.white, color = color.green)
plotshape(sellMacd, title="SELL", style = shape.labelup, text="SELL", location = location.abovebar, textcolor = color.white, color = color.red)

cizgi = line.new(x1 = bar_index-macdBuyBar, y1 = low[macdBuyBar], x2 = bar_index - macdSellBar, y2 = high[macdSellBar])


if(buyMacd)
    alert("BUY", alert.freq_once_per_bar_close)
else if(sellMacd)
    alert("SELL", alert.freq_once_per_bar_close)
Editor is loading...
Leave a Comment