Any questions from a PROFI to a SUPER PROFI - 1. - page 44

 
TheXpert:

Unrealistic without control in the EA itself.

In general terms, apparently, yes.

But if we stipulate that recalculation should not be performed more often than once in X ms, then we can solve it simply and directly.


TheXpert:

Not only that, you don't have to.

Well, a single line inlude is always more convenient than shamanism in each Expert Advisor that uses it.

 
Andrey Khatimlianskii:

Well, a one-line inlude is always more convenient than shamming in every EA that uses it.

you can probably do, fxsaber style, with input functions overridden by defines

 
you can try "directly": for example, to read ticks by time from the beginning of the last minute bar to the current moment. check their number, i.e. compare the size of the resulting array - if it remains the same, then the tick is still the same, already counted. a new tick comes - the array increases; a new bar comes - it decreases
 
Andrey Khatimlianskii:

No, it will definitely be slower than the bid/ask/ms comparison.

What's the problem with reliability? All that matters is the fact that something has changed.

Or maybe immutability, the tick is the same, neither bid nor ask has changed.

 
Andrey Khatimlianskii:

In general terms, probably yes.

But if we stipulate that recalculation must be performed not more often than once in X ms, then we can solve it simply and directly.


Well, one-line inlude is always more convenient than shamanism in each Expert Advisor that uses it.

What's the shamanism, besides the inlude, is to insert one more line at the beginning of

OnTick(){ Count_tick++;

If defyne does not help, Ctrl-H helps :)

You still need to call the library function from an include, i.e. insert it into your code somehow

//include file
static int Count_tick=0;
void SameTick(int &tick, bool &same_tick) { if(tick<Count_tick){tick=Count_tick;return ;} else same_tick=true; return ;}
#define  SameTick() static int my_tick=0;bool same_tick=false;SameTick(my_tick, same_tick)

// EA file

func1(){SameTick();   if (same_tick)... }
func2(){SameTick();   if (same_tick) ...}...

s.s. theoretically on a fast market there can be several ticks in one ms, among which the first and the last have the same bid and ask.

 
Igor Zakharov:
you can try "directly": read ticks, for example, by time from the beginning of the last minute bar till the current moment. check their number, i.e. compare the size of obtained array - if it remains the same, then tick is still the same, already calculated. a new tick comes - the array will increase; a new bar will decrease

Well, of course! There is a Volume (which is ticking). This is the unique tick number (within a bar, but that's enough)!

I'll check if such a trick gives acceleration.

 
TheXpert:

probably can be done, fxsaber style, with overriding input functions via defines

Aleksey Mavrin:

what's the shamanism, apart from the inlude, put one more line at the beginning of the

If define doesn't help, Ctrl-H helps :)

You still have to call the library function from an include, i.e. insert it into code somehow

It seems so. If Volume is slow, I'll de-file everything I need.


Thank you all for participating!

 
Aleksey Mavrin:

what's the shamanism, apart from the inlude, another line to insert at the beginning of the

If define doesn't help, Ctrl-H helps :)

You still have to call the library function from the inlude, i.e. insert it into the code somehow

s.s. theoretically on a fast market, there can be several ticks in one ms, among which the first and the last have the same bid and ask.

Aleksey Mavrin:

and what's the shamanism, besides the inlude one more line to insert in the beginning

If define doesn't help, Ctrl-H helps :)

You still need to call the library function from an include, i.e. insert it into your code like this

s.w. Theoretically in a fast market you can have several ticks in one ms, among which the first and the last have the same bid and ask.

Static is only initialised when attached to the chart, so there will be calculation error.

static int Count_tick=0;
 
Алексей Тарабанов:

Static only initialises when it is attached to the graph, so there will be a calculation error.

I don't understand what the error will be. It is declared at global level, it makes no difference.

 
Andrey Khatimlianskii:

Well, of course! There is a Volume (which is ticking). This is the unique tick number (within a bar, but that's enough)!

if a new tick comes in while the tick is being processed, will it possibly change?

Reason: