Errors, bugs, questions - page 2171

 
Anton Ohmat:


ENUM_POSITION_TYPE pos_type = PositionGetInteger (POSITION_TYPE);

Swears implict enum conversation, what did I do wrong? (I understand the essence of the error, can it be performed somehow differently?)

ENUM_POSITION_TYPE pos_type = (ENUM_POSITION_TYPE)PositionGetInteger (POSITION_TYPE);
 
Alain Verleyen:
Thank you!!!
 

Why does the terminal show a different price for the same object placed horizontally?


 
Can you tell me how to get the minimum stop on SymbolInfoDouble - I can't find what to ask for here in the help
 
Anton Ohmat:
Please advise how to get the minimum stop value for SymbolInfoDouble - I can't find it in the help, what exactly should be requested here

You should look in SymbolInfoInteger. When you get zero and an error, go to the "newbie questions" thread and there will be the following hints.

SYMBOL_TRADE_STOPS_LEVEL

Minimum step back from the current close price to place a stop order

int

 
Aleksey Vyazmikin:

Why does the terminal show different prices for the same object positioned horizontally?


The tooltip shows the current position of the mouse cursor, not the level of the graphical object.

The tooltip does not appear when the cursor is precisely positioned on some object, but when the proximity is less than 5 pixels

 
Slava:

The tooltip shows the current position of the mouse cursor, not the level of the graphical object.

The tooltip appears not at the precise positioning of the cursor on some object, but at the proximity of less than 5 pixels

But what use is it to the trader? It is much more useful to know the price at which the object is located...

 

I want to understand if the behavior is correct

The main file is named TEST.mq5 which has a define file, this define is used in plug file "test_file_.mqh"

//+------------------------------------------------------------------+
#define   file   __FILE__ 
#include  "test_file_.mqh"
//+------------------------------------------------------------------+
int OnInit()
  {
   Print(func());
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
void OnTick()
  {
  }
//+------------------------------------------------------------------+

The plug-in file simply returns what's contained in the define.

//+------------------------------------------------------------------+
//|                                                   test_file_.mqh |
//|                        Copyright 2018, MetaQuotes Software Corp. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+

string func()
{
return file;
}

I was expecting the name of the main file TEST.mq5 to be returned, because the macro is declared at the very beginning of the code in the main file.

I expected the file name in which the define is declared.


But it returns the value from the include file test_file_.mqh and the value test_file_.mqh.

Is it correct ?


In help it is written "Name of the current compiled file" the main file is also the current file.

 

Forum on trading, automated trading systems and trading strategy testing

MetaTrader 5 build 1700 beta platform: Projects in MetaEditor and synthetic tools

Aleksey Vyazmikin, 2018.03.22 01:35

Please help!

I am getting an error:

2018.03.22 03:29:06.834 Synthetic Symbol Si-Test: cannot find symbol "Si"

To formula "Si-9.18"-"Si-6.18" - what am I doing wrong?

 
Vladimir Pastushak:

I want to understand if the behavior is correct

The main file is named TEST.mq5 which has a define file, this define is used in plug file "test_file_.mqh"

The plug-in file simply returns what's contained in the define.

I was expecting the name of the main file TEST.mq5 to be returned, because the macro is declared at the very beginning of the code in the main file.

I expected the file name in which the define is declared.


But it returns the value from the include file test_file_.mqh and the value test_file_.mqh.

Is it correct ?


In help it says "Name of current compiled file" the main file is also the current file.

This behavior seems logical to me, because in the define you replace the variable with __FILE__ macro, which is substituted and calculated independently inside the include file.

That's how it works:

//+------------------------------------------------------------------+
string main_file_name=__FILE__;
#define  file main_file_name
#include  <test_file_.mqh>
//+------------------------------------------------------------------+
int OnInit()
  {
   Print(func());
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
void OnTick()
  {
  }
//+------------------------------------------------------------------+
Reason: