Errors, bugs, questions - page 2687

 
Andrey Dik:

here.

And mat computing mode too.

Is there a 100 mio limit there too?

 
Andrey Khatimlianskii:

Is there a 100 mio limit there too?

also

 
Andrey Kaunov:

In general, the broker stubbornly deleted my question from the forum. After the third time, they answered some nonsense in my personal message:

I have not got a response from the broker, but I'm not sure how to answer.


P.S. They left my post in one thread, but no reply or goodbye.

https://forum.alpari.com/index.php?/topic/

I trade with the same broker. Faced the same problem. The difference between currencies and gold (as well as indices) is in the SYMBOL_TRADE_MODE property.

For currencies SYMBOL_TRADE_MODE = SYMBOL_CALC_MODE_FOREX and for metals and indices SYMBOL_TRADE_MODE = SYMBOL_CALC_MODE_CFDLEVERAGE.

It seems this broker or the platform for the SYMBOL_CALC_MODE_CFDLEVERAGE mode does not calculate correctly the properties SYMBOL_TRADE_TICK_VALUE_PROFIT and SYMBOL_TRADE_TICK_VALUE_LOSS

So you have to squat a bit more to calculate the symbols in SYMBOL_CALC_MODE_CFDLEVERAGE mode. I use the formula from the documentation

Profit: (close_price - open_price) * Contract_Size*Lots

.

Here is an example of the function, which at this broker, calculates the position volume according to the opening price, stop-loss price and maximal loss in the account currency. It works correctly with Alpari, I haven't checked with other brokers yet.

double calcVolume(double sl, double price, double maxLoss){
   ENUM_SYMBOL_CALC_MODE cm = si.TradeCalcMode();       // si - внешняя переменная CSymbolInfo из стандартной библиотеки
   double priceDiff = MathAbs(price - sl); 
   double ticks = priceDiff/si.Point();         
   double lots;
   string convertSymbol;
   string accountCurrency = AccountInfoString(ACCOUNT_CURRENCY);
   Print("SL ticks: ", ticks);
   switch(cm) {
      case SYMBOL_CALC_MODE_FOREX:      
         // это для валютных пар
         lots = maxLoss / ticks / si.TickValueLoss();
         break;
      case SYMBOL_CALC_MODE_CFDLEVERAGE: 
         // а эти танцы с бубном для металлов и индексов
         lots = maxLoss / priceDiff / si.ContractSize();
         if (si.CurrencyProfit() != accountCurrency) {
            // валюту прибыли конвертируем в валюту депозита
            convertSymbol = si.CurrencyProfit() + accountCurrency + SymbolSuffix;
            double convert = SymbolInfoDouble(convertSymbol, SYMBOL_BID);
            if (convert != 0) {
               Print("Convert currency1 to ", convertSymbol, " convert bid: ", convert);            
               lots = lots / convert;
            }
            else {
               convertSymbol = accountCurrency + si.CurrencyProfit() + SymbolSuffix;
               convert = SymbolInfoDouble(convertSymbol, SYMBOL_ASK);
               Print("Convert currency2 to ", convertSymbol, " convert ask: ", convert);            
               lots = lots * convert;
            }
         }
         break;
      default:
         Print("ERROR need support calc for: ", EnumToString(cm));
         lots = 0;
         break;
   }
   double floorLots = MathFloor(lots / si.LotsStep()) * si.LotsStep();
   Print("raw lots: ", lots, ", floorLots: ", floorLots, " diff: ", NormalizeDouble(100*floorLots/lots, 2), "%");
   return floorLots;
}
 
Alexey Rassvetnyy:

The profits/losses in the tooltip for buy stop limit orders and for sell stop limit orders are calculated incorrectly.

Gentlemen, MQ, have the described defect been fixed? Do we expect it to be fixed in the next release?

Link to original post about the defect.

https://www.mql5.com/ru/forum/1111/page2670#comment_15391563

Ошибки, баги, вопросы
Ошибки, баги, вопросы
  • 2020.03.11
  • www.mql5.com
Общее обсуждение: Ошибки, баги, вопросы
 
Andrey Dik:

also

Then trouble.

 
Got this in the Logbook.
2020.03.29 20:58:28.061 SymbolClone (EURUSD,M1) Unknown runtime error in 'SymbolClone.mq5' (1,1)

To play, start in Debug and reach breakpoint. Then in Terminal (not ME) change profile - SHIFT+F5.

 
Alexey Rassvetnyy:

Trading with the same broker. Faced the same problem. The difference between currencies and gold (as well as indices) is in the SYMBOL_TRADE_MODE property.

For currencies SYMBOL_TRADE_MODE = SYMBOL_CALC_MODE_FOREX and for metals and indices SYMBOL_TRADE_MODE = SYMBOL_CALC_MODE_CFDLEVERAGE.

It seems this broker or the platform for the SYMBOL_CALC_MODE_CFDLEVERAGE mode does not calculate correctly the properties SYMBOL_TRADE_TICK_VALUE_PROFIT and SYMBOL_TRADE_TICK_VALUE_LOSS

So you have to do some extra squatting to calculate the symbols in SYMBOL_CALC_MODE_CFDLEVERAGE mode. I use the formula from the documentation

Profit: (close_price - open_price) * Contract_Size*Lots

.

Here is an example of the function, which at this broker, calculates the position volume according to the opening price, stop-loss price and maximal loss in the account currency. At Alpari it works correctly, at other brokers I have not checked yet.


That's great, of course. But why do I have to go the hard way if I can and should use the standard TICK VALUE function?

Maybe the developers will still pay attention to this error.

Alexey Rassvetnyy:

Gentlemen, representatives of the company MQ, has this defect been fixed? Do you expect a fix in the next release?

Link to original post about the defect.

https://www.mql5.com/ru/forum/1111/page2670#comment_15391563

I join in the question.

Here is my original posthttps://www.mql5.com/ru/forum/351/page4#comment_15429966
Расчет TickValue и прибыли
Расчет TickValue и прибыли
  • 2010.09.26
  • www.mql5.com
На межбанке Equity постоянно меняется, если вы открыли и закрыли позицию с валютой прибыли не равной валюте счета (например, на USD-счете совершили сделку на USDJPY).
 
Andrey Khatimlianskii:

Then trouble.

For millisecond tasks there is no sense to optimize on agents, it is better to do everything manually and not on mql. so the limitation is quite sensible in any case, it is just bad that it is implicit

 
Andrei Trukhanovich:

for millisecond tasks there is no sense to optimize on agents, it's better to do everything manually and not on mql. so limitation is quite sensible in any case, it's just bad that it's implicit

Even if you connect claud and give 100-500-1000K packs per agent?

Maybe, yes, the network costs would ruin the whole gain.

 
fxsaber:

mq5 - normal. mq4 - broken. You can take TypeToBytes_ExampleScript.mq4 from here. Compiles only if extension is changed to mq5.

2372 - the error has been corrected, thank you.

Reason: