Crossover coding in Metastock Exploration

#1
Hii...

I need a formula where if 15 days EMA crosses 30 days EMA metastock will be able to find results through exploration.

Crossover from below and above, both formula are required.

FYI i am using V11..Your help will be highly solicited..Thanks in advance.
 
#2
_SECTION_BEGIN("Price");
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", colorRose ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
_SECTION_END();

_SECTION_BEGIN("EMA");
P = ParamField("Price field",-1);
Periods = Param("Periods", 15);
Plot( EMA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
Cond1 = EMA( P, Periods );
_SECTION_END();

_SECTION_BEGIN("EMA1");
P = ParamField("Price field",-1);
Periods = Param("Periods", 30);
Plot( EMA( P, Periods ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style") );
Cond2 = EMA( P, Periods );
_SECTION_END();

Buy = Cross(Cond1,Cond2);
Sell=Cross(Cond2,Cond1);
PlotShapes(shapeUpArrow * Buy,colorBrightGreen,0,cond1,-22);
PlotShapes(shapeDownArrow * Sell,colorWhite,0,cond2,-22);

mkol = IIf( Cond1>Cond2, colorGreen, colorRed);
Plot(2, "ribbon", mkol, styleOwnScale|styleArea|styleNoLabel, 0, -15); // Weekly trend

_SECTION_BEGIN("Magnified Market Price");
FS=Param("Magnified Font Size",28,11,100,1);
GfxSelectFont("Arial", FS, 700, italic = False, underline = False, True );
GfxSetBkMode( colorWhite );
GfxSetTextColor( ParamColor("Color",colorBrightGreen) );
Hor=Param("Magnified Price X",20,1,1200,1);
Ver=Param("MAgnified Price Y",15,1,500);
GfxTextOut(""+C,Hor , Ver );
YC=TimeFrameGetPrice("C",inDaily,-1);
DD=Prec(C-YC,2);
xx=Prec((DD/YC)*100,2);
//GfxTextOut(""+DD+" ("+xx+"%)", Hor+5, Ver+45 );
GfxSelectFont("Arial", 12, 700, italic = False, underline = False, True );
GfxSetBkMode( colorWhite );
GfxSetTextColor(ParamColor("Color",colorViolet) );
GfxTextOut(""+DD+" ("+xx+"%)", Hor+5, Ver+45 );
TimeFrameRestore();
 

Similar threads