Buy/sell Signal and Exploration result is not same

#1
Would someone plz rectify the problem. The buy/sell signal in the chart and the scan buy/sell signal is not simillar.

Thanks.


_SECTION_BEGIN("MA High Low");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorGreen ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );

MAHighPeriod=Param("MA High Period",5,5,150,1);
MALowPeriod=Param("MA Low Period",15,5,150,1);
Price=Close;
MAHigh=MA(Close,MAHighPeriod);
MALow=MA(Close,MALowPeriod);

Plot(MAHigh,"MA-High", colorGreen,styleLine,styleThick);
Plot(MALow,"MA-Low", colorRed,styleLine,styleThick);

Buy = Cross(Price,MAHigh);
Sell = Cross(MALow,Price);


Filter = Buy OR Sell;

PlotShapes(IIf(Buy,shapeUpArrow,shapeNone),colorGreen,0,Graph0);
PlotShapes(IIf(Sell,shapeDownArrow,shapeNone),colorRed,0,Graph1);
 

casoni

Well-Known Member
#2
try this way
make sure your chart timeframe and AA "settings > peridocity" are same

MAHighPeriod=Param("MA High Period",5,5,150,1);
MALowPeriod=Param("MA Low Period",15,5,150,1);
Price=Close;
MAHigh=MA(Price,MAHighPeriod);
MALow =MA(Price,MALowPeriod);

Plot(MAHigh,"MA-High", colorGreen,styleLine,styleThick);
Plot(MALow,"MA-Low", colorRed,styleLine,styleThick);

Buy = Cross(Price,MAHigh);
Sell = Cross(MALow,Price);

PlotShapes(IIf(Buy,shapeUpArrow,shapeNone),colorGreen,0,Graph0);
PlotShapes(IIf(Sell,shapeDownArrow,shapeNone),colorRed,0,Graph1);

bp=sp=Price;
Filter = Buy OR Sell;
AddColumn(IIf(Buy,BP,Null),"Buy", 1.2,1,colorGreen,50);
AddColumn(IIf(Sell,SP,Null),"Sell " ,1.2,1,colorOrange,50);

thank you
 
#3
Try This & Enjoy.

_SECTION_BEGIN("MA High Low");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorGreen ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );

MAHighPeriod=Param("MA High Period",5,5,150,1);
MALowPeriod=Param("MA Low Period",15,5,150,1);
Price=Close;
MAHigh=MA(Close,MAHighPeriod);
MALow=MA(Close,MALowPeriod);

Plot(MAHigh,"MA-High", colorGreen,styleLine,styleThick);
Plot(MALow,"MA-Low", colorRed,styleLine,styleThick);

Buy = Cross(Price,MAHigh);
Sell = Cross(MALow,Price);


Filter = Buy OR Sell;

PlotShapes(IIf(Buy,shapeUpArrow,shapeNone),colorGreen,0,Graph0);
PlotShapes(IIf(Sell,shapeDownArrow,shapeNone),colorRed,0,Graph1);
_SECTION_END();
 

Broker Special Offers

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?