Follow The Bouncing Pip - page 111

 

Ea

I know many of you are waiting for this so I am posting it now.

The next phase of development will be finding a good exit method. The current method exits on the opposite signal from the two zigzag indicators.

For MM the input for Risk should be small for Burns method and can be larger for Nix version.

I hope the other inputs are obvious. The various strings are menus to chose what you want to test.

The best results tested on GBPJPY were using the default settings.

Using 3% Risk and Burns MM method did return $8695 on $10K account with drawdown of 15%. Largest profit was 2262, largest loss 438.

Average profit was 1328, average loss was 250.

Using 4% risk and nix MM method returned $8798 with drawdown of 7.8%. Largest profit was 2602, largest loss was 512.

Average profit was 1225, average loss was 171.

Let the testing begin.

Robert

 

Modificaions to EA

I am open to suggestions for removing code from the EA. If things like HA, HAS, CCI or Stochastics filters should be removed let me know. We should also work toward a single MM function.

Some of the filter indicators will be tested for exit as well. I am ecen thinking of using confirmation of arrow similar to entry rule.

That might allow some trades to reach greater profit, especially those trades that have many exit arrows after the first exit signal.

Suggestions for other exit methods are also welcome.

I will be coding a few myself.

Robert

 
MrPip:
I am open to suggestions for removing code from the EA. If things like HA, HAS, CCI or Stochastics filters should be removed let me know. We should also work toward a single MM function.

Some of the filter indicators will be tested for exit as well. I am ecen thinking of using confirmation of arrow similar to entry rule.

That might allow some trades to reach greater profit, especially those trades that have many exit arrows after the first exit signal.

Suggestions for other exit methods are also welcome.

I will be coding a few myself.

Robert

Hello MrPip

I have this mm in some of my ea's. I don't know if it would help you or not but I will post it just in case:

This bit goes at the top so that the user can choose which type they want

//////

/* Here is the MM settings...look at notes...if set to 0 then ea will trade with a fixed lot size..the size specified

in the above "extern double Lots = 1.0;" line. Might want to change this to 0.1.

If 1 then it will trade a fixed percentage of the account balance

If 2 then it will use a fractional portion (not to sure on this one..must look at code again)

If 3 then a fractional fixed size meaning 1 lot for every 500 in account or so...the 500 is set below

in the LotsDepoForOne - i.e. How many lots for each deposit amount of =

You must play around with it..cannot remember exact settings but I likes the setting to trade 1 lot for each $xx in account.

Easy to maintain a say 500:1 ratio with it.

*/

extern int LotsWayChoice = 3; // Lot size selection:

// 0-fixed lot size,

// 1-% from deposit,

// 2-fractional proportional,

// 3-fractional fixed lot size,

extern int LotsPercent=0; // % from deposit

extern int LotsDeltaDepo=500; // factor of deposit increase

extern int LotsDepoForOne=500; // deposit size for 1 mini lot

extern int LotsMax=100; // Max number of mini lots

double ldLot;

[/CODE]

then some of the ea code till you get to the buy and sell part and enter in the following

ldLot = GetSizeLot(); ticket = OrderSend(Symbol(),OP_SELL,ldLot,Bid,slippage,realSL,realTP,nameEA+" - Magic: "+magicEA+" ",magicEA,0,Red); // Sell

and then the final part at the bottom of ea code

[CODE]///////////////////////////////////////////////////////////////////////////////////////

// This part is the function where the lot size is calculated

double GetSizeLot() {

double dLot;

if (LotsWayChoice==0) dLot=Lots;

// fixed % from deposit

if (LotsWayChoice==1) {

dLot=MathCeil(AccountFreeMargin()/10000*LotsPercent)/10;

}

// fractional proportional

if (LotsWayChoice==2) {

int k=LotsDepoForOne;

for (double i=2; i<=LotsMax; i++) {

k=k+i*LotsDeltaDepo;

if (k>AccountFreeMargin()) {

dLot=(i-1)/10; break;

}

}

}

// fractional fixed

if (LotsWayChoice==3) {

dLot=MathCeil((AccountFreeMargin()-LotsDepoForOne)/LotsDeltaDepo)/10;

}

if (dLot<0.1) dLot=0.1;

if (dLot>LotsMax) dLot=LotsMax;

return(dLot);

}

I hope this is of some use to anyone.

 
MrPip:
I know many of you are waiting for this so I am posting it now.

The next phase of development will be finding a good exit method. The current method exits on the opposite signal from the two zigzag indicators.

For MM the input for Risk should be small for Burns method and can be larger for Nix version.

I hope the other inputs are obvious. The various strings are menus to chose what you want to test.

The best results tested on GBPJPY were using the default settings.

Using 3% Risk and Burns MM method did return $8695 on $10K account with drawdown of 15%. Largest profit was 2262, largest loss 438.

Average profit was 1328, average loss was 250.

Using 4% risk and nix MM method returned $8798 with drawdown of 7.8%. Largest profit was 2602, largest loss was 512.

Average profit was 1225, average loss was 171.

Let the testing begin.

Robert

Thanks for posting this, hopefully I can give it a try this afternoon.

 

Thanks Mr. Pip...

Hey! I bet Don is happy...it is more convienient for him to download from here and resell it...This could be like the central meeting place!

ES

 

Nice little short on the Euro this morning.

Files:
eurusd_5.gif  9 kb
 
MrPip:
burn0050,

There is a problem with your LotSize function that I have seen before.

It will not work with IBFX or those brokers no longer using lots. IBFX uses 1 for a minilots in a mini account while FXDD uses .1 for a minilot in a mini account. FXDD does not allow partial lots in a standard account while I believe IBFX does.

Some brokers are now using actual dollar amounts like $10000 instead of lots..

This causes problems writing MM functions in EAs.

For now I will simply post the code as is. I will work on figuring how to use your method with IBFX and update the EA for repost.

All results posted were using Nix version of AutoLots.

Robert

This modification of my previous AutoLot function should do the trick and takes the StopLoss value into consideration:

double AutoLots(int Risk, int StopLossInPips, double MIN_lots = 0.1, double MAX_lots = 5)

{

int Decimals = 0;

double LotStep = MarketInfo(Symbol(), MODE_LOTSTEP);

double LotSize = MarketInfo(Symbol(), MODE_LOTSIZE);

double LotTickValue = MarketInfo(Symbol(), MODE_TICKVALUE);

if(LotStep == 0.01)

Decimals = 2;

if(LotStep == 0.1)

Decimals = 1;

double LotsToRisk = ((AccountFreeMargin()*Risk)/100)/StopLossInPips;

double Lots = StrToDouble(DoubleToStr(LotsToRisk/LotTickValue,Decimals));

if (Lots < MIN_lots)

Lots = MIN_lots;

if (Lots > MAX_lots)

Lots = MAX_lots;

return(Lots);

}

 
MrPip:
I know many of you are waiting for this so I am posting it now.

The next phase of development will be finding a good exit method. The current method exits on the opposite signal from the two zigzag indicators.

For MM the input for Risk should be small for Burns method and can be larger for Nix version.

I hope the other inputs are obvious. The various strings are menus to chose what you want to test.

The best results tested on GBPJPY were using the default settings.

Using 3% Risk and Burns MM method did return $8695 on $10K account with drawdown of 15%. Largest profit was 2262, largest loss 438.

Average profit was 1328, average loss was 250.

Using 4% risk and nix MM method returned $8798 with drawdown of 7.8%. Largest profit was 2602, largest loss was 512.

Average profit was 1225, average loss was 171.

Let the testing begin.

Robert

Tx, very nice work, and good compere about MM and others. Seems, realy good people are on this thread. Tx, is very positive.

Marko

 
MrPip:
I know many of you are waiting for this so I am posting it now.

The next phase of development will be finding a good exit method. The current method exits on the opposite signal from the two zigzag indicators.

For MM the input for Risk should be small for Burns method and can be larger for Nix version.

I hope the other inputs are obvious. The various strings are menus to chose what you want to test.

The best results tested on GBPJPY were using the default settings.

Using 3% Risk and Burns MM method did return $8695 on $10K account with drawdown of 15%. Largest profit was 2262, largest loss 438.

Average profit was 1328, average loss was 250.

Using 4% risk and nix MM method returned $8798 with drawdown of 7.8%. Largest profit was 2602, largest loss was 512.

Average profit was 1225, average loss was 171.

Let the testing begin.

Robert

You are truly a gentleman!

 

Thanks Nix,

This saves me some time.

Robert

nix:
This modification of my previous AutoLot function should do the trick and takes the StopLoss value into consideration:

double AutoLots(int Risk, int StopLossInPips, double MIN_lots = 0.1, double MAX_lots = 5)

{

int Decimals = 0;

double LotStep = MarketInfo(Symbol(), MODE_LOTSTEP);

double LotSize = MarketInfo(Symbol(), MODE_LOTSIZE);

double LotTickValue = MarketInfo(Symbol(), MODE_TICKVALUE);

if(LotStep == 0.01)

Decimals = 2;

if(LotStep == 0.1)

Decimals = 1;

double LotsToRisk = ((AccountFreeMargin()*Risk)/100)/StopLossInPips;

double Lots = StrToDouble(DoubleToStr(LotsToRisk/LotTickValue,Decimals));

if (Lots < MIN_lots)

Lots = MIN_lots;

if (Lots > MAX_lots)

Lots = MAX_lots;

return(Lots);

}