Intergrated MM with System Accuracy and Risk Control

 
Files:
mm_system.zip  75 kb
 

Great concept

G'day Beno, thanks for sharing I think this idea has great potential, if some coders would like to look at the post I made for money mangement some of that code could be recycled for Beno's idea.

 
leeb:
G'day Beno, thanks for sharing I think this idea has great potential, if some coders would like to look at the post I made for money mangement some of that code could be recycled for Beno's idea.

I agree leeb.

Just to remember other thread: https://www.mql5.com/en/forum/178976

 

So who's tried it and what do you think.

what's the next step etc.

Cheers

Beno

 

Average Win/ Loss

I have to start some where.

Does any one have a code for obtaining your systems Average win/loss

or a code for the system Accuracy = (Total wins/Total orders)

Any help would be fantastic.

Cheers

Beno

 

I've had a hard time figuring this out as well. Creating a dynamic money management system is quite hard for me. I'm sure there are excellent programmers that can probably whip this up. But I haven't figured it out yet.

Using % based MM is easy.

Keeping track of wins and losses is harder than it looks, especially when you have many trades open at the same time. I tried to use trade history to do it, but sometimes the broker condense the history and that gets messed up.

I think you will need more than MT4 to do this accurately. If there are some geniuses willing to shed some light on this subject, I'm all ears.

 

I'm back on this path again

Attached is a new excel sheet well it a modified version that I have attempted to write out what might be required to code this up.

I am of the opinion this will and can help people with system develpment by assisting them in finding out the accuracy of their prefered method.

It works quite simply the more accurate your trades are the greater the accuracy % and the higher the expectation the greater the TP the more stable you cashflow becomes. and vice versa

Let me know what you think also if it's worth coding

Cheers

Beno

Files:
 

Do I need to create some thing like this first. for each of the win, loss, number trades etc.

//+------------------------------------------------------------------+

//| Wins (int)

//+------------------------------------------------------------------+

int Wins(int OrdType)

{

int Wins = 0;

for(int i=0; i<OrdersHistoryTotal(); i++)

{

if( !OrderSelect(i, SELECT_BY_POS, MODE_HISTORY) ) continue; // select check

if( OrderType() != OrdType ) continue; // order type check

if( IsSkip( OrderSymbol(), OrderMagicNumber(), OrderComment(), OrderOpenTime(), OrderCloseTime()) ) continue;

if(OrderProfit()+OrderSwap()+OrderCommission() >= 0) Wins++;

}

return(Wins);

}

It's from an "instant trade analyzer".

Cheers

Beno

 

Kelly Lots

I have been looking and learning and have found a way to start developing this mm system, granted I am not a coder by any stretch on the imagination.

I have attached a very simple EA just using a Daily Pivot nothing elaborate in an attempt to try and get the Kelly Lot Size going.

I would appreciate a few new sets of eyes looking over the code as I have a zero divide in the mm system I have added Print() to try and isolate it but can’t seem to find where I have gone wrong.

when the EA starts you will have a 0.00 lot size and that will go increase and decrease depending on how many wins or losses you have and the amount you win or lose.

So I have tried to say if KellyLot < MinLot the use the minimum lots allowed by the broker.

//--- check min, max Lot size

if(Kellylot<lot_min) Kellylot = lot_min;

if(Kellylot>lot_max) Kellylot=lot_max;

//---

Any help would be great

Cheers

Beno

Files:
 

Here is the ea that open one position but there are some errors any help to fix them would be good.

Files:
 

Hello

I have managed to get a Kelly MM System working on to my Pivot EA which is great, I have also placed into it the system accuracy and a few other little gems.

The next thing is the Max DD and Limiting the number of potential open position based something similar to below

double Risk = 2;

double MaxDD = 10;

double RiskCapital = AccountBalance()*MaxDD/100;

double RPT = AccountBalance()*Risk/100;

double Positions = MathAbs(RiskCapital/RPT);

Balance $100.00

MaxDD 10% = $10.00

Risk 2% = $2.00

Max Number Of Positions = 5// $10 / $2

So if I am trading 10 pairs and only 5 positions can be opened at a time if one position is closed another can open on a different pair.

if someone can point me in the right direction that would be great.

Cheers Beno

The image below is of a backtest so a grain of salt is required

Files:
pivot_system.jpg  320 kb
Reason: