Errors, bugs, questions - page 19

 
Yedelkin:

I think I understand the feature in question: determine the amount of free funds that will remain if a position is opened. Take a look at the following sections of the MQL5 manual:

- CAccountInfo;

- FreeMarginCheck.

Thanks for the tip, I haven't got to grips with the standard library yet, it seems to be essential.
 
sergey1294:
Thanks for the tip, I haven't understood the standard library yet, probably I can't do without it.

Why not? It's quite possible...


By the way, a question to the developers - Is it only necessary to calculate margin for Forex (or is there another field of work there)?


I am thinking in particular about it:

double CAccountInfo::MarginCheck(const string symbol,
ENUM_ORDER_TYPE trade_operation,double volume) const
{
   double margin       =0.0;
   double contract_size=SymbolInfoDouble(symbol,SYMBOL_TRADE_CONTRACT_SIZE);
   long   leverage     =Leverage();
   string work;
   double price;
//---
   switch(SymbolInfoInteger(symbol,SYMBOL_TRADE_CALC_MODE))
     {
      case SYMBOL_CALC_MODE_FOREX:
         work=SymbolInfoString(symbol,SYMBOL_CURRENCY_MARGIN);
         if(work==Currency()) price=1.0;
         else                 price=SymbolInfoDouble(work+Currency(),SYMBOL_BID);
         margin=price*volume*contract_size/leverage;
         break;
      case SYMBOL_CALC_MODE_CFD:
         break;
      case SYMBOL_CALC_MODE_FUTURES:
         break;
      case SYMBOL_CALC_MODE_CFDINDEX:
         break;
      case SYMBOL_CALC_MODE_CFDLEVERAGE:
         break;
     }
//---
   return(margin);
}
 

Also the logic of this function is not very clear to me (or rather it is clear, it is not clear why it is implemented this way)...

double CAccountInfo::FreeMarginCheck(const string symbol,
ENUM_POSITION_TYPE trade_operation,double volume) const
{
return(FreeMargin()-MarginCheck(symbol,trade_operation,volume));
}

PS

As far as I understand both of these functions are not quite finished, at least they do not reflect the necessary reality in calculations...

 
Interesting:

By the way, a question to the developers - Is it only necessary to calculate margin for Forex (or is there another field of work there)?

From the developers' response in March it appears that this is a temporary phenomenon (i.e. "there is still work to be done") : https://www.mql5.com/ru/forum/11/page14/#comment_3346
 
Yedelkin:
From the developers' reply of March, it seems that this is a temporary phenomenon (i.e. "there is still a field to work on") : https://www.mql5.com/ru/forum/11/page14/#comment_3346

I see, the "uncultivated field" is still...

Does anyone (including the developers) have a proper calculation algorithm?

 
Prival:
I don't know. I only downloaded the terminal from you. I didn't use any others. Now the data has appeared, but it was also missing this morning (it must have been missing all night). I can send you the files for analysis, just tell me what and where.

Yes. There was a problem on the server.

The issue has been resolved.

 
alexvd:

Yes. There was a problem on the server.

The issue has been resolved.

I don't know what YOU did and how it was solved, but you can't do that now, there is no data for 30.


i can see from the picture that i traded yesterday, i.e. i had the data (quotes) yesterday, and now someone has stolen it from me? went to look for a neighbour and beat him up :-) with the quality of quotes delivered, the creation of ATC is out of the question ... how genius i needed to calculate and program everything correctly ... refresh does not help

 
Prival:

I don't know what YOU decided, but you can't do that now, there is no data for 30.


The figure shows that I traded yesterday, the trades are plotted on the chart, i.e. i had the data (quotes) yesterday, and now someone has stolen it from me? went to find my neighbour and beat him up :-) with this quality of quote delivery, creating an ATC is out of the question ... what kind of genius do you have to be to calculate and program everything correctly ... refresh does not help


What access server are you currently connected to?
 
alexvd:
What access server are you currently connected to?

Point 2

account 92879 all the time on it and haven't changed.

 
Prival:

Point 2

account 92879 all the time on it and haven't changed it.

Switch until Point 3 or 4.
Reason: