8.8 C
New York
Thursday, March 28, 2024

Craigbot 1.0

Ok guys, here is my first crack at the simplest forex trading bot I could come up with.  If you look at a chart of the EUR/USD you will notice that after every large drop there is a bounce.  So our goal for this bot is to recognize when we have had a large drop, then try to catch the bounce. Before you go any further you should go back and read my first article and make sure you have done the following things,

  1. Installed Meta Trader 4.
  2. You have signed up for a DEMO account from an ECN Broker.  ATCBrokers is the only one that I know of that will give a free demo account and is an ECN Broker, instead of one who makes their money off the spread.  If you find another, please let me know and I will post it here.
  3. You can successfully backtest any Expert Advisors that I post here.

Now that you have the environment set up Lets start to rock and roll.  In my opinion every Expert Advisor should be designed in pretty much the same way.  The first thing you have to is decide under what criteria to open a position.  Then you have to decide under what criteria to close a position.  You can get really fancy but everything pretty much boils down to those two decisions.  If you get those wrong then everything else you do doesn’t really matter. Now we have to decide how to open a position.  After some statistical analysis here is what I came up with.  We should Buy every time the EURUSD drops 41 pips, our order should have an 18 pip take profit and 42 pip stop loss.

The following is a link to what your start function should look like.

Start Function

Here is a summary of the results of backtesting from Jan 27 to March 23.  *WARNING* these are not live results.  These are the results of running this program on historical data.  But, since we can’t go back in time, this all we have got. Initial deposit: $5000

Total net profit: $6810 (after commision)

Ending Ballance: $11810

Here is the detailed report of the test.

I am going to to be running this on the DEMO account that I opened up and lets see if we are on to something.  If you would like to follow along, then all you have to do is create a new expert advisor and replace your start function with this one.  If there are any questions about the code here, dont hesitate to ask.

Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments

Stay Connected

157,452FansLike
396,312FollowersFollow
2,280SubscribersSubscribe

Latest Articles

0
Would love your thoughts, please comment.x
()
x