Reply

Maximum Lots Protection no more than 100

7 replies

bobotrade

Subscriber, bbp_participant, community, 6 replies.

Visit profile

6 years ago #113470

hello,

 

The “Maximum lots” function does not accept numbers greater than 100

 

It’s a problem with my broker (FXCM) on the DAX that operate micro lots without decimals

 

 

Thanks for help

0

Mark Fric

Administrator, sq-ultimate, 3 replies.

Visit profile

6 years ago #129367

Hello,

 

can you tell me what you want to achieve? Is this some error in EA Wizard? If your broker doesn’t support more than 100 lots it seems to me like a broker limitation.

Mark
StrategyQuant architect

0

bobotrade

Subscriber, bbp_participant, community, 6 replies.

Visit profile

6 years ago #129389

hello,

 

it’s a error with EA Wizard. When I put more than 100 lots in Maximum Lots Protection, the EA does not open positions

 

And my broker FXCM don’t have limitation, I can open manualy more than 100 lots without problem

0

bobotrade

Subscriber, bbp_participant, community, 6 replies.

Visit profile

6 years ago #129421

hello,

 

any solution please ? this is an important issue for me

 

thanks in advance  😉

0

nolube

Customer, bbp_participant, community, 114 replies.

Visit profile

6 years ago #129436

Have you tried entering 999?

 

Sorry not sure if this will help or not as I don’t really use the software.

0

bobotrade

Subscriber, bbp_participant, community, 6 replies.

Visit profile

6 years ago #129453

hello

 

Have you tried entering 999?

 

Sorry not sure if this will help or not as I don’t really use the software.

 

hello, good idea but not work…  :unsure:

 

any solution please ?

0

bobotrade

Subscriber, bbp_participant, community, 6 replies.

Visit profile

6 years ago #129576

hello, do you have a solution to put more than 100 lots ?

 

I can not use the money management and I’m stuck in the development of my EA  :wacko:

0

bobotrade

Subscriber, bbp_participant, community, 6 replies.

Visit profile

6 years ago #129582

maybe something to change in the code of the EA ?

//+------------------------------------------------------------------+
//+ Money Management functions
//+------------------------------------------------------------------+

double sqMMGetOrderStopLossDistance(int orderMagicNumber, int orderType) {
   double openPrice = getOrderPrice(orderMagicNumber);
   double slSize = getOrderStopLoss(orderMagicNumber, orderType, openPrice);

   if(slSize == 0) return(0);

   if(orderType == OP_BUY || orderType == OP_BUYSTOP || orderType == OP_BUYLIMIT) {
      return(openPrice - slSize);
   } else {
      return(slSize - openPrice);
   }
}

double sqMMFixedRisk(int orderMagicNumber, int orderType) {
   Verbose("Computing Money Management for order with Magic Number: ", orderMagicNumber," - fixed risk");

   double slSize = sqMMGetOrderStopLossDistance(orderMagicNumber, orderType) * gPointPow;
   if(slSize <= 0) {
      Verbose("Computing Money Management - Stop Loss is zero, using Lots if no MM: ", 5.0);
      return(5.0);
   }

   double _riskInPercent = Risk;
   double _lotsDecimals = 2.0;
   double _maximumLots = 100.0;
   double _exchRate = 1.0;

   if(_riskInPercent < 0 ) {
      Verbose("Computing Money Management - Incorrect RiskInPercent size, it must be above 0");
      return(0);
   }

   double riskPerTrade = (_exchRate * AccountBalance() *  (_riskInPercent / 100.0));
   if(slSize <= 0) {
      Verbose("Computing Money Management - Incorrect StopLossPips size, it must be above 0");
      return(0);
   }
   Verbose("Risk per trade: ", riskPerTrade);

   Verbose("Computing Money Management - SL: ", slSize, ", Account Balance: ", AccountBalance(),", Tick value: ", MarketInfo(Symbol(), MODE_TICKVALUE),", Point: ", MarketInfo(Symbol(), MODE_POINT), ", Lot size: ", MarketInfo(Symbol(), MODE_LOTSIZE),", Tick size: ", MarketInfo(Symbol(), MODE_TICKSIZE));
   double tickValue = MarketInfo(Symbol(),MODE_TICKVALUE);

   double lossPerTick = riskPerTrade / slSize;
   Verbose("Computed lossPerTick: ",lossPerTick);
   double lossPerTick2 = lossPerTick;
   if(Digits == 1 || Digits == 3 || Digits == 5) {
      lossPerTick2 = 0.1 * lossPerTick;
   }
   Verbose("Computing: LossPerTick: ",lossPerTick, ", LossPerTick2: ",lossPerTick2);

   double lotMM1 = lossPerTick2;
   if(tickValue  0) {
      lotMM = lotMM1 - MathMod(lotMM1, lotStep);
   } else {
      lotMM = lotMM1;
   }

   lotMM = NormalizeDouble( lotMM, _lotsDecimals);

   if(MarketInfo(Symbol(), MODE_LOTSIZE)==10000.0) lotMM=lotMM*10.0 ;
   lotMM=NormalizeDouble(lotMM,_lotsDecimals);

   double Smallest_Lot = MarketInfo(Symbol(), MODE_MINLOT);
   double Largest_Lot = MarketInfo(Symbol(), MODE_MAXLOT);

   if (lotMM  Largest_Lot) lotMM = Largest_Lot;

   if(lotMM > _maximumLots) {
      lotMM = _maximumLots;
   }

   Verbose("Computing Money Management - final computed lots: ", lotMM);
   return (lotMM);
}

0

Viewing 8 posts - 1 through 8 (of 8 total)