Skip to main content

QQE LINE





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( Price, smoothing );
return result;
}
Price = Close;
RSI_Period = 14;
RSI_Period2 = 7;
ATR_Period = 14;
Delta_Period = 14;
Val_Delta1 = 2.618;
Val_Delta2 = 4.236;
Smoothing = 2;
suplines = True;
OverSold = MxFromString("[30;0;10]");
OverBought = MxFromString("[70;0;100]");
rsiVal = RSIa(C, RSI_Period);
rc = ROC(rsiVal, 1);
thRSI = Iif(rc < 0, Ref(rsiVal, -1), rsiVal);
tlRSI = Iif(rc > 0, Ref(rsiVal, -1), rsiVal);
trRSI = thRSI - tlRSI;
atrRSI = Mema(trRSI, ATR_Period );
deltaATR_1 = Mema(atrRSI, Delta_Period) * Val_Delta1;
trRSIFast = QQELine(rsiVal, deltaATR_1, Smoothing);
deltaATR_2 = Mema(atrRSI, Delta_Period)* Val_Delta2;
trRSISlow = QQELine(rsiVal, deltaATR_2, Smoothing);
fillColor = IIf(trRSIFast > trRSISlow, colorTurquoise,colorViolet);
Plot(rsiVal, "RSI", colorWhite, styleLine);
Plot(trRSIFast, "Fast", fillColor, styleline);
Plot(trRSISlow, "Slow", fillColor, styleline);
style_cloud = styleCloud | styleClipMinMax | styleNoLabel;
PlotOHLC(trRSIFast, trRSIFast, trRSISlow, trRSISlow, "Fast Slow", fillColor, style_cloud);
if ( suplines ) {
for ( i = 0; i < 3; i++ ) {
Plotgrid( overbought[i][0], colorViolet );
Plotgrid( oversold[i][0], colorTurquoise );
}
}

Comments

Popular posts from this blog

TB 100.1.1 tsf tema linear

_SECTION_BEGIN("Magnified Market Price"); //by Vidyasagar, vkunisetty@yahoo.com// SetChartOptions(0,chartShowArrows|chartShowDates); FS=Param("Font Size",30,11,100,1); GfxSelectFont("Times New Roman", FS, 700, True ); GfxSetBkMode( colorWhite ); GfxSetTextColor( ParamColor("Color",colorWhite) ); Hor=Param("Horizontal Position",750,1,1200,1); Ver=Param("Vertical Position",7,1,830,1); GfxTextOut(""+C , Hor , Ver ); YC=TimeFrameGetPrice("C",inDaily,-1); DD=Prec(C-YC,2); xx=Prec((DD/YC)*100,2); GfxSelectFont("Times New Roman", 11, 700, True ); GfxSetBkMode( colorWhite ); GfxSetTextColor(ParamColor("Color",colorWhite) ); //GfxTextOut("Open - "+O+" High - "+H+" Low - "+L+" Close - "+C, Horr , Verr-14 ); //GraphXSpace = Param("Graph Space",500,-10,500,1); _SECTION_END(); _SECTION_BEGIN("Trend Blaster V1.2"); SetChartBkColor(...

Daily RSI

_SECTION_BEGIN("Unnamed 2"); ////////////////////////////////////////////////////////////////// TimeFrameSet(inDaily); dRSI = RSI(14); TimeFrameRestore(); TimeFrameSet(inDaily); DailyRSI = RSI(14); TimeFrameRestore(); TimeFrameSet(inDaily); dRSI = RSI(14); TimeFrameRestore(); Plot( TimeFrameExpand(dRSI ,inDaily),"daily RSI 14",colorGreen,styleHistogram|styleThick); Plot( RSI(14),"RSI 14",colorRed,styleThick); Plot( TimeFrameExpand(dRSI ,inDaily),"daily RSI 14",colorGreen); Plot( TimeFrameExpand(DailyRSI ,inDaily),"daily RSI 14",colorBlue); Filter=1; AddColumn( TimeFrameExpand(dRSI ,inDaily), "daily RSI 14"); AddColumn( TimeFrameExpand(dRSI ,inDaily), "daily RSI 14"); ////////////////////////////////////////////////////////////////// _SECTION_END();

STAN WEINSTEIN'S STRATEGY - Halan Manoj Kumar

// THIS AFL INCORPORATES MOST OF THE CONCEPTS OF STAN WEINSTEINS TRADING METHODOLOGY. // USE ONLY WEEKLY CHART. // THIS AFL DOES NOT GUARANTEE ANY POSITIVE RETURNS. // USE THIS AFL AT YOUR OWN RISK // THIS AFL WAS DEVELOPED BY HALAN MANOJ KUMAR, MSC,CAIIB,FRM,PRM,CMA,ACMA. HOWEVER IN SOME CASES INDIVIDUAL CODE SNIPPETS ARE FROM DIFFERENT SOURCES AND I THANK THOSE DEVELOPERS. // ANY CONCEPTUAL QUERIES OR COMMENTS CAN BE MAILED TO scorpiomanoj73@gmail.com _SECTION_BEGIN("CHART"); SetChartOptions(0,chartShowArrows|chartShowDates); _N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%)", O, H, L, C, SelectedValue( ROC( C, 1 ) ) )); Plot( C, "Close", ParamColor("Color", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() ); _SECTION_END(); //RELATIVE STRENGTH // IF YOUR NIFTY TRADING SYMBOL IS DIFFERENT, PLEASE USE THAT INSTEAD OF ONE MENTIONED HERE. rsmaPeriod...