Does anyone know if it'd be possible to turn this indicator into a strategy? My knowledge with ThinkScript and writing code is pretty much non-existent, but if someone has any tips/hints or can share a starting place, I can toy around with it.
Buying condition would be where the RSI plot crosses the Fast ATR; selling would be the Fast ATR crossing the RSI plot.
Not sure if it's possible with the issue I've noticed with the scanner, but I wanted to check. Thanks for the reply and again for putting this forum together! I can't speak for everyone, but the indicators, resources, and collaboration from others I've seen have really helped me develop new skills and fine tune others - it's really appreciated!
Sorry for the unending questions on this one, but is there a way to add up/down arrows on the candles themselves when the the RSI crosses the ATR line? Specifically an up arrow where the RSI crosses above the ATR, and a down arrow when the ATR crosses the RSI? I'm striking out on all fronts in trying to get a working scanner/strategy for this one, but I'm loving the signals I've seen on AMM 2.0 combined with this indicator. I've never used ToS support, and I'm not sure what their limitations are, but would they go through the code to assist with questions like this?
If it can't be done, I understand - I just wanted to make sure. It should go without saying, but thanks again for putting the time and effort in to this forum!
Try this...
in TOS Create a new strategy, paste the code and name the strategy. (you would need to add it twice on the same chart)
Set the chart to 5 min time frame for the best results. (MNQ, MES futures)
add another copy of the indicator to the same strategy chart with different settings .
first indicator setting
input RSI_Period = 26;
input Slow_Factor = 13;
input usereversal = no;
input useorder = yes;
second indicator setting for reversal
input RSI_Period = 232;
input Slow_Factor = 29;
input usereversal = yes;
input useorder = no;
no changes made to the original script except the changes for the strategy orders (also commented out the lower study declaration and plots)
Please let me know if you found better setting for the strategy..
# QQE Indicator
# Converted by Kory Gill for BenTen at useThinkScript.com
# Original
https://www.tradingview.com/script/zwbe2plA-Ghosty-s-Zero-Line-QQE/
#declare lower;
input RSI_Period = 232;
input Slow_Factor = 29;
input QQE = 4.236;
def Wilder_Period = RSI_Period * 2 - 1;
def vClose = close;
def rsi = RSI(price = vClose, length = RSI_Period).RSI;
def rsi_ma = MovingAverage(AverageType.EXPONENTIAL, rsi, Slow_Factor);
def atr_rsi = AbsValue(rsi_ma[1] - rsi_ma);
def atr_rsi_ma = MovingAverage(AverageType.EXPONENTIAL, atr_rsi, Wilder_Period);
def dar = MovingAverage(AverageType.EXPONENTIAL, atr_rsi_ma, Wilder_Period) * QQE;
def DeltaFastAtrRsi = dar;
def RSIndex = rsi_ma;
def newshortband = RSIndex + DeltaFastAtrRsi;
def newlongband = RSIndex - DeltaFastAtrRsi;
def longband = if RSIndex[1] > longband[1] and RSIndex > longband[1]
then max(longband[1],newlongband)
else newlongband;
def shortband = if RSIndex[1] < shortband[1] and RSIndex < shortband[1]
then min(shortband[1], newshortband)
else newshortband;
def trend = if Crosses(RSIndex, shortband[1])
then 1
else if Crosses(longband[1], RSIndex)
then -1
else if !IsNAN(trend[1])
then trend[1]
else 1;
def FastAtrRsiTL = if trend == 1
then longband
else shortband;
input useorder = no;
input useorderstoploss = no;
input usereversalstoploss = no;
input usereversal = yes;
addOrder(OrderType.BUY_AUTO,useorder and trend<>trend[1] and trend == 1 ,tickColor = GetColor(1), arrowColor = GetColor(1), name = "B@ "+close);
addOrder(OrderType.sell_AUTO,useorder and trend<>trend[1] and trend == -1 , tickColor = GetColor(4), arrowColor = GetColor(4), name = "S@ " +close);
addOrder(OrderType.BUY_AUTO,usereversal and trend<>trend[1] and trend == -1 ,tickColor = GetColor(1), arrowColor = GetColor(1), name = "Br@ "+close);
addOrder(OrderType.sell_AUTO,usereversal and trend<>trend[1] and trend == 1 , tickColor = GetColor(4), arrowColor = GetColor(4), name = "Sr@ " +close);
addOrder(OrderType.BUY_to_close,useorderstoploss and trend == 1 and rsi_ma < 50 and FastAtrRsiTL < 50,tickColor = GetColor(1), arrowColor = GetColor(1), name = "Bsl@ "+close);
addOrder(OrderType.sell_to_close,useorderstoploss and trend == -1 and rsi_ma > 50 and FastAtrRsiTL > 50, tickColor = GetColor(4), arrowColor = GetColor(4), name = "Ssl@ " +close);
addOrder(OrderType.BUY_to_close,usereversalstoploss and trend == -1 and rsi_ma > 50 and FastAtrRsiTL > 50,tickColor = GetColor(1), arrowColor = GetColor(1), name = "Brv@ "+close);
addOrder(OrderType.sell_to_close,usereversalstoploss and trend == 1 and rsi_ma < 50 and FastAtrRsiTL < 50, tickColor = GetColor(4), arrowColor = GetColor(4), name = "Srv@ " +close);
https://drive.google.com/file/d/1Cf2nC569sj3idwR2DFANEGifSh2v6nNQ/view?usp=sharing
https://drive.google.com/file/d/1Cf2nC569sj3idwR2DFANEGifSh2v6nNQ/view?usp=sharing