Errors, bugs, questions - page 2572

 
Vict:

How do you create a CJVal? probably new CJVal()?

It's unlikely that the terminal will catch this.

No, as in the biblical author's example, on the stack

CJAVal js(NULL, jtUNDEF);
 

I found that in my visual testing mode SymbolInfoTick() returns one value but the Close[0] timeseries has a different value.

Is it my mistake ? Am I doing something wrong ?

It seems like it should be the same values:

int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
  {
//---

   MqlTick mtLastTick;
   SymbolInfoTick(Symbol(),mtLastTick);
   
   ArraySetAsSeries(close,true);


   Comment("Close[0] = " + DoubleToString(close[0],5) + "\nLastBid = " + DoubleToString(mtLastTick.bid,5));
   
//--- return value of prev_calculated for next call
   return(rates_total);
  }

Usually the difference is 1-2 points, but on sharp movements it can be more.

Is it only me ?

So far I took time series as "more correct". If it turns out that SymbolInfoTick() gives a different value than Close[0], I assume that the correct one is Close[0] and I leave the spread as it was returned by SymbolInfoTick().

However, I want to know which price is correct and whether it is Close[0] or SymbolInfoTick().

Files:
TestTick.mq5  2 kb
 
Georgiy Merts:

I found that in my visual testing mode SymbolInfoTick() returns one value but the Close[0] timeseries has a different value.

Is it my mistake ? Am I doing something wrong ?

It seems like it should be the same values:

Usually the difference is 1-2 points, but on sharp movements it can be more.

Is it only me ?

For now I've taken time series as "more correct". If it turns out that SymbolInfoTick() gives a different value than Close[0], then I think that the correct value is Close[0] and I leave the spread as it was returned by SymbolInfoTick().

But I want to know which price is correct - whether it is SymbolInfoTick() or Close[0].

There is also SymbolInfoDouble(_Symbol,SYMBOL_BID).

 
Andrey Barinov:

There is also SymbolInfoDouble(_Symbol,SYMBOL_BID)

Yes, it returns the same as SymbolInfoTick().

 

Some advice on global variables. Solved the problem of saving ticks from Market Watch.

Each new tick increases the corresponding global variable by one. By eye, Market Watch receives about 100 ticks per second.

In total, the global variables are updated at a frequency of 100 Hz. I'm wondering if it negatively affects SSD?

I'm writing the ticks themselves every 1000 (~1 Gb for a week). So, I'm fine with it. But with global - have not thought before, that they are written to SSD with each update.

That's why I had such a question.

 
fxsaber:

Some advice on global variables. Solved the problem of saving ticks from Market Watch.

Each new tick increases the corresponding global variable by one. By eye, Market Watch receives about 100 ticks per second.

In total, the global variables are updated at a rate of 100 Hz. I'm wondering if it negatively affects SSD?

I'm writing the ticks themselves every 1000 (~1 Gb for a week). So, I'm fine with it. But with global - have not thought before, that they are written to SSD with each update.

That's why I had such a question.

They are not written to disk with every update

 
fxsaber:

Some advice on global variables. Solved the problem of saving ticks from Market Watch.

Each new tick increases the corresponding global variable by one. By eye, Market Watch receives about 100 ticks per second.

In total, the global variables are updated at a rate of 100 Hz. I'm wondering if it negatively affects SSD?

I'm writing the ticks themselves every 1000 (~1 Gb for a week). So, I'm fine with it. But with global - have not thought before, that they are written to SSD with each update.

That's why such a question arose.

I think global terminal variables are implemented via resources with periodic autosave to disk. I don't think autosave happens more often than once every 3 seconds, most likely much less often, and it's even possible that only when a deinit event occurs.

 

I don't want to look up what I once read in the help about global variables of the terminal, but it seems that they are saved when the terminal is closed - although I may forget, it's been a long time since I read it

it's easier to check, in Windows Task Manager there's a diagram of hard drive usage


 
Igor Makanu:

I don't want to look up what I once read in the help about global variables of the terminal, but it seems that they are saved when the terminal is closed - although I may forget, it's been a long time since I read it

it's easy to check, in Windows Task Manager there's a hard drive usage chart


Probably in the footnote here.

 
Thanks to everyone who responded. The flush function immediately eliminated any ambiguity.
Reason: