Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/18/24 10:45
StartWeek not working as it should
by Zheka. 04/18/24 10:11
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 559 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, 11honza11, ccorrea, sakolin, rajesh7827
19046 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
DT prep steps for Metatrader (live trading) #432796
11/15/13 15:08
11/15/13 15:08
Joined: Jul 2013
Posts: 522
D
dusktrader Offline OP
User
dusktrader  Offline OP
User
D

Joined: Jul 2013
Posts: 522
I'm am starting this thread to share my findings. I think I'm "almost there" now. This is one of the final pieces in my research, before I can start live trading.

Metatrader is a really screwed-up piece of software. I think possibly it does more wrong to traders than right, and I'm not exaggerating when I say that. Over the years I have realized some of the significant shortcomings of this software, and watched how MetaQuotes has responded to inquiries about those shortcomings (often translating from Russian, to get the straight scoop from the horses mouth). During these episodes, the brokers dependent on MT4 basically have their hands tied at the mercy of MetaQuotes, and thus we the endusers get the spin message.

Fortunately Zorro software is nothing short of brilliant, from what I've seen. It overcomes a great deal of the Metatrader shortcomings, at least the ones that cause traders to fail. Unfortunately some of the good brokers (like IBFX) only support Metatrader. I should have tossed Metatrader aside long ago, insofar as I am a serious trader. Except that I am very fond of IBFX and other brokers and those relationships are also important. And additionally, I should note that in my testing Zorro has performed flawlessly with the MT4 bridge from what I've seen, so that gives me great confidence.

That leaves one final hurdle: Metatrader itself. The biggest issue I've been dealing with so far is preloading history. I understand that Zorro 1.20 will have some new preload features (that I'm excited to try) but aside from that, I would still expect Metatrader to perform consistently and not haphazardly as it seems to do by default. I also believe, without yet having reviewed Zorro's new preload feature, that ideally we want the LookBack data to come direct from the broker's feed for best results. That means the data needs to pass from the broker feed -> Metatrader -> Zorro (ideally).

I have made a lot of progress on this so far and I want to use this thread to share in detail what I've learned. I will be forming a consistent process with the goal of quickly bringing Metatrader up to spec for live trading. This process is important to me because I plan to execute multiple tradebots on multiple platforms simultaneously (the legion). I must have a quick way to come back online after any hiccup or failures (for example, VPS reboot issue, which has happened to me recently).

After researching this issue, I found a solution posted by George (gaheitman) on Steve Hopwood's forum here that seems very effective and ultra quick. This process probably only needs to be performed once per new-robot install. Thanks George!! (I've taken George's process and added a step-by-step that's applicable to Zorro bots.)

1. Determine the required preload history in days
This is the number of days of M1 data that Metatrader must preload from the broker feed. The formula I use to determine this is:
(BarPeriod * LookBack) / 1440 minutes per day
This formula gives an approximate amount of business days that will be needed for Zorro, but a little extra should also be added (probably for the unstable period). It should be noted that brokers have a limit to the amount of M1 bars available in their history feed (check with your broker). Therefore, it seems strategies requiring longer LookBack will need to use the new Zorro PRELOAD feature.

2. Setup trading Profile in Metatrader
In Metatrader, create a layout of charts to support this particular tradebot. First open a EURUSD window and add the Zorro expert adviser to it, then set this window aside. Then add to the layout one chart for each asset used your strategy. Set each chart to the M1 timeframe. When you have added all the asset charts to your layout, then go to File-> Profiles-> Save As... and give this layout a name. Then quit Metatrader.

3. Clear any existing Metatrader history
Locate the Metatrader install folder for this instance. Go into the History folder and locate the current history subfolder for your account. If multiple accounts have ever been added to this MT4 instance, you will see several subfolders, so you need to identify the current one by date. Mine is called "IBFX-MT4-Demo2". A new folder is created for history with each new account created inside the platform. Drill into the current history subfolder and delete all files in there.

4. Trick Metatrader to think it has a data gap to fill
Restart Metatrader now and go to the History Center (F2). For each pair your strategy uses, navigate to the pair's M1 data and double-click. Then double-click the topmost record (should be the latest date) and change the year to 1970. Do this for only the M1 data and only for each pair that your strategy requires.



5. Download current broker feed data into Metatrader
After closing History Center, go to each pair on your layout and right-click and select Refresh. In the journal tab, you should see a message indicating the feed download has started and then another entry when it completes.


6. Remove the trick record from Metatrader History Center
After downloading all the data, go back to History Center (F2) and remove the 1970 record you created for each M1 set.


7. Force Metatrader to commit preloaded data to disk
The data we just downloaded from the broker feed is still in RAM (apparently) and we want to make sure it gets committed to disk. I've found that an easy was to force it to commit to disk is to simply go to File-> Profiles-> and switch to (any other) Profile. Then you'll see that it does commit all the history to disk. Then just switch back to your Profile. It's important to do this Step, I've found, because if Metatrader crashes (VPS reboot, etc) then you will lose all the preloaded data from Step 5 and have to go through that entire process again. If you look in your history folder now you can see the history files have increased in size.


8. Begin Trade mode with Zorro
At this point, we should finally be ready to execute Trade mode on Zorro. Press Trade and ensure that EVERY asset in the Zorro window gets the same (maximum amount of) data minutes. If any asset is short, that means you did not preload enough of the required data for that asset (go back to Step 4). The messages appear like this:
Quote:
Loading NZDJPY prices.. 9900 min
Loading EURUSD prices.. 9900 min
Loading AUDUSD prices.. 9900 min
...

Re: DT prep steps for Metatrader (live trading) [Re: dusktrader] #432800
11/15/13 15:21
11/15/13 15:21
Joined: Apr 2013
Posts: 107
UK
G
Geek Offline
Member
Geek  Offline
Member
G

Joined: Apr 2013
Posts: 107
UK
I admire your persistence and work dusktrader and showing your findings here is appreciated.

Thanks.

Re: DT prep steps for Metatrader (live trading) [Re: Geek] #432810
11/15/13 19:35
11/15/13 19:35
Joined: Jul 2013
Posts: 522
D
dusktrader Offline OP
User
dusktrader  Offline OP
User
D

Joined: Jul 2013
Posts: 522
It seems the traders over at SteveHopwood's forum have already attacked this MT4 preload issue... I will check out all the solutions listed in this thread before proceeding with the AutoIt script. It would certainly be more elegant if we could actually get MT4 itself to retrieve the data. And then such a routine could even be added to Zorro's MT4 EA.

Edit: after researching this issue, I've found a solution that I'm very happy with and have now detailed it in the first post of this thread.

Re: DT prep steps for Metatrader (live trading) [Re: dusktrader] #434621
12/22/13 18:22
12/22/13 18:22

L
liftoff
Unregistered
liftoff
Unregistered
L



Since we have ZOrro 1.20, was the preload feature implemented?

Re: DT prep steps for Metatrader (live trading) [Re: ] #434625
12/22/13 20:42
12/22/13 20:42
Joined: Jul 2013
Posts: 522
D
dusktrader Offline OP
User
dusktrader  Offline OP
User
D

Joined: Jul 2013
Posts: 522
Yes it was implemented in v1.20. I have not tested it yet since the strategies I've been working on haven't required too much Lookback. If you design a higher barperiod strategy or one requiring more Lookback (and using MT4) then I think the new Preload feature might be the only way to make it work.


Moderated by  Petra 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1