happyji, i am looking for an ma crossover system , based on 4 ma,
buy when 10 ma cross above 20 ma , when 50 ma is above 100 ma
sell when 10 ma cross below 20 ma , when 50 ma is below 100 ma.
pls give me the code for the above , you can also guide me to any trading system which are based on the above concept , that smaller TF ma crossover in the direction of the larger TF trend.
hi
try this
_SECTION_BEGIN( "Price" );
SetChartOptions( 0, chartShowDates | chartShowArrows | chartLogarithmic | chartWrapTitle );
_N( Title = StrFormat( "{{NAME}} - " + SectorID( 1 ) + " - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) Vol " + WriteVal( V, 1.0 ) + " {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ) );
Plot( C, "Close", colorRose, styleCandle | styleNoTitle | ParamStyle( "Style" ) | GetPriceStyle() );
_SECTION_END();
_SECTION_BEGIN("EMA CROSSOVER CHART");
LongPer = Param("Long Period", 10, 30, 100, 5);
ShortPer = Param("Short Period", 20, 30, 100, 5);
LongMA = MA(C, LongPer);
ShortMA = MA(C, ShortPer);
LastHigh = HHV(H, LongPer);
GraphXSpace = 10;
Lengtha = 50;
Pricea = MA(Close, Lengtha);
Lengthb = 100;
Priceb = MA(Close, Lengthb);
Buy = Cross(LongMA, ShortMA) AND Lengtha>Lengthb;
Sell = Cross(ShortMA, LongMA) AND Lengtha<Lengthb;
PlotShapes(shapeUpArrow * Buy, colorBrightGreen, 0, L, - 10);
PlotShapes(shapeDownArrow * Sell, colorRed, 0, H, - 10);
_SECTION_END();