MENU
  

Discontinued symbols (LIBOR is not longer used):

PineScript:

// draw yellow "x" above price candles where the cagr of last 10 bars are above 20
lookback = 10
cagrVal = ta.cagr(entryTime = time[lookback], entryPrice = close[lookback], exitTime = time, exitPrice = close)
plot(cagrVal, "cagr", display=display.data_window)
plotshape(cagrVal > 20, force_overlay = true, color = color.yellow)

// plot shaded blue area between price low/high
l = plot(low)
h = plot(high)
fill(h, l, color=color.new(color.blue, 85))

// Green bgcolor whenever MA50 crosses over MA200, and red background when MA50 crosses below MA200
//@version=6
indicator("My script", overlay=true)
ema1 = ta.ema(close, 50)
ema2 = ta.ema(close, 200)
plot(ema1, color=color.orange)
plot(ema2, color=color.green)
bgcolor(ta.crossover(ema1, ema2) ? color.green : na)
bgcolor(ta.crossunder(ema1, ema2) ? color.red : na)

// Example strategy that buys/sells on EMA50/200 crossovers
//@version=6
strategy("EMA50/EMA200 Crossover", overlay=true, initial_capital=10000, default_qty_type=strategy.percent_of_equity, default_qty_value=100)
ema50  = ta.ema(close, 50)
ema200 = ta.ema(close, 200)
plot(ema50,  color=color.new(color.blue,  0), title="EMA 50")
plot(ema200, color=color.new(color.orange, 0), title="EMA 200")
if (ta.crossover(ema50, ema200))
    strategy.entry("Long", strategy.long)
if (ta.crossunder(ema50, ema200))
    strategy.close("Long")