Risposta

Lotti massimi Protection non più di 100

7 risposte

bobotrade

Abbonato, bbp_partecipante, comunità, 6 risposte.

Visita il profilo

9 anni fa #113470

ciao,

 

La funzione "Lotti massimi" non accetta numeri superiori a 100.

 

Si tratta di un problema con il mio broker (FXCM) sul DAX che opera con micro lotti senza decimali.

 

 

Grazie per l'aiuto

0

Mark Fric

Amministratore, sq-ultimate, 2 risposte.

Visita il profilo

9 anni fa #129367

Salve,

 

puoi dirmi cosa vuoi ottenere? Si tratta di un errore nell'EA Wizard? Se il vostro broker non supporta più di 100 lotti, mi sembra una limitazione del broker.

Marchio
Architetto StrategyQuant

0

bobotrade

Abbonato, bbp_partecipante, comunità, 6 risposte.

Visita il profilo

9 anni fa #129389

ciao,

 

si tratta di un errore con l'EA Wizard. Quando inserisco più di 100 lotti nella sezione Maximum Lots Protection, l'EA non apre le posizioni.

 

E il mio broker FXCM non ha limitazioni, posso aprire manualmente più di 100 lotti senza problemi.

0

bobotrade

Abbonato, bbp_partecipante, comunità, 6 risposte.

Visita il profilo

9 anni fa #129421

ciao,

 

Qualche soluzione per favore? Questo è un problema importante per me.

 

grazie in anticipo 😉

0

nolube

Cliente, bbp_partecipante, comunità, 115 risposte.

Visita il profilo

9 anni fa #129436

Hai provato a inserire il numero 999?

 

Mi spiace, non sono sicuro che questo possa essere d'aiuto o meno, dato che non uso molto il software.

0

bobotrade

Abbonato, bbp_partecipante, comunità, 6 risposte.

Visita il profilo

9 anni fa #129453

ciao

 

Hai provato a inserire il numero 999?

 

Mi spiace, non sono sicuro che questo possa essere d'aiuto o meno, dato che non uso molto il software.

 

ciao, buona idea ma non funziona... :unsure:

 

Qualche soluzione per favore?

0

bobotrade

Abbonato, bbp_partecipante, comunità, 6 risposte.

Visita il profilo

9 anni fa #129576

Salve, avete una soluzione per inserire più di 100 lotti?

 

Non posso usare il money management e sono bloccato nello sviluppo del mio EA :wacko:

0

bobotrade

Abbonato, bbp_partecipante, comunità, 6 risposte.

Visita il profilo

9 anni fa #129582

forse qualcosa da cambiare nel codice dell'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

Stai visualizzando 7 risposte - da 1 a 7 (di 7 totali)