these are the results this week from AsiaPacificBreakout C- OOTB- H1
very great results
Thank you Tomasso :hi:
Good spot Gunterputusernamehere » Sun Apr 06, 2014 7:37 pm wrote:Hi; :hi:
is this a error by the part close 0,05?
Cheers Gunter
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 milanese » Sun Apr 06, 2014 8:44 pm wrote:Good spot Gunterputusernamehere » Sun Apr 06, 2014 7:37 pm wrote:Hi; :hi:
is this a error by the part close 0,05?
Cheers Gunter![]()
Here you will find attached the latest one new we have for the SR Takeprofit a new settingMinWinForSR_TP=15here 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
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..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.
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.....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); }