Errors, bugs, questions - page 1330

 

Why, when compiling the indicator, all the settings in this indicator that are on the charts are reset to default?

 
iZer0:

Good afternoon, can you please guide the nouveau. I use MT5 not for trading, but as a source of some "random" data (and don't even ask why - not my whim). Is it possible to obtain historical data, measured in ticks (I need bid and ask data several times per second). What should I do? I know that when testing an indicator MT5 pumps out data - how to use this ?

I have a task to write a custom indicator that sends current ticks to a certain service (no problem). I haven't found anywhere how to get historical data in ticks but not in M1.

In the tester, you can obtain intra-bar M1 ticks. They are simulated by the terminal. How random is it? I don't know. Talking about MT4. Should be the same on MT5.
OnTick()
{Print("Bid=",Bid);}

In the "Log" tab of the strategy tester, see the price value and the arrival time.

Files:
2107.PNG  7 kb
 

MT4/845, Windows 7/64bit. Made a script:

#property strict
double value=1/2;
//---
void OnStart()
  {
   Print("value = ",DoubleToString(value));
  }

It prints in the logs:

2015.07.22 10:13:26.134 Test EURUSD,H1: value = 0.00000000

and it should be 0.50000000.

 
You should write 1.0/2 or 1/2.0 or 1.0/2.0 then it will be as expected.
 
Аноним:
You should write 1.0/2 or 1/2.0 or 1.0/2.0 then it will be what is expected.
Yes, your advice helped. Although it would seem that even without .0 it should work.
 

Why did methaquotes disable the function of uploading quotes from the dealer's server? Now it is only possible to upload from metaquotes.

But even this cannot be done, because the message says that there are no quotes.

Of course, it is absent, because why do the metaquotes have quotations with suffixes?

For example suffixes in currency pair names are used by fortfs, roboforex, eksness etc.

 
Maxim Khrolenko:
Yes, your advice helped. Although it would have seemed to work without .0.
Implicit conversion of double to int.
 

Different result: this is a questionable result

#import "Test.ex5"
        void f( uint, uint );
#import
        void f( uint, int  )   { Print( __FUNCSIG__ ); }
void OnStart()
{
        uint a = 0;
        f( 1, a ); //вызывается f(uint,int) - что само по себе сомнительно
}
and this is normal
        void f( uint, uint )    { Print( __FUNCSIG__ ); }
        void f( uint, int  )    { Print( __FUNCSIG__ ); }
void OnStart()
{
        uint a = 0;
        f( 1, a ); //вызывается f(uint,uint) - нормально
  
}
what difference does it make?
 
A100:
but otherwise it's fine, what difference does it make?
If I understand correctly, the compiler should crash and not compile at all. Because there uint uint, there uint int, and int, uint are passed to the function, uncertainty, however.
 
Аноним:
If I understand correctly, the compiler should crash and not compile at all. Because there uint uint, there uint int, and int, uint is passed into the function, uncertainty, however.

https://www.mql5.com/ru/docs/basis/function/functionoverload

Quote: "The function found must be the best choice among the other choices for at least one argument, and, at the same time, for the other arguments it must fit as well as the others."

So what is the best choice for calling f(int,uint) here?

Hint: the rest of the argument in this case is the first

Документация по MQL5: Основы языка / Функции / Перегрузка функций
Документация по MQL5: Основы языка / Функции / Перегрузка функций
  • www.mql5.com
Основы языка / Функции / Перегрузка функций - справочник по языку алгоритмического/автоматического трейдинга для MetaTrader 5
Reason: