Require Ema cross over formula

#1
Hii Freinds,

Need a crossover formula of

BUY= 3EMA H & 3EMA L cross to 100 EMA H

&

Sell= 3EMA H & 3EMA L cross to 100 EMA L

Please help me,:thumb:

:thanx:
 

sr114

Well-Known Member
#2
Hii Freinds,

Need a crossover formula of
BUY= 3EMA H & 3EMA L cross to 100 EMA H
&
Sell= 3EMA H & 3EMA L cross to 100 EMA L
scr shot


Code:
// EMA Crossover 3/100 hi lo
_SECTION_BEGIN("Price");
SetChartOptions(0,chartShowArrows|chartShowDates);
SetChartBkGradientFill( ParamColor("Inner panel upper",colorBlack),ParamColor("Inner panel lower",colorBlack));
//f=ATR(10);

a1=EMA(H,3); 
b1=EMA(L,3); 

a2=EMA(H,100);
b2=EMA(L,100);


Buy =  a1 > a2 AND b1 > a2; 
Sell =  a1 < b2 AND b1 < b2; 

Col = IIf(BarsSince(Buy) > BarsSince(Sell),colorOrange,colorBrightGreen);
Plot( C, "Cl.", Col, styleCandle );


Buy=ExRem(Buy,Sell);
Sell=ExRem(Sell,Buy);

shape=Buy*shapeUpArrow + Sell*shapeDownArrow;
PlotShapes( shape, IIf( Buy, colorBrightGreen,colorRed ),0, IIf( Buy, Low, High) );  // altered here

Plot(a1,"",colorBlue,1);
Plot(b1,"",colorRed,1);

Plot(a2,"",colorGreen,1);
Plot(b2,"",colorWhite,1);

GraphXSpace =5;

if( ParamToggle("Tooltip shows", "All Values|Only Prices" ) )
{
ToolTip=StrFormat("Open: %g\nHigh: %g\nLow: %g\nClose: %g (%.1f%%)\nVolume: "+NumToStr( V, 1.0 ), O, H, L, C, SelectedValue( ROC( C, 1 )));
}

Title = 
EncodeColor(colorBrightGreen)+ "EMA Xover" + " | " + Name() + " | " + EncodeColor(colorBrightGreen)+ Interval(2) +"|"+
 EncodeColor(colorBrightGreen) + " | " + Date() +" | "
+"\n"+EncodeColor(10) +"Open ="+O +","+" High ="+H +" ,"+" Low ="+L +","+ " Close ="+C + " | Pr. Chng : " +StrFormat("%.2f%",C-Ref(C,-1))+ " | Volume = "+ Numtostr(V,1.0)
+EncodeColor(10)+ "\n\n 3ema_hi = "+ EncodeColor(10)+Numtostr(a1,1.2)
+EncodeColor(10) + "\n 3ema_lo = "+ EncodeColor(10)+Numtostr(b1,1.2)+"\n"
+EncodeColor(10)+ "\n 100ma_hi = "+ EncodeColor(10)+Numtostr(a2,1.2)
+EncodeColor(10) + "\n 100ema_lo = "+ EncodeColor(10)+Numtostr(b2,1.2);
regards
 
Last edited:
#4
Dear SR114,

You are also using this strategy ,

Can you give your ratio of profit loss in monthly base.

Which indicator you are using for trade reversal confirmation.

I am using this strategy in 5 minuts chart.

Please if possible guide me.

Thanks
Light2001
 

sr114

Well-Known Member
#5
Dear SR114,

You are also using this strategy ,

Can you give your ratio of profit loss in monthly base.

Which indicator you are using for trade reversal confirmation.

I am using this strategy in 5 minuts chart.

Please if possible guide me.

Thanks
Light2001
Light2001

i am not using this indicator - so cant elaborate more abut it

i just wrote it

regards
 
#6
sr114 and Light2001

Sorry for asking such a noob question. How and where to put the formula written by sr114. i am very new to Metastock and trying to learn TA.

Thanks
 
#7
sr114 and Light2001

Sorry for asking such a noob question. How and where to put the formula written by sr114. i am very new to Metastock and trying to learn TA.

Thanks
Hii jdutt,

Please open metastock then start one by one click as per below
Tools
Indicator builder
New
Name: name the formula
Formula: pest your formula!
Okay


Now you can use your formula normal you use.
Very simple n fast

Best of luck
Light2001
 
#8
Thanks for help Light2001

I did as you advised, but after copy/paste when I click OK, I get the following error: This operator is not being used correctly.

I would like to specify that I copied from the very first character / / till last.

Please help again.
 

rh6996

Well-Known Member
#9
Are you copy pasting the formula given in this thread by sr114? The formula offered by sr114 is an AFL for Amibroker and not for Metastock !
 

Similar threads