What does
Pip Cop do?


Go Back   Home > Forums > General forums > Trading Programs

» Welcome to the Pip Cop - Forex Robot Reviews and forums.
PipCop reviews MetaTrader Forex robots (EA's) in real-time and posts detailed statements every 15 minutes.
We ONLY forward test on real accounts for the most accurate robot reviews!

Be smart! Read the Review FAQ or you WILL lose money!
If you enjoy the site, please let me know by registering or donating! Thanks! -- PipCop
P.S. This message is hidden if you register!
Trading Programs Trading software and tools to help you manage robots, run reports, etc.
Reply
 
LinkBack Thread Tools Display Modes
Old 2010-03-02, 01:49 PM   #1 (permalink)
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 AvoidSwap Expert Advisor

Ever since I stopped using Robominer, there have been many open trades that I need to manage. I looked at existing EA's to help manage the open positions but none of them would convert a negative rollover /swap to pips and adjust the take profit point taking the negative rollover /swap into consideration.

I wrote the attached EA which I call AvoidSwap for the following purposes:
1. To re-adjust the take profit.

2. To re-calculate and adjust the take profit price taking any negative swap into consideration.

3. To perform an emergency close of open trades.

AvoidSwap works by magic number. The trade or trades that you want to manage must have a magic number. The parameters magicstart and magicend should be used to identify the open trades that you want to change. If the magic number is the same for all trades that you want to mange, set magicstart and magicend to the same number.

AvoidSwap is designed for safety. There are three on/off switches. By default, all three switches are off.

runit controls whether AvoidSwap scans open trades
changenow controls whether AvoidSwap actually makes changes or just reports
emergencyclose controls whether all matching trades (by magic) are closed

changenow and emergencyclose only work if runit is on.
emergencyclose only works if runit and changenow are on.

AvoidSwap will run only once on the next chart tick . After it finishes running, it will set all three switches off to prevent the EA from running on every tick .

I suggest that you run AvoidSwap once with only runit on. This will produce a report in the experts log of what would have been changed. Once you are ok with the preliminary report, run the EA again with both runit and changenow on.

AvoidSwap is an open source EA which is licensed with the GNU GPL version 2. Under the terms of this license, you are entitled to:

1. the software free
2. the source code free

You also may redistribute the software providing the copyright is in tact and the source code is included.

You may also modify the EA source code to create a separate version. Under the terms of the GPL, all offspring of the original EA are also required to be licensed by the GPL.

Please read the entire text of the GPL license which is included along with the software.

Please report all bugs to me.

Enjoy,
Rick
Attached Files
File Type: zip AvoidSwap.zip (9.2 KB, 46 views)
__________________
MyFXBook Live Statement Mt4Analysis

Last edited by rsmereka; 2010-03-02 at 02:35 PM. Reason: Spelling
rsmereka is offline   Reply With Quote
   
 
Old 2010-03-02, 01:57 PM   #2 (permalink)
Pip Chief of Police
and Site Owner
 
PipCop's Avatar
 
Trader for 2 - 4 years
Location: Sterling, VA, USA
Posts: 1,196
My Trading Journal

Default

Wow, that's GREAT. I've been wanting something like that for RoboMiner.

Thanks Rick!
__________________
> Don't get busted by PipCop ... Read the Rules!
> Questions? Please read the REVIEW FAQ first!

> Have a Forex link? Add it to the Links Directory
> How to link your MT4 statement to your profile
PipCop is offline   Reply With Quote
Old 2010-03-02, 02:28 PM   #3 (permalink)
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

Quote:
Originally Posted by PipCop View Post
Wow, that's GREAT. I've been wanting something like that for RoboMiner.

Thanks Rick!
Pipcop,

You are very welcome.

Please use with caution. I have tested the EA but I have not tried every possible combination.

I forgot to mention in the notes that the AvoidSwap should work for 4 or five decimal brokers automatically although I have not tested it on a 4 digit broker . The EA also should automatically adapt for 4-5 decimal price or 2-3 decimal price (in the case of the pairs where one of the currencies is JPY) although I have not tested the EA on a pair that contains the JPY currency .

Rick
__________________
MyFXBook Live Statement Mt4Analysis
rsmereka is offline   Reply With Quote
Old 2011-03-10, 08:24 AM   #4 (permalink)
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

Quote:
Originally Posted by mapdel4xmarshal View Post
Thanks for sharing!!! Thumbs UP
You are very welcome.

Rick
__________________
MyFXBook Live Statement Mt4Analysis
rsmereka is offline   Reply With Quote
Old 2011-03-18, 05:00 AM   #5 (permalink)
New user
 
Trader for 2 - 4 years
Location: Germany
Posts: 5

Default

Any experience with this?
Tradinger is offline   Reply With Quote
Old 2011-03-18, 09:18 AM   #6 (permalink)
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

Quote:
Originally Posted by Tradinger View Post
Any experience with this?
Yes,

I constructed this EA specifically for the Robominer fiasco I had in March of 2010. My live/real money account was being choked to death by the floating DD. I had roughly 50 trades open and about $2,500 in free margin left. I did an emergency close of all the open trades. I would not say the procedure went perfectly. Closing that many trades automatically will cause issues. If I remember correctly, a couple of trades did not want to close and I had to run the emergency close a few times.

If in doubt, there is a test mode that prints in the log everything that would have been done but nothing is actually acted on.

Rick
__________________
MyFXBook Live Statement Mt4Analysis
rsmereka is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes




All times are GMT -5. The time now is 05:57 AM.

Powered by vBulletin ®
Site content and design Copyright © 2010 PipCop, LLC.
Site designed, hosted, and maintained by One Web Ave
Template by vBSkinworks.
Content Relevant URLs by vBSEO 3.3.2