What differences between forex and indices (ger40 example) to realize EA? mql5

 
hi all, i am looking for help in understanding the differences in coding for mql5 EA , between forex and indices (example dax30) and commodities.
The request is open-ended and not specific, because I guess there are various data to set.
I am waiting for someone who works with EA on indexes like dax40/ger40 for example , to start explaining me from their point of view, my request is not specific because I accept any suggestions

thanks
 
Gianni.D:
hi all, i am looking for help in understanding the differences in coding for mql5 EA , between forex and indices (example dax30) and commodities.
The request is open-ended and not specific, because I guess there are various data to set.
I am waiting for someone who works with EA on indexes like dax40/ger40 for example , to start explaining me from their point of view, my request is not specific because I accept any suggestions

thanks
A proper coded EA has no such limitations.

All relevant parameters are given by the symbol specifications and your code should adapt to them accordingly.

Your EA should execute your strategy accordingly to data feed (ticker) and adjusted to the parameters from symbol and account.

Wether your strategy has been developed for forex, indices or stocks (or whatever) is a totally different aspect, and should not be part of your EA in such way.


 
Thanks for the reply,

1 How should I manage the point of the CFD index unlike Forex? This is important for calculating the entry and sale price.

2 Should trading hours also be set to match the trading hours of the chosen index?

3 Does Mql5 have reliable historical data for indices and commodities?
 
Gianni.D #:
Thanks for the reply,

1 How should I manage the point of the CFD index unlike Forex? This is important for calculating the entry and sale price.

2 Should trading hours also be set to match the trading hours of the chosen index?

3 Does Mql5 have reliable historical data for indices and commodities?

1. I don't use points or pips. I base all my stop loss and take profit calculations off ATR (average true range). That ends up putting you at the right scale for the symbol, timeframe, and current market conditions. Depending on the timeframe you're trading, you may want to use a longer ATR period. For example, trading on daily, the default of 14 is probably good. Trading on M1, you may want to run a much longer period, like an hour or two (60/120 ATR periods). While you can get the points specification from the symbol info, that won't help you with the fact that an appropriate stop loss on an M1 timeframe is very different from an appropriate stop loss on the Daily timeframe. Using ATR makes it at least a little more portable between timeframes.

2. It depends whether you're trading the index as a CFD or an ETF. If it's a CFD, it may be available to trade 23 hours a day. Either way, all of my EAs have a time filter for starting & ending trading hours, which you can then optimize on. Odds are good that your optimal trading window will not exactly line up with any one market's complete session. Just make it as inputs and let the data tell you what hours are best for each particular asset.

3. Doesn't matter what MQL5 has, but what your broker has. There are third-party sources that have better data, farther back, for a fee.