Jump to content

I need a quickie EA


MerlinBrasil

Recommended Posts

Hi,

 

When I'm testing EAs it would be a great help if I had a separate EA on a chart which will

log Account Balance and Equity to a file every X minutes.

 

This would provide me with the raw data necessary to track Running Drawdown

 

Essentially, it would just have to log:

 

1. Timestamp

2. Account Balance

3. Account Equity

 

every X minutes (variable) in a CSV file so that I can do the calc work in Excel.

 

The filename could be derived from the Account Number.

 

Would anyone be willing to cobble this together?

 

Thanks,

Merlin

Link to comment
Share on other sites

  • 2 weeks later...

Hi,

 

I guess you need to read this thread for some guy "pip4life" at Forex Factory:

 

"Greetings all,

 

I get so much from this forum I want to give something back to it. I re-wrote a script called OrderHistory.mq4 that someone else created that goes through your trade history records and plots them on a chart window. You can graphically review the trades that you made and evaluate them for the quality of entries and exits.

 

Often it is said that traders regret when they let a profitable trade slip away, yet many also say they wish they would let their profits run longer. Sometimes we pull the buy or sell trigger too soon or too late, either upon entry or exit.

 

Just how often would you be helped or hurt by altering your strategy? With the ability to see your trades graphically, you can get a much better feel for how things might have turned out if you did.

 

While the original script was a good start, I added trendlines to mark each trades entry and exit. I improved the placement of texts for readability, and tweaked around with all the code to add features which I think will be well appreciated. Even so, I've described a long enhancement list for more ideas that anyone could help implement if you would like. Actually, I'm a hacker, not a professional programmer but I think this is pretty well documented and it works pretty well. Still, if you find any bugs, please report them, and if you have a suggested fix, even better!

 

Attached is the script, and I will post an example of a chart. Open the script in MetaEditor to review the instructions, options, and features.

 

With appreciation for all the forum contributors,

Pips4life

-----------------

Individually, we only know a little. Collectively, what we know is mind boggling!

 

NEW Comments (2010-Jan-11):

 

Two-and-a-half years later, I have a lot more programming experience with MT4 and I decided to update the old version in a big way.

 

A major new version is available: "P4L OrderHistory.mq4" (V4).

The new features are listed below, but read a full description inside the script.

 

This is a script, not an indicator! Therefore, install it under:

C:/...your_MT4/experts/scripts/

As a script, it runs only once, but can be added over-and-over, each time with different user variable settings.

 

IMPORTANT:

This script will display on a chart your open trades, and/or closed trades that are within the Custom Period range you choose in the Terminal->AccountHistory tab!

In addition, you can export/import trade history data to combine history from multiple brokers (http://www.forexfactory.com/brokers.php)!

 

UPDATES:

2007-09-13: First version "OrderHistory V2.mq4" released. (Downloaded 1045 times before next version update).

(Deleted from Post #1 due to major new version replacement).

 

2010-01-11: New "P4L OrderHistory.mq4" (V3) released.

* Renamed from "OrderHistory V2.mq4" to "P4L OrderHistory.mq4"

* Input variables now changeable by popup when added to chart

* Trade History can be OUTPUT and/or INPUT from CSV files!

* Easily read by Excel for external analysis

* History from multiple brokers can be combined onto one MT4

* DisplayText now "false" by default to reduce clutter (easily changed)

* More information reported about the trade.

* Extra-digit brokers supported! Pips automatically adjusted by 1/10th.

* Trade-time (from Open->Close) calculated and displayed.

* Objects easily deleted from chart.

* Colors slightly modified to work on Black OR White backgrounds.

* SLIPPAGE is calculated and noted if >= 1 pip tolerance. (SLslip is negative-slip; TPadd is positive-slip).

* New StartDate and EndDate to specify a date range (Useful when importing data from other brokers)

* Alert messages added, plus many other changes to improve useability

 

2010-01-11: New "P4L OrderHistory.mq4" (V4) released. (Downloaded 348 times before next version update).

(I thought support for Open trades would take longer...)

* Added support for Open (active) trades. Show_ClosedOpenAll_Trades_123 = 3 (default,All trades)

* Added "closed", "demo", and 4 placeholder columns to the database format

* Demo trades are marked with a prefix "*" in profit string (e.g. "*Net:$ xx.xx")

* Fixed bug to exit when output file = input file (infinite loop)

 

2010-08-23: New "P4L OrderHistory.mq4" (V5) released.

* The input/output file format (column order) was changed but files created by previous versions ARE still compatible as input files. The benefit is that standard MT4 Statements (reports) can be read into Excel, then converted and written out as a tab-delimited file (with 14 data columns) and used as an input file. (Detailed instructions) (http://www.forexfactory.com/showpost.php?p=3974310).

* Added variables Input_File_Delimiter and OUTPUT_File_Delimiter with default of "Tab". (Comma or Semicolon or other specific characters can be specified).

* Added "DrawMostObjectsAsBackground" (true). Normal use-model assumes F8 "Chart on Foreground" is OFF but user can experiment and can change this variable to "false" if desired.

* To suppress trades from AccountHistory and just show those from input file(s), the user can specify input as "ONLY filename1 ...". Alternatively, the user can change new variable "IncludeTradesFromAccountHistory" to "false".

* This version calls a private-author library routine that can read the trades taken by any EA in the StrategyTester and convert the format into a standard input-file format to display the EA-simulated trades on a chart. This library file has not been provided for free/public use, but the missing library file is ignored when using standard input files."

 

 

And many Thanks to Pipe4Life for his great work, and sharing such valuable info.

 

Best wishes,

 

Scarface

a New Year 2011 has come, and the challenge has just started 8-)
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...