Trading Systems Leaders in this forum (automated trading systems) are winning more than 3000 pips in a month (30000$ investing one lot every time). Click here to register and get more information
In the previous lesson we created our first indicator. Although this indicator wasn’t useful for us as trader, but it was very useful for us as programmers.
The indicators -in general- are very important for the technical analysis of the market in trying to predict the future prices.
But with the indicators we observe the chart then use our hands to sell, buy and modify our orders manually. You have to set in front of your terminal, and keep your eyes widely open.
If you get tired, want to drink a cup of tea or even take a short vacation. You have to consider one of these solutions:
You may rent someone to observe the terminal for you and calling your mobile phone every five minutes to tell you what’s going on. If this employee is an expert, he will cost you the pips you earn. And if he is novice one, he will cost you your capital.
The second solution is using a program to automate your trades.
That’s what the Expert Advisor is for.
The Expert advisor is a program wrote in MQL4 (we are studying MQL4 huh?) uses your favorite indicators and trade methods to automate your orders.
It can buy, sell and modify the orders for you. It enables you to drink a cup of tea and save the salary you gave out to your employee or the bunch of flowers you bring to your assistant wife.
.......
Hi Coders Guru,
I'm looking forward to learning all the parts of this EA. I noticed in the code:
static int last_direction = 0;
static int current_dirction = 0;
Note the missing "e" in the 2nd line. I don't know if this will matter, but I thought I'd better bring it to your attention.
This EA seems to be a EMA 8,13 crossover. It makes a loss on my eurusd H4 chart, so I would like to be able to optimise the 8 and 13. I guess by now we should be able to make them ext double variables and optimise them, so I will try to do that.
Also, how do we ask the EA to draw the 2 EMA's on the chart? I don't know why EA's don't automatically draw the indicators they use, because we will always want to see them.
Thanks again for these great lessons.
Last edited by barry; 11-25-2005 at 01:41 AM.
Reason: More thoughts
Hi Coders Guru,
I'm looking forward to learning all the parts of this EA. I noticed in the code:
static int last_direction = 0;
static int current_dirction = 0;
Note the missing "e" in the 2nd line. I don't know if this will matter, but I thought I'd better bring it to your attention.
Thank you very much for your notice, Although it will not make problems in the code, but I'll correct that.
Quote:
This EA seems to be a EMA 8,13 crossover. It makes a loss on my eurusd H4 chart, so I would like to be able to optimise the 8 and 13. I guess by now we should be able to make them ext double variables and optimise them, so I will try to do that.
It makes profit for me (EURUSD - H4), Please tell me how many Bars in test (you will find this number in the left top of the Report). Anyway, this EA is for educational purpose only.
Quote:
Also, how do we ask the EA to draw the 2 EMA's on the chart? I don't know why EA's don't automatically draw the indicators they use, because we will always want to see them.
Yes, it’s a bad thing that the EAs don't automatically draw the indicators they use in the live trading.
But you can see the indicator in Strategy tester by clicking Open chart button in the Strategy Tester Settings tab.
Coders Guru,
Thanks for the report. I know the point of this is to learn to code, but I wanted to check that we get the same results, so I know I'm doing it right. In fact, we don't get the same results for the same script, but it's pretty close, and I'm guessing the difference is due to different data. I get my data from InterbankFX.
Thanks again, love the course,
Barry
I was have 832 bars, Please find the detailed report attached.
Hallo guru ,I it seems like the result of the ea here is go south ,what happen? is is becouse of differnce of the broker or I dont know how to apply it ,your look great base on what is these ea guru ? Regards audio
Hallo guru ,I it seems like the result of the ea here is go south ,what happen? is is becouse of differnce of the broker or I dont know how to apply it ,your look great base on what is these ea guru ? Regards audio
Audio,
I think the differnce of the data feed (as Barry said) is the reason of the differnce of results. For example different brokers and the different number of bars.
Anyway , This EA is for educational purpose and we can not study its behavior as a real EA.
I think the differnce of the data feed (as Barry said) is the reason of the differnce of results. For example different brokers and the different number of bars.
Anyway , This EA is for educational purpose and we can not study its behavior as a real EA.
ok guru but if we reverse the contain of it may be good?