Tradingview, Pine editor, SMA (6,70)

This code below has 2 interesting things: Calculate the SMA for 6 days and 70 days. Define a period of time for your backtesting //@version=3 strategy(“SMA – 6d – 70d”, overlay=true, initial_capital=1000) // === BACKTEST RANGE === FromMonth = input(defval = 1, title = “From Month”, minval = 1) FromDay = input(defval = 1, title … Read more

Pine editor, RSI + Bollinger Bands

The entry script done in Pine Editor (trading view) //@version=3 strategy(shorttitle=”joapenBB”, title=”joapen Bollinger Bands”, overlay=true) /////////// inputs ////////// // RSI length = input(14, minval=1) overSold = input(25, minval=1) overBought = input(75, minval=1) price = close // Bollinger Bands src = input(close, title=”Source”) mult = input(2.0, minval=0.001, maxval=50) basis = sma(src, length) dev = mult * … Read more