Can any one code this logic.

ocil

Well-Known Member
#1
logic for buy entry :

one minute EMA(90) crossing over one minute EMA(390) ( meaning the previous minute ema 90 is less than ema 390) and the ema(90) should also be greater than ema(150)

logic for buy exit :

one minute EMA(90) > EMA(390) and the ema(90) < ema(150).

logic for sell entry :

one minute EMA(90) cutting down one minute EMA(390) ( meaning the previous minute ema 90 is greater than ema 390) and the ema(90) should also be less than ema(150)

logic for sell exit :

one minute EMA(90) < EMA(390) and the ema(90) > ema(150).
 

johnnypareek

Well-Known Member
#3
logic for buy entry :

one minute EMA(90) crossing over one minute EMA(390) ( meaning the previous minute ema 90 is less than ema 390) and the ema(90) should also be greater than ema(150)

logic for buy exit :

one minute EMA(90) > EMA(390) and the ema(90) < ema(150).

logic for sell entry :

one minute EMA(90) cutting down one minute EMA(390) ( meaning the previous minute ema 90 is greater than ema 390) and the ema(90) should also be less than ema(150)

logic for sell exit :

one minute EMA(90) < EMA(390) and the ema(90) > ema(150).
IS THIS AS U LIKE??

HTML:
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{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", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() ); 
_SECTION_END();

E90=EMA(C,90);
E390=EMA(C,390);
E150=EMA(C,150);
Plot(E90,"EMA90",4,1);
Plot(E390,"EMA390",5,1);
Plot(E150,"EMA150",6,1);

Buy=E90>E390 AND E90 >E150;
Sell=E90>E390 AND E90 <E150;
Short=E90<E390 AND E90 <E150;
Cover=E90<E390 AND E90 >E150;
Buy=ExRem(Buy,Sell);
Sell=ExRem(Sell,Buy);
Short=ExRem(Short,Cover);
Cover=ExRem(Cover,Short);
PlotShapes(IIf(Buy, shapeUpArrow, shapeNone),colorGreen, 0,Low,-10); 
PlotShapes(IIf(Sell, shapeHollowDownTriangle, shapeNone),colorRed, 0,High,-15);  
PlotShapes(IIf(Cover, shapeHollowUpTriangle, shapeNone),colorGreen, 0,Low,-15);  
PlotShapes(IIf(Short, shapeDownArrow, shapeNone),colorRed, 0,High,-10);
 

Bewinner

Well-Known Member
#4
Johnnybhai...Thanks for the code...
But I have a question...before that please forgive me if it sounds stupid or foolish to u....
Can I able to change the thing like that way suppose in a 15 min or hourly chart I want to see 1 min EMA 90, EMA 390 and EMA 150 plotted in a chart?
 
#5
Johnnybhai...Thanks for the code...
But I have a question...before that please forgive me if it sounds stupid or foolish to u....
Can I able to change the thing like that way suppose in a 15 min or hourly chart I want to see 1 min EMA 90, EMA 390 and EMA 150 plotted in a chart?
Try this . ..

n = interval()/60;
Len01 = 90/n;
Len02 = 150/n;
Len03 = 390/n;

replace 90,150 & 390 with Len01,Len02, & Len03 in the original code

Should give you good approximation for what you want . . .



:) Happy
 

Similar threads

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?