[TTI] NDR 63-Day QQQ-QQEW ROC% Spread
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © TintinTrading

//@version=4
study("[TTI] NDR 63-Day QQQ-QQEW ROC% Spread", shorttitle="[TTI] NDR QQQ-QQEW ROC% Spread", overlay=false)

// Define the tickers
qqq = security("NASDAQ:QQQ", "D", close)
qqew = security("NASDAQ:QQEW", "D", close)

// Calculate the 63-day Rate of Change (ROC%) for each ticker
roc_qqq = roc(qqq, 63) * 100
roc_qqew = roc(qqew, 63) * 100

// Calculate the spread
spread = roc_qqq - roc_qqew

// Plot the spread
Spread = plot(spread, title="63-Day QQQ-QQEW ROC% Spread", color=color.orange)

// Plot zero line
Zero = plot(0, "Zero Line", color=color.orange)
Warning = plot(600, "Warning line 1",style = plot.style_cross, color=color.rgb(120, 123, 134, 55))
Warning2 = plot(-600, "Warning line 1",style = plot.style_cross, color=color.rgb(120, 123, 134, 55))

fill(Spread, Zero, color.rgb(255, 153, 0))