EA using ATR and ADX - page 2

 
alexjbrandt:
Umm...a chart? What do you mean by a chart from my description, what is there to chart? Also, the gentleman who said he can code it, already coded it...I have it installed on my trading platform right now.

Have you tested it? How does it work?

I'm starting to code it too and your feedback would be great.

I'd add a lot size as a % of the equity based on the value of the ADX value (the greater the value, the stroger the trend, the bigger the size of lots... Ex. ATX=20 then the EA will use 20% of the available equity to open the order).

Andrea

 
andreahaku:
Have you tested it? How does it work?

EA will use 20% of the available equity to open the order

Andrea

That's crazy ! 1% to 2% of your equity or free margin MAX. Just a suggestions . 5% to 10% is considered a gun touting outlaw. Remember 20% profit sounds awesome, but flip it, 20% LOSS is just as easy and more likely.

 
jmca:
That's crazy ! 1% to 2% of your equity or free margin MAX. Just a suggestions . 5% to 10% is considered a gun touting outlaw. Remember 20% profit sounds awesome, but flip it, 20% LOSS is just as easy and more likely.

You're right but one of the parameters can be the a multiplier/divider of the ATR value to be use. Something like risk factor.

The EA shouldn't trade that often. Basically it all depends on the timeframe choosen.

If you can share the code I can implement it and test the best risk factor

Cheers,

Andrea

 
andreahaku:
Have you tested it? How does it work?

I'm starting to code it too and your feedback would be great.

I'd add a lot size as a % of the equity based on the value of the ADX value (the greater the value, the stroger the trend, the bigger the size of lots... Ex. ATX=20 then the EA will use 20% of the available equity to open the order).

Andrea

It was just "fresh off the press" yesterday so I haven't had time to actually test it. However, the limited time I got to operate it before the markets closed, the fundamentals work like its supposed to, I couldn't ask for better. When it starts to run 24/5 next week, I will share my results here. I see what you mean by a stronger the trend, the bigger the lot value. However, thats alot of risk. I've seen instances of where the ADX strength line is well above 60 then it goes back down to 20 over a period of hours. A cross can still occur when the ADX strength line is above 40. Case in point, go to the EUR/USD M15 TF, and attach the ADX indicator to the chart, then look at 30 Jan 2:00 through 30 Jan 3:00. In that one hour, you will see that the ADX strength line was well above 40, but a cross still occurred. If any of us were using your money management code, we would all of a sudden have 40% of our equity into one trade. However, since it was the +Di that went above the -Di line, a buy order would have been placed. Now look at what happened a half hour after your EA would have placed a buy order, another cross occurred, and you wouldn't have hit your T/P, therefore you'd have a massively losing trade for the next three hours if you didn't get a margin call before that, and at best, you would have broke even. There are settings that you can place to make sure that the EA doesn't place a long or short position on a "false signal". I think that value is 10, you can adjust that setting through an external input. Once the difference reaches above 10 then you can be assured that the EA won't initiate a order on a 'false signal' based on my observations. This is just something to think about as you code your EA. Hope it helps.

 

Thanks a lot for all your suggestions! I'm taking them in considerations when coding.

I'll be more prudent

About SL... it can be done using the LOW of the bar before the cross in case of a BUY order and the HIGH in case of a SELL order. Or it can be the same amount of the TP to have a 1:1 ratio.

Have you implemented a SL level? If so, how?

Cheers,

Andrea

 

Well, I debated about what kind of S/L should be used. Right now, theres three options for the S/L. You can set the S/L to be the same as the T/P using the ATR value, so its 1:1 However, I think thats really risky as you could hit the S/L mark before you hit the T/P mark in a volatile market. The other option is to have the S/L be entered by an external input by the user. And then of course, theres the option of no S/L. Right now I've inputed my own value of S/L for the EA. I have read of where some users want a S/L based on how much equity they are willing to lose per trade.

 
alexjbrandt:
Umm...a chart? What do you mean by a chart from my description, what is there to chart? Also, the gentleman who said he can code it, already coded it...I have it installed on my trading platform right now. : )( party)

chart is there to show your system - what your ea does (entry/exits) on what principles (what you been describing above):

"So using these two indicators, (possibly 3 with the Parabolic SAR) I think a person could create an awesome EA. "

-but you all set - so don't bother

 

Why is 14-periods quite often optimal?

Many indicators use 14-periods as the default.

I normally use 14 as a starting point, but I also include this as a backtesting parameter where I give it a range of 3 to 50. Quite often or see it seems to me, that the optimal value points back at somewhere around 14.

Is it just me, or maybe there is an explanation behind the number of 14?

 
blogzr3:
Many indicators use 14-periods as the default.

I normally use 14 as a starting point, but I also include this as a backtesting parameter where I give it a range of 3 to 50. Quite often or see it seems to me, that the optimal value points back at somewhere around 14.

Is it just me, or maybe there is an explanation behind the number of 14?

Wilder, who invented ADX and many TA tools, worked on period of half of the moon cycle (14 days = 10trading days), which is a short term for the stocks.

Since that time, many analysts have adopted his 14 days period (and maybe that's why it works...)

 

CodersGuru

Alex,

The Guru is CodersGuru, and he wrote a series of lessons about coding MT4. If you aren't interested in coding, then it will be excruciating. I am really not that interested either-- just more in systems, but I've learned how to write some code and make modifications, just not too much. The TSDs of which I wrote, do have stops that move to the opposite extreme of previous bars. I am grateful that it has kept me from too much trouble while I try to learn more.

Reason: