To use chat, please login.
Back to contacts

Compuforex Trade Manager

kennyhubbard (compuforexpamm)
Jul 01 2012 at 17:07
266 posts
Hi guys,

Just wanted to let you know that I will be releasing a free trade manager EA for everybody to use.

Some of the folks here will be familiar with my trailing stop EA that I created. If you are not familiar with it, you can read about it over at the donnaforex forum(https://www.donnaforex.com/forum/index.php?topic=3193.0)

This Trade Manager EA is the next step in the evolution of the trailing stop EA and has some exciting upgrades. It will be available for download from my blog soon. I am not a blogger of any sort, so don't expect too much from the site. I have simply chosen to have one central point for much of the work that I do on EA's.

I am just doing some final tweaking and I hope to release it tomorrow, bugs and all😀

Please feel free to use this thread to discuss or raise any issues related to this EA. I will also consider feature request but please understand that I cannot amend the EA for every single person out there.

I also don't wish to be rude but I don't often respond to PM's with requests. If you want a feature, drop by the blog and make a comment. I don't write EA's on request as it is not worth my time and effort, but I do make an attempt to improve the work that I have made freely available.

Oh yeah the blog is at www.compu-forex.com
Wealth Creation Through Technology
Ben Scoobert
forex_trader_[921]
Jul 09 2012 at 21:32
276 posts
Welcome back Mr H
Does the EA now have an auto TP setting?
kennyhubbard (compuforexpamm)
Jul 10 2012 at 03:11
266 posts
Hi Ben,

Long time......😄

To answer your question, yes and no😈

It has an internal TP setting that it uses as a reference for reducing the trailing stoploss. As the price action approaches your TP setting, the trail reduces by the same amount that price action is away from your TP. The trailing SL will pretty much be at its minimum eg 5 pips when the price hits the internal TP, but it won't actually set the TP.

I am also working on a version that has some simple trade logic so that people can study settings in the tester/optimiser for different currency pairs and timeframes. Nothing fancy, just 2 moving averages or something similar. Unfortunately it's never as simple as just adding the logic because the tester doesn't work the same as the terminal when looking across currencies🙄



Wealth Creation Through Technology
Ben Scoobert
forex_trader_[921]
Jul 10 2012 at 21:23
276 posts
Well I think rather than having to set that TP manually it should have an auto set option 😉

The backtester is a nightmare, I have given up on it altogether, I've run things through it with converted tick data and tested for days on end, then forward tested demo, all great results. Then to find going live just spanks you like everything else never tried.
The market is in turmoil and has been since 2008, tough times but I feel I have found a path which I may be able to use.
kennyhubbard (compuforexpamm)
Jul 11 2012 at 03:30
266 posts
Ok Ben, for you I will make a plan. How would you like the auto TP to work?

BTW, I have found a bug related to pending orders, so please refer to my blog for the latest.

I agree on the turmoil in the markets. It was one of the main reasons that I have been sitting on the sidelines for the last year.
Wealth Creation Through Technology
Ben Scoobert
forex_trader_[921]
Jul 11 2012 at 07:33
276 posts
You're a good egg.

1. Auto TP boolean
2. set tp at pips from open price boolean
3. set TP at pips from current price boolean
4. pips for TP int
5. close order if TP already hit boolean

2 and 3 could be an option number I guess, because they are an either or, likewise 5 only comes into play if 2 is used

May as well add the same logic for initial SL being set as the code is virtually identical.

You didn't think it was going to be simple did you? 😉
kennyhubbard (compuforexpamm)
Jul 11 2012 at 08:37
266 posts
Of course, nothing is ever simple with you Ben😲

Ok, give me a few days.

I think I understand point 1 & 4. Just run by me the difference between point 2 & 3, as the EA will set the TP the moment it detects an order, so in theory the open price & the current price should be the same?

I am also a bit uncertain about point number 5, can you expand on it?

BTW, there is already some Auto SL setting logic in the EA.
Wealth Creation Through Technology
James_Bond
Jul 11 2012 at 09:51
556 posts
Thank you Kenny!

It's really great to see there are very useful free developments around. 😄
Ben Scoobert
forex_trader_[921]
Jul 11 2012 at 11:17
276 posts

   compuforexpamm posted:
   Of course, nothing is ever simple with you Ben😲

Ok, give me a few days.

I think I understand point 1 & 4. Just run by me the difference between point 2 & 3, as the EA will set the TP the moment it detects an order, so in theory the open price & the current price should be the same?

I am also a bit uncertain about point number 5, can you expand on it?

BTW, there is already some Auto SL setting logic in the EA.

The difference between 2 and 3 is the spread and/or lag.
eg. I open manually @ 1.20000, a few pips later the trail EA picks it up and price is 1.19965, so option 2 would set tp @ 1.2000 plus target pips, option 3 would set it at 1.1965 plus target pips.
It also allows for any connection outages where the difference could be more than just a few pips.

option 5 means, if the TP has already been exceeded the order should be closed immediately
eg. order opened at 1.20000 with the EA set to TP at 20 pips, for whatever reason, fast market, disconnect, has caused price to be beyond 1.20200, order should close right away
obviously I you have selected option 3 then price would be set at 20 pips from the current price so option 5 is not needed when option 3 is active, only when option 2 is active.

Sorry to over complicate things, but disconnects happen and slippage too. Only last week Alpari allowed 27 pips of slippage on an order which had a SL set 4 hours prior. I'm all about ass covering.
kennyhubbard (compuforexpamm)
Jul 14 2012 at 08:39
266 posts
Hi Ben,

Few busy days at work, so just looking at this now. I have started coding this but need to point out that point 2 is not really compatible with the trade manager.

There is no way for CFTM to know what your desired OpenPrice was, or what the slippage was on your order. Same goes for point 5.

If you have a suggestion as to how to implement it, I'm all ears tho😀
Wealth Creation Through Technology
Ben Scoobert
forex_trader_[921]
Jul 14 2012 at 09:30
276 posts
I'd guess open price of the order can be read straight from the order itself. Isn't it the OpenPrice command?
kennyhubbard (compuforexpamm)
Jul 14 2012 at 10:01
266 posts
Ah, Ok....I think I'm getting the picture now. I was equating the openprice to the current price and the order price to the price that you wanted to make the order at. My bad.
Wealth Creation Through Technology
kennyhubbard (compuforexpamm)
Jul 14 2012 at 11:11
266 posts
Ok, I think it is done. Not much to be done until the markets open and I can do some testing. Once I see that it works, I'll post it on the blog.
Wealth Creation Through Technology
Ben Scoobert
forex_trader_[921]
Jul 14 2012 at 18:59
276 posts
If I could vouch for you twice I would
kennyhubbard (compuforexpamm)
Jul 16 2012 at 09:56
266 posts
Thanks Ben, its the thought that counts.....lol.

Anyway, it's up on the blog. Come and get it. Requires testing though.
Wealth Creation Through Technology
Ben Scoobert
forex_trader_[921]
Jul 17 2012 at 19:18
276 posts
Now set up and live, so far so good, I'll keep you posted.
Thanks for your time spent. :-)
Ben Scoobert
forex_trader_[921]
Jul 18 2012 at 20:00
276 posts
OK, can you explain this?
Sliding TAKEPROFIT function(STP)

    UD period to wait before taking over trade management;
    STP takes into account time, as well as price action;
    TP slides towards price action at UD rate
    Stoploss is also amended to close in on price action in a pincer type movement(user has choice to turn this off);

Note7=--------SLIDING TP SETTINGS------
Use_Sliding_TP = true
STP_Wait_Mins = 30
STP_Init_Perc = 50
STP_Decay_Rate = 0.5
STP_Mode_Only = false

Init _Perc and Decay_Rate have thrown me, Percentage of what? What the SL was originally?
Decay_Rate is a percentage reduction?
I turned it on for trialling and ended up with 2 pips TP after the Wait_Mins was up :-D
kennyhubbard (compuforexpamm)
Jul 19 2012 at 03:34
266 posts
When the EA takes over management of a 'bad' trade, it has to start the TP somewhere. This is the Init_Perc(initial percentage). So if you have trade that is 20 pips in the red, it will move the TP to halfway between the open price and the current price ie your TP is set 10 pips above the current price.

The problem here is that over time the price action may continue to move against you, so it is no good for the EA to just follow the price action at a 50% trail. The idea is that the TP will move towards the price action at the decay rate. The rate is % change per minute, so the default of 0.5 will close the trade after 100 minutes(in the worst case).

Normally the SL is set by you in the INITIAL STOPLOSS setting. When the STP routine kicks in, you have the option to leave the SL where it is, or move it closer to the price action(SL_Decay). In the latter case, the SL will be positioned the same distance away from the price action as the TP, so as the TP closes in on the price, so does the SL. It will then close in as close as it can considering the stop_levels(still a bug here, so you may see some invalid stop errors but it is not critical).

On the screen display, when the Wait_Mins are up, you should see the trade move to the Sliding TP column and it should display the estimated max loss which intially woud be 1.5 x where the trade currently is.

The STP function can take over management of a positive trade as well(it does this anyway for trades that have not activated the trailing SL). In the case(STP_Only_Mode), it will set the TP to 50% above the current price and decay it from there towards the price action.
Wealth Creation Through Technology
Ben Scoobert
forex_trader_[921]
Jul 24 2012 at 13:57
276 posts
I found a bug, not sure how it occurred but I have the same trade twice on the managed trades list. Also one missing from the list. If I reset the EA it goes away.
I can do a screenshot if you like
kennyhubbard (compuforexpamm)
Jul 24 2012 at 14:35
266 posts
Hi Ben,

Ok, thanks. Screenshot would help and also if you do happen to notice when it happens, it would be good.
Wealth Creation Through Technology
Please login to comment .