Question:
I noticed while using "OnDemand" in TOS the CCI watchlist by merryday (or any custom watchlist I have loaded) does not adjust to the look back date selected.
Say I want to see what my list looked like on Tuesday of last week. I set the "OnDemand" to MAY 10 @ 0930. The LAST and NET column info changes but my custom columns stay the same
Can "lookback" functionality be added to Merrydays CCI average labels and watchlist script to display the past info for the day I choose in OnDemand?
If so.......and someone has done it, can you please share the script.
Also.....a BIG thanks to Merryday on a kickazz script. Just trying to "tweek" it so I can do proper backtesting.
Here is his script I copied:
#TOS CCI Average Labels & Watchlist by @MerryDay 12/20
# https://www.stockmarkethacks.com/commodity-channel.html
declare lower;
#def lookback = 100;
def cci_length = 21;
def cci_avg_length = 14;
def over_sold = -150 ;
def over_bought = 150 ;
def CCI = reference CCIAverage("cci length" = cci_length, "cci avg length" = cci_avg_length)."CCI" ;
def CCIAvg = reference CCIAverage("cci length" = cci_length, "cci avg length" = cci_avg_length)."CCIAvg" ;
# Charting & Formatting
AddLabel(yes,
if CCI < over_sold and CCI >=CCIAvg then "BUY " + Round(CCI, 0) else
if CCI < over_sold and CCI > CCI[1] then "Reversing " + Round(CCI, 0) else
if CCI < over_sold then "Bottom " + Round(CCI, 0) else
if CCI >= over_bought and CCI >= CCI[1] then "Strong Trend " + Round(CCI, 0) else
if CCI > over_bought then "Watch It " + Round(CCI, 0) else
if CCI crosses above CCIAvg then "TREND BEGIN " + Round(CCI, 0) else
if CCI crosses below CCIAvg then "TREND END " + Round(CCI, 0) else
if CCI < CCIAvg and CCI>CCI[1] then "Pre-Trend " + Round(CCI, 0) else
if CCI > CCI[1] then " " + Round(CCI, 0) else
" " + Round(CCI, 0), color.black );
AssignBackgroundColor(
if CCI < over_sold and CCI >=CCIAvg then color.cyan else
if CCI < over_sold and CCI > CCI[1] then color.cyan else
if CCI < over_sold then CreateColor(120, 10, 2) else
if CCI > over_bought and CCI > CCI[1] then color.dark_orange else
if CCI > over_bought then CreateColor(255, 0, 255) else
if CCI crosses above CCIAvg then CreateColor(000, 255, 000) else
if CCI crosses above CCIAvg then color.orange else
if CCI crosses below CCIAvg then CreateColor(0, 100, 250) else
if CCI < CCIAvg and CCI>CCI[1] then color.yellow else
if CCI > CCI[1] then color.green else
CreateColor(225, 0, 0) ) ;
# code end
I noticed while using "OnDemand" in TOS the CCI watchlist by merryday (or any custom watchlist I have loaded) does not adjust to the look back date selected.
Say I want to see what my list looked like on Tuesday of last week. I set the "OnDemand" to MAY 10 @ 0930. The LAST and NET column info changes but my custom columns stay the same
Can "lookback" functionality be added to Merrydays CCI average labels and watchlist script to display the past info for the day I choose in OnDemand?
If so.......and someone has done it, can you please share the script.
Also.....a BIG thanks to Merryday on a kickazz script. Just trying to "tweek" it so I can do proper backtesting.
Here is his script I copied:
#TOS CCI Average Labels & Watchlist by @MerryDay 12/20
# https://www.stockmarkethacks.com/commodity-channel.html
declare lower;
#def lookback = 100;
def cci_length = 21;
def cci_avg_length = 14;
def over_sold = -150 ;
def over_bought = 150 ;
def CCI = reference CCIAverage("cci length" = cci_length, "cci avg length" = cci_avg_length)."CCI" ;
def CCIAvg = reference CCIAverage("cci length" = cci_length, "cci avg length" = cci_avg_length)."CCIAvg" ;
# Charting & Formatting
AddLabel(yes,
if CCI < over_sold and CCI >=CCIAvg then "BUY " + Round(CCI, 0) else
if CCI < over_sold and CCI > CCI[1] then "Reversing " + Round(CCI, 0) else
if CCI < over_sold then "Bottom " + Round(CCI, 0) else
if CCI >= over_bought and CCI >= CCI[1] then "Strong Trend " + Round(CCI, 0) else
if CCI > over_bought then "Watch It " + Round(CCI, 0) else
if CCI crosses above CCIAvg then "TREND BEGIN " + Round(CCI, 0) else
if CCI crosses below CCIAvg then "TREND END " + Round(CCI, 0) else
if CCI < CCIAvg and CCI>CCI[1] then "Pre-Trend " + Round(CCI, 0) else
if CCI > CCI[1] then " " + Round(CCI, 0) else
" " + Round(CCI, 0), color.black );
AssignBackgroundColor(
if CCI < over_sold and CCI >=CCIAvg then color.cyan else
if CCI < over_sold and CCI > CCI[1] then color.cyan else
if CCI < over_sold then CreateColor(120, 10, 2) else
if CCI > over_bought and CCI > CCI[1] then color.dark_orange else
if CCI > over_bought then CreateColor(255, 0, 255) else
if CCI crosses above CCIAvg then CreateColor(000, 255, 000) else
if CCI crosses above CCIAvg then color.orange else
if CCI crosses below CCIAvg then CreateColor(0, 100, 250) else
if CCI < CCIAvg and CCI>CCI[1] then color.yellow else
if CCI > CCI[1] then color.green else
CreateColor(225, 0, 0) ) ;
# code end