View Single Post
Old 2009-04-16, 03:02 PM   #3 (permalink)
rsmereka
Site Supporter
 
rsmereka's Avatar
 
Trader for 8 - 12 years
Location: Southwestern Ontario, Canada
Posts: 1,777
My Trading Journal


Trading Live with:
Forex Hacked(Copier)
Default

Turns out that there were plenty of bugs in that initial alpha release of mt4_sqlite_loader. I squashed them all. Changes:

1. The program now knows when to stop scanning for trades although I need to make sure that this assumption remains stable.
2. I removed the 'balance' field from the 'closedtrade' table. Calculating and writing the balance for every trade was causing problems especially when (like Pipcop does in the Robominer live account statement on mt4stats.com), the closed trades in the statement file are in descending order (most recent first). We will be able to get the balance at any point by calculating on-the-fly anyway.
3. I was trying various statement files and the ones that are from IBFX using a mini account were causing a problem. IBFX in it's mini account puts an 'm' at the end of the currency pair. I removed the 'm' at the end before loading into the database.
4. Some of the test statement files I was trying came from mt4stats.com which started to cause another problem. You see mt4stats.com modifies the statement file. Any html tag with parameters (like <td title="blah">) in the original MT4 statement file does not quote the parameters (like <td title=blah>). This is technically wrong but I programmed the parser to accept this. When I tried parsing a statement file from mt4stats.com, I realized that they 'fix up' the statement file by quoting all parameters in tags. As a result, I had to make my parser more flexable by accepting both methods.

Bizzarroo but cool tip of the day:
I am using Php 'fopen' function to open the statement file. This function will accept a URL, like this:
php mt4_sqlite_loader db\elbizarroo.db http://www.website.com/statement.htm

Using this method will get mt4_sqlite_loader to parse the statement file directly from a web site. This method, however, mostly does not work because most webmasters including mt4stats.com do not allow programs to start opening files on the web server. This is generally considered a security risk.

On the other hand, try this method:
php mt4_sqlite_loader db\toocool.db ftp://user:password@example.com/somefile.txt

Here is the command I just tried and it works like a charm:

php mt4_sqlite_loader db/live.db "ftp://rsmereka:pass@ftp.mt4stats.com.../statement.htm"

The double slashes before the file name is required. Note that Pipcop's interface is mangling my examples.

Hey Pipcop. This #&*@&38 interface keeps mucking up my examples. How do I turn this off for a couple of words or sentences. I turned off 'automatically parse links' but it keeps on mangling by examples treating them as links. I tried quoting the example also. No joy.

Rick


Attached Files
File Type: zip 20090416.zip (13.4 KB, 10 views)
__________________
MyFXBook Live Statement Mt4Analysis
rsmereka is offline   Reply With Quote