Need help to write afl for this

manojborle

Well-Known Member
#1
Hi all

I am new to using amibroker and trading also.

I was just playing with EMA's and plotted them on 5 minute chart as shown.

I am using EMA of HIGH and LOW price for 20 and 50 period.
Conditions are :

Bullish view

1 . EMA-20 crosses over EMA-50 (Both High and Low at the same time)
2. Once the crossover has happened I need to check ADX(14) and it should cross 20 from below.
Here I will go Long
Exit will be when ADX(14) crosses 40 from above
Bearish View

1 . EMA-20 crosses below EMA-50 (Both High and Low at the same time)
2. Once the crossover has happened I need to check ADX(14) and it should cross 20 from below.
Here I will take short Entry.
Exit will be when ADX(14) crosses 40 from above

These are just my views and the experienced people please correct me where I am making mistakes so that I can clear my basics

Please help so that newcomers like me can also learn

Thanks in advance
 
Last edited:

manojborle

Well-Known Member
#2
By mistake I deleted the attachment , I am attaching the chart again
Hi all

I am new to using amibroker and trading also.

I was just playing with EMA's and plotted them on 5 minute chart as shown.

I am using EMA of HIGH and LOW price for 20 and 50 period.
Conditions are :

Bullish view

1 . EMA-20 crosses over EMA-50 (Both High and Low at the same time)
2. Once the crossover has happened I need to check ADX(14) and it should cross 20 from below.
Here I will go Long
Exit will be when ADX(14) crosses 40 from above
Bearish View

1 . EMA-20 crosses below EMA-50 (Both High and Low at the same time)
2. Once the crossover has happened I need to check ADX(14) and it should cross 20 from below.
Here I will take short Entry.
Exit will be when ADX(14) crosses 40 from above

These are just my views and the experienced people please correct me where I am making mistakes so that I can clear my basics

Please help so that newcomers like me can also learn

Thanks in advance
 

Attachments

manojborle

Well-Known Member
#3
I am trying this with this live example and i think it should be better to wait till adx(14) goes above 25
 

manojborle

Well-Known Member
#4
I am trying this with this live example and i think it should be better to wait till adx(14) goes above 25
 

manojborle

Well-Known Member
#5
I am expecting help from senior members here...........

:sos: :sos:
 

johnnypareek

Well-Known Member
#6
try this

HTML:
H20=EMA(H,20);
L20=EMA(L,20);
H50=EMA(H,50);
L50=EMA(L,50);

_SECTION_BEGIN("Price");

GraphXSpace=5;
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();
Plot(H20,"20 D High",6,1);
Plot(l20,"20 D Low",6,1);
Plot(H50,"50 D High",5,1);
Plot(l50,"50 D Low",5,1);
Buy=Cross(H20,H50) AND Cross(L20,L50);

Short=Cross(H50,H20) AND Cross(L50,L20);
Sell=Cross(40,ADX()) OR Short;

Cover=Cross(40,ADX()) OR Buy;

Buy=ExRem(Buy,Sell);
Sell=ExRem(Sell,Buy);
Short=ExRem(Short,Cover);
Cover=ExRem(Cover,Short);
johnny
 

manojborle

Well-Known Member
#7
Hi Johnny
I used this technique today in my trading that when we take entry it is better if we wait till ADX(14) goes above 25.
So I have to include it in my system now.
Now the system will be like this.....

1. Wait till there is crossover of the mentioned EMA'S
2. After the crossover has happened, check the ADX. If it is less than 25 wait till it comes to 25 level and then take position OR if it is more than 25 then it should be increasing from below 20 to 25 for last n periods.

Thanks
 

manojborle

Well-Known Member
#8
The charts are attached here.....




Please have a look and suggest me some improvements.

Thanks
 
Last edited:

manojborle

Well-Known Member
#9
The next chart is here


Guys please give your opinion wherever you feel was wrong to take trade so that I will try to rectify those errors and improve my trading.

Thanks
 

manojborle

Well-Known Member
#10
The next chart is here............
 

Similar threads