stevehopwoodforex.com
https://www.stevehopwoodforex.com/phpBB3/
Print view

Asia Pacific Breakout Zone EA
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=3494
Page 5 of 17
Author:  putusernamehere [ Fri Apr 04, 2014 6:44 pm ]
Post subject:  Asia Pacific Breakout Zone EA

Hi, :hi:
these are the results this week from AsiaPacificBreakout C- OOTB- H1
very great results :clap:
Thank you Tomasso :hi:
Author:  putusernamehere [ Sun Apr 06, 2014 7:37 pm ]
Post subject:  Asia Pacific Breakout Zone EA

Hi; :hi:
is this a error by the part close 0,05?
Cheers Gunter
Author:  milanese [ Sun Apr 06, 2014 7:44 pm ]
Post subject:  [UPDATE]Asia Pacific Breakout Zone EA

putusernamehere » Sun Apr 06, 2014 7:37 pm wrote:Hi; :hi:
is this a error by the part close 0,05?
Cheers Gunter
Good spot Gunter :good:

Here you will find attached the latest one new we have for the SR Takeprofit a new setting MinWinForSR_TP=15 here you can define the min win for using this function, as it is set OOTB to 1 hit tested zones it can happen that the opens in a SR zone with one hit the trade the old one has taken the profit so immediatly ..
AsiaPacificBreakoutEA_D6xx.mq4
Cheers :)

Tommaso
Author:  putusernamehere [ Sun Apr 06, 2014 7:56 pm ]
Post subject:  [UPDATE]Asia Pacific Breakout Zone EA

milanese » Sun Apr 06, 2014 8:44 pm wrote:
putusernamehere » Sun Apr 06, 2014 7:37 pm wrote:Hi; :hi:
is this a error by the part close 0,05?
Cheers Gunter
Good spot Gunter :good:

Here you will find attached the latest one new we have for the SR Takeprofit a new setting MinWinForSR_TP=15 here you can define the min win for using this function, as it is set OOTB to 1 hit tested zones it can happen that the opens in a SR zone with one hit the trade the old one has taken the profit so immediatly ..


Cheers :)

Tommaso

wow Tommaso :good: you're the best and as quickly :yahoo:
Thank you so much . :!!:
Cheers Gunter
Author:  bazze [ Sun Apr 06, 2014 8:26 pm ]
Post subject:  Asia Pacific Breakout Zone EA

:good: :hi:
Author:  excalibre30 [ Tue Apr 08, 2014 1:39 am ]
Post subject:  Asia Pacific Breakout Zone EA

I tried to use the newest build of this EA but it shows the frowny face even if the Allow Live Trading is ticked. Any idea why this is happening?

Thanks!


Update.

Nevermind, I think it is my Empty4 instead of the EA.
Author:  TonkaTuff [ Tue Apr 08, 2014 2:38 am ]
Post subject:  Asia Pacific Breakout Zone EA

Check the Experts Tab.
Author:  milanese [ Tue Apr 08, 2014 8:19 am ]
Post subject:  Asia Pacific Breakout Zone EA

excalibre30 » Tue Apr 08, 2014 1:39 am wrote:I tried to use the newest build of this EA but it shows the frowny face even if the Allow Live Trading is ticked. Any idea why this is happening?

Thanks!


Update.

Nevermind, I think it is my Empty4 instead of the EA.
with the new 625 build you must too activate sperate each EA if you attach them, this is new.. thats why you don't see the smiling face..

Cheers :)

Tommaso
Author:  basch312 [ Tue Apr 08, 2014 7:15 pm ]
Post subject:  Asia Pacific Breakout Zone EA

Hi all,

I'm getting started with this EA, thanks to all contributors for sharing it.

I've got an error (zero divide) when I set UseFixLot = false due to "CalculateLots" function.
Here you have the function I use to calculate Lots, in case yuu may need it:

Code: Select all

double calcLots(int magicNumber, bool usarPorcentaje, double porcentaje, string par, double balanceDeTrabajo, double buffer_Max_Lots, double stopLoss)
{
	double balance;
	if (balanceDeTrabajo == 0) balance = AccountBalance();
	else balance = balanceDeTrabajo;
	
	double maxlots = 0.0, maxlimlots = 0.0, relacionForexOro = 0.0, margRequired = 0.0, maxLotsPorMargen = 0.0, maxLotsBroker = 0.0, minLotsBroker = 0.0;
	int digits  = MarketInfo(par,MODE_DIGITS);
	double Step = MarketInfo(par,MODE_LOTSTEP);
	double valorPip = MarketInfo(par, MODE_TICKVALUE)*10;
	maxLotsBroker = MarketInfo(par, MODE_MAXLOT);
	minLotsBroker = MarketInfo(par, MODE_MINLOT);

	//------------Lotes segun porcentaje -------------//
	if(usarPorcentaje)
	{
		if(stopLoss>0 && valorPip>0)
			maxlimlots = (balance*(porcentaje/100)/stopLoss)/valorPip;
		else maxlimlots = 0.0;
	}
	else
	{
		//------------Lotes a tope -------------// <---- max lots for "stopLoss"
		if(par == "XAUUSD" || par == "GOLD")
		{
			switch(digits)
			{
				case 2: relacionForexOro = 50.0; break;
				case 3: relacionForexOro = 1/5.6; break;
			}
		}
		else relacionForexOro = 1; // para cualquier par de forex 
		
		maxlots = (balance*AccountLeverage())/100000*relacionForexOro;
		
		margRequired     = MarketInfo(par, MODE_MARGINREQUIRED); // current price * 1000
		maxLotsPorMargen = NormalizeDouble(balance/margRequired, 1);
		  
		if(maxlots > maxLotsBroker) maxlots = maxLotsBroker;
		if(maxLotsPorMargen > maxLotsBroker) maxLotsPorMargen = maxLotsBroker; 
		
		double maxlimlots1 = maxlots*(1-buffer_Max_Lots);
		
		double perdidaMax1 = stopLoss*valorPip*maxlimlots1;
		double usedMargin1 = MarketInfo(par, MODE_MARGINREQUIRED)*maxlimlots1;
		double margenLimite1 = MathAbs(((balance-perdidaMax1)/usedMargin1)*100); //en porcentaje
		
		//Miramos si los lotes calculados pueden soportar una perdida de n pips
		//static bool lotsOK = false;
		double buffer = buffer_Max_Lots;
	
		bool lotsOK = false;	
		while(!lotsOK)
		{
			//Print("Entra en el Bucle");
			lotsOK = false;
			maxlimlots = maxlots*(1-buffer);
			//Print("buffer: " + buffer + "; maxlimlots: " + maxlimlots);
			double perdidaMax = stopLoss*valorPip*maxlimlots;
			double usedMargin = MarketInfo(par, MODE_MARGINREQUIRED)*maxlimlots;
			double margenLimite = MathAbs(((balance-perdidaMax)/usedMargin)*100); //en porcentaje
			double brokerStopOut = AccountStopoutLevel();
			if(brokerStopOut < 100) brokerStopOut = 100;
			int level = (brokerStopOut+15);
			if(buffer < 0.95)
			{
				if(margenLimite < level) buffer = buffer + 0.005;
				else if (margenLimite >= level) {lotsOK = true;break;}
			}
			else break;
		}
		maxlimlots = maxlots*(1-buffer);
	}
	
	if(maxLotsBroker > 1000.0) maxLotsBroker = 1000.0; //<--- In Alpari's Demo Accounts, they set 99999 as maxLots
	if(maxlimlots > maxLotsBroker) maxlimlots = 1000.0;
	else if(maxlimlots < minLotsBroker) maxlimlots = minLotsBroker;
	if(Step<=0) return(0);
	double lotsOrder = MathFloor(maxlimlots/Step)*Step; //Sirve para pasar de 23.457469 a 23.45
	//Print("maxLotsBroker: " + maxLotsBroker + ", minLotsBroker: " + minLotsBroker +", lotesCalculados: " + maxlimlots + ", lotesCalculadosFinal: " + lotsOrder);
	return(lotsOrder);
}
Author:  milanese [ Tue Apr 08, 2014 7:25 pm ]
Post subject:  Asia Pacific Breakout Zone EA

basch312 » Tue Apr 08, 2014 7:15 pm wrote:Hi all,

I'm getting started with this EA, thanks to all contributors for sharing it.

I've got an error (zero divide) when I set UseFixLot = false due to "CalculateLots" function.
Here you have the function I use to calculate Lots, in case yuu may need it:

Code: Select all

double calcLots(int magicNumber, bool usarPorcentaje, double porcentaje, string par, double balanceDeTrabajo, double buffer_Max_Lots, double stopLoss)
{
	double balance;
	if (balanceDeTrabajo == 0) balance = AccountBalance();
	else balance = balanceDeTrabajo;
	
	double maxlots = 0.0, maxlimlots = 0.0, relacionForexOro = 0.0, margRequired = 0.0, maxLotsPorMargen = 0.0, maxLotsBroker = 0.0, minLotsBroker = 0.0;
	int digits  = MarketInfo(par,MODE_DIGITS);
	double Step = MarketInfo(par,MODE_LOTSTEP);
	double valorPip = MarketInfo(par, MODE_TICKVALUE)*10;
	maxLotsBroker = MarketInfo(par, MODE_MAXLOT);
	minLotsBroker = MarketInfo(par, MODE_MINLOT);

	//------------Lotes segun porcentaje -------------//
	if(usarPorcentaje)
	{
		if(stopLoss>0 && valorPip>0)
			maxlimlots = (balance*(porcentaje/100)/stopLoss)/valorPip;
		else maxlimlots = 0.0;
	}
	else
	{
		//------------Lotes a tope -------------// <---- max lots for "stopLoss"
		if(par == "XAUUSD" || par == "GOLD")
		{
			switch(digits)
			{
				case 2: relacionForexOro = 50.0; break;
				case 3: relacionForexOro = 1/5.6; break;
			}
		}
		else relacionForexOro = 1; // para cualquier par de forex 
		
		maxlots = (balance*AccountLeverage())/100000*relacionForexOro;
		
		margRequired     = MarketInfo(par, MODE_MARGINREQUIRED); // current price * 1000
		maxLotsPorMargen = NormalizeDouble(balance/margRequired, 1);
		  
		if(maxlots > maxLotsBroker) maxlots = maxLotsBroker;
		if(maxLotsPorMargen > maxLotsBroker) maxLotsPorMargen = maxLotsBroker; 
		
		double maxlimlots1 = maxlots*(1-buffer_Max_Lots);
		
		double perdidaMax1 = stopLoss*valorPip*maxlimlots1;
		double usedMargin1 = MarketInfo(par, MODE_MARGINREQUIRED)*maxlimlots1;
		double margenLimite1 = MathAbs(((balance-perdidaMax1)/usedMargin1)*100); //en porcentaje
		
		//Miramos si los lotes calculados pueden soportar una perdida de n pips
		//static bool lotsOK = false;
		double buffer = buffer_Max_Lots;
	
		bool lotsOK = false;	
		while(!lotsOK)
		{
			//Print("Entra en el Bucle");
			lotsOK = false;
			maxlimlots = maxlots*(1-buffer);
			//Print("buffer: " + buffer + "; maxlimlots: " + maxlimlots);
			double perdidaMax = stopLoss*valorPip*maxlimlots;
			double usedMargin = MarketInfo(par, MODE_MARGINREQUIRED)*maxlimlots;
			double margenLimite = MathAbs(((balance-perdidaMax)/usedMargin)*100); //en porcentaje
			double brokerStopOut = AccountStopoutLevel();
			if(brokerStopOut < 100) brokerStopOut = 100;
			int level = (brokerStopOut+15);
			if(buffer < 0.95)
			{
				if(margenLimite < level) buffer = buffer + 0.005;
				else if (margenLimite >= level) {lotsOK = true;break;}
			}
			else break;
		}
		maxlimlots = maxlots*(1-buffer);
	}
	
	if(maxLotsBroker > 1000.0) maxLotsBroker = 1000.0; //<--- In Alpari's Demo Accounts, they set 99999 as maxLots
	if(maxlimlots > maxLotsBroker) maxlimlots = 1000.0;
	else if(maxlimlots < minLotsBroker) maxlimlots = minLotsBroker;
	if(Step<=0) return(0);
	double lotsOrder = MathFloor(maxlimlots/Step)*Step; //Sirve para pasar de 23.457469 a 23.45
	//Print("maxLotsBroker: " + maxLotsBroker + ", minLotsBroker: " + minLotsBroker +", lotesCalculados: " + maxlimlots + ", lotesCalculadosFinal: " + lotsOrder);
	return(lotsOrder);
}
This EA is only concepted for using fixed lots.....

Cheers :)

Tommaso
All times are UTC Page 5 of 17