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
Page 1 of 2 1 2
Improving MAE #457527
01/21/16 15:03
01/21/16 15:03
Joined: Feb 2015
Posts: 652
Milano, Italy
M
MatPed Offline OP
User
MatPed  Offline OP
User
M

Joined: Feb 2015
Posts: 652
Milano, Italy
Hi, I have a profitable Algos that has a relevant difference between max dd and MAE
Max drawdown -2373$ 9% (MAE -12567$ 48%)

My understanding is that the trade management is not good. I'd like to investigate and improve it, but I do not know how to move forward.

Any Idea? Thank you

Re: Improving MAE [Re: MatPed] #457547
01/21/16 22:54
01/21/16 22:54
Joined: Jan 2016
Posts: 122
V
Veratyr Offline
Member
Veratyr  Offline
Member
V

Joined: Jan 2016
Posts: 122
I'm similarly new to algo trading of forex so I can't say I can help that much but I think this depends a lot on what's causing that loss.

If it's individual trades having huge losses, I'd say tighten your stop loss. If you're using a trend following algo, http://www.financial-hacker.com/the-market-meanness-index/ might be useful.

Re: Improving MAE [Re: Veratyr] #457571
01/22/16 14:51
01/22/16 14:51
Joined: Jul 2000
Posts: 27,978
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,978
Frankfurt
Find out first if the problem comes from only a few extreme trades, or from many trades. Problems in trade management can be examined by plotting price profiles of the trades.

Re: Improving MAE [Re: jcl] #457574
01/22/16 16:11
01/22/16 16:11
Joined: Feb 2015
Posts: 652
Milano, Italy
M
MatPed Offline OP
User
MatPed  Offline OP
User
M

Joined: Feb 2015
Posts: 652
Milano, Italy
@jcl, thank you, what do you mean by plotting the price profile I will copy the algo, its an evolution of your code, so its not a secret... laugh I would like your help in order to improve my analysis capabilities.

@Veratyr, thank you for your post. The Algo was taken from the blog you have referred wuth minor changes.


function TFM()
{
/* Annual return 245%
Profit factor 4.23 (PRR 3.61)
Sharpe ratio 0.88
Kelly criterion 0.31
R2 coefficient 0.808
Ulcer index 10.0%
Prediction error 36%
*/
algo("TFM");
var mmiPeriod = optimize(100, 25, 600, 25 );
var lpPeriod = optimize( 90, 30, 150, 6 );
Stop = optimize(4, 2, 8, 0.5) * ATR(100);

var stopPip = Stop / PIP;
var minPip = 10;
Trail = stopPip * minPip;
TrailSlope = (minPip * 100) / stopPip;
TrailLock = optimize (0, 0, 75, 5);

vars Price = series(price());
vars Trend = series(LowPass(Price, lpPeriod));
vars MMI_Raw = series(MMI(Price, mmiPeriod));
vars MMI_Smooth = series(LowPass(MMI_Raw, mmiPeriod));

if(Train && ParCycle <= 2) {
Stop = 4 * ATR(100);
TakeProfit = 8 * ATR(100);
Trail = 0;
TrailSlope = 100;
TrailLock = 0;
}

if(falling(MMI_Smooth)) {
if(valley(Trend)) {
enterLong();
}
else if(peak(Trend)) {
enterShort();
}
}
}

Re: Improving MAE [Re: MatPed] #457687
01/26/16 16:40
01/26/16 16:40
Joined: Feb 2015
Posts: 652
Milano, Italy
M
MatPed Offline OP
User
MatPed  Offline OP
User
M

Joined: Feb 2015
Posts: 652
Milano, Italy
Ok,
the above script has the following result:

Max draw-down -1670$ 4% (MAE -13289$ 35%)

The the MAE distribution is attached it seems that few trades generate the issue. What do you recommend?

Attached Files MAE.png
Re: Improving MAE [Re: MatPed] #457785
01/30/16 21:31
01/30/16 21:31
Joined: Feb 2014
Posts: 73
Montreal, Qc Canada
F
Finstratech Offline
Junior Member
Finstratech  Offline
Junior Member
F

Joined: Feb 2014
Posts: 73
Montreal, Qc Canada
Cut off stop loss at a maximum of -500, or even -400 perhaps.

Re: Improving MAE [Re: Finstratech] #457787
01/30/16 23:25
01/30/16 23:25
Joined: Dec 2013
Posts: 568
Fuerth, DE
Sphin Offline
User
Sphin  Offline
User

Joined: Dec 2013
Posts: 568
Fuerth, DE
To avoid the trades with the highest losses stop any trade if TradeMAE > 210. Above there is only little chance to get a profitable trade with relatively little profit but a high chance to get a sometimes significant loss.

Re: Improving MAE [Re: Sphin] #457791
01/31/16 12:29
01/31/16 12:29
Joined: Feb 2015
Posts: 652
Milano, Italy
M
MatPed Offline OP
User
MatPed  Offline OP
User
M

Joined: Feb 2015
Posts: 652
Milano, Italy
Thank you, I'll give it a try and keep you posted. Ciao

Re: Improving MAE [Re: MatPed] #457793
01/31/16 13:28
01/31/16 13:28
Joined: Feb 2015
Posts: 652
Milano, Italy
M
MatPed Offline OP
User
MatPed  Offline OP
User
M

Joined: Feb 2015
Posts: 652
Milano, Italy
Defined the following TMF, but it does not work ie it does not block the trade at the required level. I have used just onw asseet for testing. Still trying...

int maxMAE(var maxPIP){
if (abs(TradeMAE) > maxPIP*PIP) return (1);
else return(0);
}

...
enterLong(maxMAE, 250);
enterShort(maxMAE, 250);
...



Attached Files Untitled.png
Last edited by MatPed; 01/31/16 13:30.
Re: Improving MAE [Re: MatPed] #459239
04/30/16 14:12
04/30/16 14:12
Joined: Dec 2013
Posts: 568
Fuerth, DE
Sphin Offline
User
Sphin  Offline
User

Joined: Dec 2013
Posts: 568
Fuerth, DE
Did you make any progress here? I have the same problem using the routine
Code:
if (TradeMAE/PIP > 90)
		return 1;
	else
		return 0;


in a TMF expecting a plotMAEGraph with many trades ending around 90 but many trades go far beyond this border.

Page 1 of 2 1 2

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