Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 84

 
paladin80:

Those passes that have gone into deficit are not shown. Right-click on any optimisation result and uncheck the box for "Skip useless results".




it's not about optimisation.

the test is a one-off.

and its results in different tabs differ by 30 as I indicated above

 
lottamer:


it's not about optimisation.

the test is a one-off.

and its results vary by 30 in different tabs as I indicated above

Throw in a screenshot of the report with the problem areas and let's have a look at it. Or upload the whole report in full.
 

Dear programmers, explain this point, here is the algorithm that calculates the lot for Money Managment, but the problem is that once he understands that to open a lot less than 0.01 i.e. allowable, then naturally follows Order Send Error and goodbye, advise what to enter to open less than 0.01 lot can not be even if the algorithm requires so.

double GetSizeLot()
{  
  if (MM==false) 
      MMLot=Lots;
      
  if (MM==true)
     {
      MMLot=((AccountFreeMargin()*TradeLotRiskPercent)/100000);
     }
  return(MMLot);
}
 
ZahvatkiN:

Dear programmers, explain this point, here is the algorithm that calculates the lot for Money Managment, but the problem is that once he understands that to open a lot less than 0.01 i.e. allowable, then naturally follows Order Send Error and goodbye, advise what to enter to open less than 0.01 lot can not be even if the algorithm requires it.

1. It is necessary to normalize.

2. and fix the minimum lot.

MMLot=NormalizeDouble(MathMax((AccountFreeMargin()*TradeLotRiskPercent)/100000,MinLot),2);
 
ZahvatkiN:

Dear programmers, explain this point, here is the algorithm that calculates the lot for Money Managment, but the problem is that as soon as he realizes that to open a lot less than 0.01 i.e. allowable, then of course follows Order Send Error and goodbye, tell me what to enter that less than 0.01 lot can not open even if the algorithm requires it.

double GetSizeLot(double TradeLotRiskPercent)
{  
   double MMLot, MinLot, MaxLot;
   //---
   MinLot=MarketInfo(Symbol(),MODE_MINLOT);
   MaxLot=MarketInfo(Symbol(),MODE_MAXLOT);
   //---
   MMLot=AccountFreeMargin()*TradeLotRiskPercent)/100000;
   if (MMLot<=MinLot) return(MinLot);
   if (MMLot>=MaxLot) return(MaxLot);
   else 
   {  MMLot=NormalizeDouble(MMLot,2);
      return(MMLot);
   }
}

You have the formula for calculating MMLot divided by 100000. Most likely you are calculating for 1:100 leverage and a normal account where the lot size is 100000 of the base currency (e.g. USD). If you throw such an EA to cent account (lot = 10000) and/or with different leverage, it will not count the lot correctly. Try this design:

double GetSizeLot(double TradeLotRiskPercent)
{  
   double MMLot, MinLot, MaxLot;
   int    LotSize, Leverage;
   //---
   MinLot  =MarketInfo(Symbol(),MODE_MINLOT);
   MaxLot  =MarketInfo(Symbol(),MODE_MAXLOT);
   LotSize =MarketInfo(Symbol(),MODE_LOTSIZE);
   Leverage=AccountLeverage();
   //---
   MMLot=AccountFreeMargin()*TradeLotRiskPercent)/ 100*Leverage/LotSize;
   if (MMLot<=MinLot) return(MinLot);
   if (MMLot>=MaxLot) return(MaxLot);
   else 
   {  MMLot=NormalizeDouble(MMLot,2);
      return(MMLot);
   }
}
 
IfI use Alpari_ECN_Live account with 1:500 leverage and TradeLotRiskPercent=10 i.e. 10% of 1000$ deposit, the lots will start working from 0.5. So, this formula is only for 1:100 leverage? I guess there is no universal code for any leverage and account?
 
ZahvatkiN:
IfI use Alpari_ECN_Live account with 1:500 leverage and TradeLotRiskPercent=10 i.e. 10% of 1000$ deposit, the lots will start working from 0.5. So, this formula is only for 1:100 leverage? I guess there is no universal code for any leverage and account?
I think my 2 formula (from 23.08.2013 07:30) correctly calculates the lot. See 10% of $1000 = $100 (deposit), with 1:500 leverage the broker gives you the opportunity to open a deal of $50,000. 1 lot at a broker is $100,000, then your $50,000 is 0.5 lots.
MMLot=AccountFreeMargin()*TradeLotRiskPercent)/ 100*Leverage/LotSize.
MMLot=1000*10/100 * 500/100000 = 100 * 500/100000 = 50000 / 100000 = 0.50
 
paladin80:
I think my 2 formula (dated 23.08.2013 07:30) calculates the lot correctly. See 10% of $1000 = $100 (deposit), with 1:500 leverage the broker gives you the option to open a $50,000 trade. 1 lot at the broker is $100,000, then your $50,000 is 0.5 lots.
MMLot=AccountFreeMargin()*TradeLotRiskPercent)/ 100*Leverage/LotSize
MMLot=1000*10/100 * 500/100000 = 100 * 500/100000 = 50000 / 100000 = 0.50

Sama the formula itself is calculated without error, only in the idea of 10% of 1000 is a lot 0.1 rather than 0.5) Here it is clear why 0.5 because the leverage of 1:500, it would be a shoulder 1:100 it would open a lot just 0.1 so the question arises, but is there a universal algorithm for calculating the lot for any leverage and account type, or for each its own?
 

Dear forum users, help me to find the coordinates of the arrow

string arrowName=TimeToStr(Time[i]);

ObjectCreate(arrowName+ " Arrow",...);

I am making an Expert Advisor based on an indicator and I get arrows via iCustom, but I don't know how to find coordinates of several latest arrows.

 
nazar77:
Help me decompile the indicator. I won't decompile any further than me, I guarantee it.
Go to hell!!!
Reason: