Need Ribbon for QQe Afl

#1
Anybody please plot the ribbon for this afl


_SECTION_BEGIN("QQe");
// QQE (Quantative Qualitative Estimation)

QQE_Periods = Param("Period", 14, 3, 30, 1 );
QQE_SF = Param("Smoothing factor", 5, 1, 30, 1 );

QQE_RSI_MA = EMA(RSI(QQE_Periods),QQE_SF);
QQE_ATR_RSI = abs(Ref(QQE_RSI_MA,-1)-QQE_RSI_MA);
QQE_MA_ATR_RSI = EMA(QQE_ATR_RSI, 2*QQE_Periods-1);
QQE_DAR = EMA(QQE_MA_ATR_RSI, 2*QQE_Periods-1)*4.236;
QQE_DAR_Fast = EMA(QQE_MA_ATR_RSI, 2*QQE_Periods-1)*2.618;


function QQE_TR(RSIMA, DARFACTOR)
{
result[ 0 ] = 0;

for( i = 1; i < BarCount; i++ )
{

if (RSIMA < result[i-1])
{

result=RSIMA+DARFACTOR;

if ((RSIMA[i-1] < result[i-1]) AND (result > result[i-1]))
{
result = result[i-1];
}
}
else
{

if (RSIMA > result[i-1])
{

result=RSIMA-DARFACTOR;

if ((RSIMA[i-1] > result[i-1]) AND (result < result[i-1]))
{
result = result[i-1];
}

}

}

}

return result;
}


QQE_FastSignal = QQE_TR(QQE_RSI_MA,QQE_DAR_Fast);
QQE_SlowSignal = QQE_TR(QQE_RSI_MA,QQE_DAR);

Plot(QQE_RSI_MA,"QQE"+ _PARAM_VALUES(),ParamColor("QQE color", colorRed ), ParamStyle("QQE style",styleThick));
Plot(QQE_FastSignal, "FastSignal", ParamColor("FastSignal color", colorOrange ), ParamStyle("FastSignal style",styleDashed) );
Plot(QQE_SlowSignal, "SlowSignal", ParamColor("SlowSignal color", colorBlue ), ParamStyle("SlowSignal style",styleDashed) );

Buy = Cross(QQE_RSI_MA, QQE_SlowSignal);
Sell = Cross(QQE_SlowSignal, QQE_RSI_MA);
Short=Sell;
Cover=Buy;

shape = Buy * shapeUpArrow + Sell * shapeDownArrow;
PlotShapes( shape, IIf( Buy, colorGreen, colorRed ), 0, QQE_RSI_MA );
_SECTION_END();
 

casoni

Well-Known Member
#2
Hello,
// Plot the ribbon
ribboncol= IIf( BarsSince(Buy)<BarsSince(Sell), colorGreen, colorRed );
Plot( 2, "", ribboncol, styleArea | styleOwnScale | styleNoLabel, 0, 100 );
hope this is what you required.
 

Similar threads

Intraday Higher Leverage

Save up to 90% in brokerage and get higher leverage for intraday trades.

Name:Phone:
Email:City:
State:
Are you a day trader?