// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/ // © WorkPiece 12.28.21 // @version=5 indicator ( title = "Real Relative Strength" , shorttitle = "RRS" ) comparedWithSecurity = input.symbol ( title = "Compare With" , defval = "SPY" ) length = input ( title = "Length" , defval = 12 ) //##########Rolling Price Change########## comparedClose = request.security ( symbol = comparedWithSecurity , timeframe = "" , expression = close ) comparedRollingMove = comparedClose - comparedClose [ length ] symbolRollingMove = close - close [ length ] //##########Rolling ATR Change########## symbolRollingATR = ta.atr ( length ) [ 1 ] comparedRollingATR = request.security ( symbol = comparedWithSecurity , timeframe = "" , expression = ta.atr ( length ) [ 1 ] ) //##########Calculations########## powerIndex = comparedRollingMove / comparedRolli...
function QQELine( indiValue, deltaRSIValue, smoothPeriod ) { local prevVal, prevIndi, qqeValue, indi_sum; local indi_diff, higherCond, lowerCond, result; prevVal = prevIndi = 0; qqeValue = Null; indi_sum = indiValue + deltaRSIValue; indi_diff = indiValue - deltaRSIValue; for ( i = 1; i < BarCount; i++ ) { prevVal = qqeValue[i - 1]; prevIndi = indiValue[i - 1]; higherCond = prevIndi > prevVal AND indiValue[i] > prevVal; lowerCond = prevIndi < prevVal AND indiValue[i] < prevVal; qqeValue[i] = Iif( indiValue[i] == prevVal, prevVal, Iif( lowerCond, Min( prevVal, indi_sum[i] ), Iif( higherCond, Max( prevVal, indi_diff[i] ), Iif( indiValue[i] > prevVal, indi_diff[i], indi_sum[i] ) ) ) ); } result = EMA( qqeValue, smoothPeriod );// EL XAverage is EMA return result; } // Modified Exponential Moving Average function MEMA( Price, Period ) { local smoothing, result; smoothing = 1 / Max( 1, Period ); result = AMA( Pric...