#] #] ********************* #] "$d_webRaw"'Software programming & code/PineScript for TradingView market charts/Howell - SP500 lags TNX.txt' # www.BillHowell.ca 17Aug2022 initial # view this file in a text editor, with [constant width font, tab = 3 spaces], no line-wrap 08*****08 #] 25Jul2022 indicator("SP500 lags TNX", overlay=true) // This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/ // © Bill_Howell //@version=5 indicator("SP500 lags TNX", overlay=true) //Only pre-defined colors that I can see : // color.[black, silver, gray, white, red, purple, fuchsia, green, // lime, olive, yellow, navy, blue, teal, aqua, orange] // want 35 day lag for 6M timescale chart : // TVscreenshot https://www.tradingview.com/x/dmGm1jUc/ t_lag = 35. tLag(series,lag) => series[lag] SPX500 = request.security("TVC:SPX", timeframe.period, close) SPX500_lagged := tLag(SPX500, t_lag) plot(SPX500_lagged, color=color.black, linewidth=2, title="SPX500_lagged") // enddoc