|
Kiran
2016-03-13 18:40:45
|
|
I'm using AutoSR and Searchfor to find the last horizontal Support and Resistence lines (i.e. with slope<10degrees) and plot them (code below)
1) The code doesnt plot any horizontal Support/Res lines - is my Searchfor syntax correct?
2)Alternately, can horizontal S/R be expressed using _aboveline/_belowline? - pl advise as i'm not clear on how _belowline can be used to describe resistence.
res = searchfor _belowline(close, close) and (_slope(close, ___ )*180/3.14 <10;
////Code for (1)...
period = 50;
res = searchfor AutoSR(1, 0, period) and absolute(SlopeAutoSR(1, 1, period)*180/3.14)<10 ;
sup = searchfor AutoSR(1, 0, period) and absolute(SlopeAutoSR(1, 1, period)*180/3.14)<10 ;
resLag = barssince(res);
supLag = barssince(sup);
period = 50; // The period used to calculate the trendlines
resLine = AutoSR(1, resLag, period); // Resistance level for each trading bar
supLine = AutoSR(0, supLag, period); // Support level for each trading bar
PlotCandleStick("Quotes", colorBrown|255|colorViolet|255|0, StyleSymbolVdash);
Plot(volume, "Volume", colorLime|55|colorLime|64|0, ChartBar, StyleOwnScale);
plot(resLine, "Resistance", colorBlue, ChartLine, StyleNoScale);
plot(supLine, "Support", colorRed, ChartLine, StyleNoScale);
|
|