BasketMirrorEA

Rene's trading Expert Advisors
User avatar
renexxxx
Trader
Posts: 860
Joined: Sat Dec 31, 2011 3:48 am

BasketMirrorEA

Post by renexxxx »

This EA is meant to be run in combination with EquityBalancePlot

The idea is this: You have one Empty4 account (say: account A), that runs an EA (or set of EAs) and produces a particular Equity curve as a result of that. On account A you install the EquityBalancePlot, that produces two files in the Common File area -- the timeseries data file of the Equity and Balance (named: EquityBalance_<accntnr>.bin) and the csv file of the currently open trades (named: EquityBalance_<accountnr>_<magic>.csv).

On another account (say: account B) you start BasketMirrorEA and you point the LogFileName and BasketFileName parameters to the correct file names, that you want to mirror.

What BasketMirrorEA does, is figure out when the Equity and Balance on account A is going up and at such times, literally copy (or mirror) every single open trade from account A to account B. So, if trades are being closed on account A, BasketMirrorEA will do the same on account B. And if new trades are being opened on account A, the same will happen on account B. It won't mirror pending trades from account A to account B, but as soon as these pending trades on account A are opened, it will. As long as BasketMirrorEA believes that the equity/balance curve on account A is still increasing. As soon as BasketMirrorEA believes that account A is losing, he will close all trades on account B.

The way BasketMirrorEA works out, whether it is a good time to start mirroring the first account, is by taking the last LRLookBack points of the equity/balance data, draw a straight line through these points (using Linear Regression) and if that straight line is sloping UP (i.e. the slope exceeds the value for LRSlope) it decides to starts mirroring. If a little later the slope drops below -LRSlope, the EA will stop mirroring and close all trades.

I have been demoing this EA in combination with Holy Graily Bob with mixed results. Last week eg. BasketMirrorEA outperformed its source account (running HGB), but this week so far, it has been less successful. The problem with frequent start and stops of the mirroring is that each time you must cover the commission and spread. But I thought that by sharing this tool, we could combine forces and perhaps improve the way BasketMirrorEA starts and stops the mirroring process.

As always, have fun!
You do not have the required permissions to view the files attached to this post.
ALoveSvpreme
Trader
Posts: 94
Joined: Fri Dec 05, 2014 8:46 am
Location: Vancouver, BC, Canada

BasketMirrorEA

Post by ALoveSvpreme »

Awesome renexxxx, HGB stability here we come. :mrgreen:
Pipologist
Trader
Posts: 34
Joined: Tue Dec 16, 2014 12:57 am
Location: Crawley, UK.

BasketMirrorEA

Post by Pipologist »

Excellent idea renexxxx. Thank you :good:
When a person really desires something, all the universe conspires to help that person to realize his dream.”
― Paulo Coelho, The Alchemist
Pipologist
Trader
Posts: 34
Joined: Tue Dec 16, 2014 12:57 am
Location: Crawley, UK.

BasketMirrorEA

Post by Pipologist »

Hi again,

As an idea, wouldn't it better if the EA only closed the basket of the loosing trades, but used a 2nd LRSlope starting from that point on to monitor the basket of the winning trades? If then the angle of the 2nd LRSlope start decreasing, it would close the profitable basket of trades too.

Cheers.
Last edited by Pipologist on Sat Apr 18, 2015 8:01 pm, edited 1 time in total.
When a person really desires something, all the universe conspires to help that person to realize his dream.”
― Paulo Coelho, The Alchemist
User avatar
SteveHopwood
Owner
Posts: 9904
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

BasketMirrorEA

Post by SteveHopwood »

I am adding this to my wrup tomorrow night, to drum up some interest. Tommaso pointed it out to me earlier.

:xm:
Read the effing manual, ok?

Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.

I still suffer from OCCD. Good thing, really.

Anyone here feeling generous? My paypal account is always in the market for a tiny donation. pianodoodler@hotmail.com is the account.

To see The Weekly Roundup of stuff you guys might have missed Click here

My special thanks to Thomas (tomele) for all the incredible work he does here.
taipan
Trader
Posts: 355
Joined: Sat Feb 16, 2013 11:27 am

BasketMirrorEA

Post by taipan »

I have encountered some error in the expert tab:

BasketMirrorEA EURUSD,M5: Failed to open EquityBalance_2012019.bin file, Error code = 5004

I understand that error 5004 is about fileopen error. After checking through the common file area, there is no .csv file created. I can only see "EquityBalance_2015495/2015499.bin" file being created on 2 Empty4 platforms. I have loaded include, libraries, experts in respective folder. I have also updated the latest EquityBalancePlot.ex4 that can create those 2 files.

Did I doing something wrong. Need help to do this demo.



taipan
Last edited by taipan on Wed Apr 22, 2015 10:44 am, edited 1 time in total.
User avatar
renexxxx
Trader
Posts: 860
Joined: Sat Dec 31, 2011 3:48 am

BasketMirrorEA

Post by renexxxx »

taipan » Wed Apr 22, 2015 8:01 pm wrote:I have encountered some error in the expert tab:

BasketMirrorEA EURUSD,M5: Failed to open EquityBalance_2012019.bin file, Error code = 5004

I understand that error 5004 is about fileopen error. After checking through the common file area, there is no .csv file created. I can only see "EquityBalance_2015495.bin" file being created on 2 Empty4 platforms. I have loaded include, libraries, experts in respective folder. Did I doing something wrong. Need help to do this demo.

taipan
Hi taipan,
Are you running the latest version of EquityBalancePlot? Just before putting up BasketMirrorEA I made a few small changes to this indi, to ensure that the necessary files are created in the common file area.

Also, make sure that you alter the parameters LogFileName and BasketFileName to the correct files. Eg. if you are running EquityBalancPlot on account 1234567, the files will be EquityBalance_1234567.bin and EquityBalance_1234567_all.csv.

I realise that this is a little bit difficult to setup as it involves two Empty4 accounts, one running EquityBalancePlot and the other one BasketMirrorEA. Hopefully, you will be able to overcome the initial hurdle.

Cheers.
taipan
Trader
Posts: 355
Joined: Sat Feb 16, 2013 11:27 am

BasketMirrorEA

Post by taipan »

renexxxx » Wed Apr 22, 2015 6:23 pm wrote: Hi taipan,
Are you running the latest version of EquityBalancePlot? Just before putting up BasketMirrorEA I made a few small changes to this indi, to ensure that the necessary files are created in the common file area.

Also, make sure that you alter the parameters LogFileName and BasketFileName to the correct files. Eg. if you are running EquityBalancPlot on account 1234567, the files will be EquityBalance_1234567.bin and EquityBalance_1234567_all.csv.

I realise that this is a little bit difficult to setup as it involves two Empty4 accounts, one running EquityBalancePlot and the other one BasketMirrorEA. Hopefully, you will be able to overcome the initial hurdle.

Cheers.
Hi Renexxxx,

Yes, i have updated the EquityBalancePlot and restarted Empty4 but still no .csv file is created. Also, i have checked that the file name is correct in BasketMirror EA as suggested. On platform A, only .bin file has been created. Also, on platform B, there is also no .bin & csv file created as well. I don't know what is the problem. Will try to install new Empty4 and tried again. Thanks for the help.
User avatar
renexxxx
Trader
Posts: 860
Joined: Sat Dec 31, 2011 3:48 am

BasketMirrorEA

Post by renexxxx »

taipan » Wed Apr 22, 2015 9:10 pm wrote:
renexxxx » Wed Apr 22, 2015 6:23 pm wrote: Hi taipan,
Are you running the latest version of EquityBalancePlot? Just before putting up BasketMirrorEA I made a few small changes to this indi, to ensure that the necessary files are created in the common file area.

Also, make sure that you alter the parameters LogFileName and BasketFileName to the correct files. Eg. if you are running EquityBalancPlot on account 1234567, the files will be EquityBalance_1234567.bin and EquityBalance_1234567_all.csv.

I realise that this is a little bit difficult to setup as it involves two Empty4 accounts, one running EquityBalancePlot and the other one BasketMirrorEA. Hopefully, you will be able to overcome the initial hurdle.

Cheers.
Hi Renexxxx,

Yes, i have updated the EquityBalancePlot and restarted Empty4 but still no .csv file is created. Also, i have checked that the file name is correct in BasketMirror EA as suggested. On platform A, only .bin file has been created. Also, on platform B, there is also no .bin & csv file created as well. I don't know what is the problem. Will try to install new Empty4 and tried again. Thanks for the help.
You should be looking for the files in something like:
"C:\Users\taipan_or_whatever\Application Data\MetaQuotes\Terminal\Common\Files".
Platform B does not create any files, just reads them.

Let me know how you go.
taipan
Trader
Posts: 355
Joined: Sat Feb 16, 2013 11:27 am

BasketMirrorEA

Post by taipan »

renexxxx » Wed Apr 22, 2015 7:15 pm wrote: You should be looking for the files in something like:
"C:\Users\taipan_or_whatever\Application Data\MetaQuotes\Terminal\Common\Files".
Platform B does not create any files, just reads them.

Let me know how you go.
Yes, sorry did not mentioned in my post that platform A file is located at:

C:\Users\user\AppData\Roaming\MetaQuotes\Terminal\8B3A7CCF9A39E3xxxxxxxxxx\MQL4\Files

Still could not create .csv file on platform A even with new Empty4 installation (GlobalPrime Demo).
You do not have the required permissions to view the files attached to this post.
Post Reply

Return to “Auto-trading EA's and EA monitors”