problem - visual tester skipping bars or parts of them

 

Hi.

I have a problem with visual tester. I have a small cyclic code (EA) that I put into strategy tester whenever I want to be able to re-experience the market movement for any given time interval. Technically it shows me in real time how the market behaved in certain time interval and I can speed the process up and down.

Most or much of the time it works perfectly, however sometimes it seems to skip bars - it instantly makes a time jump from 1 bar to another without the price travelling up and down during the bar as it should.

I have a clear updated bar M1 history ( downloaded from fx something website... can't remember now) since 2001 so may 2011 shouldnt be giving problems (and it does).

The EA code is simple: a while loop that counts to certain number every simulated tick and then proceeds to next tick. The CPU load is of course enormous.

Is there anything I can do to prevent the time skipping during bar generation? I hope I described the problem in enough detail :)

Thanks in advance,

Fc.

 

I think I understand a part of the "why" behind the problem:

Since I'm feeding the cpu the while loop on each tick, it doesnt have time to compute indicators fast enough when new ticks come in or when new bar forms. That's why some of time gaps happen ( in the sense that the VT simply jump from a time to time with a already formed bar).

 

I have noticed that when clicking for example on the title of the terminal and holding the mousebutton down, MT4 skips all the visual output increasing the performance and after releasing the button it seems that the tester skips some bars.

//z

 

Now the interesting part with this is that I have tried slowing the VT down on main VT speed control, and adjusting my code to do extremely low amount of counts each tick, plus I removed 2 indicators that were most consuming, and the VT still persisted in skipping time and jumping from one fully formed bar to next.

Any ideas?

 
forexCoder:
The EA code is simple: a while loop that counts to certain number every simulated tick

Tester sends tick very fast and uses a lot of cpu, so are you (you can NOT sleep in the tester so are using all the cpu) so everything is getting scrambled.

Do NOT loop, return and count the next tick.

 
WHRoeder:

Tester sends tick very fast and uses a lot of cpu, so are you (you can NOT sleep in the tester so are using all the cpu) so everything is getting scrambled.

Do NOT loop, return and count the next tick.



Sorry what? :) What do you mean count the next tick? And no, no sleep in this, I know it doesnt work, that's why I don't know what to do :)

So I should return the tick normally, and ..?

 

Ok I just tried it without any looping between ticks, so simply dummy EA with empty start function. Time hopping still occurs though there's no chopiness and almost no cpu load.

EDIT: time hopping occurs every time in exactly the same places. F2 History has those bars' info, so it shouldnt be doing that.

 

Are you using visual on m1 bars? If yes,

Are you expecting price to move up and down on m1 bars? If yes,

I'm sorry but your use of Tick in Visual-Tester confuses me :)

There's NO such thing as Tick in VT. Only M1 open-high-low-close.

Are you expecting VT to stall on closing M1 price in VT before the new bar?

 

No. If I understand the working of VT correctly, it works with M1 bars (if you use the "most precise" method).

I thought that this means that it takes M1 data and simulates ticks based on OHLC data, starts with open, checks where close is compared to open, and goes in the opposite direction first to grab either high or low, then grabs the other of the high/low pair and finally close. I thought that ticks were generated between these steps.

Dont know where I got this idea :P as it probably is totally wrong, but anyway.

I'm using M15 chart, but that doesnt matter as long as it's more than M1. But the higher the TF, the better for nice performance.

Even if it's only using OHLC, I should not be seeing hops in time, first it takes the VT 5 seconds to show the movement of 1 minute of the first M15 bar, then it hops to the end of the next bar, and again to the end of the third bar. Then it takes it again 15 seconds to finish 1 whole minute of fourth M15 bar. Sometimes VT is feeling well and i get up to 6 consecutive minutes of a single M15 bar nicely modelled, then afterwards, it goes wild again.

I'm using TimeCurrent to check the VT's time progress.

 
forexCoder:

I thought that this means that it takes M1 data and simulates ticks based on OHLC data, starts with open, checks where close is compared to open, and goes in the opposite direction first to grab either high or low, then grabs the other of the high/low pair and finally close. I thought that ticks were generated between these steps.

You are right, algorithm should be simpler version of MT5's. https://www.mql5.com/en/articles/75 which could be exploited.

@fC: unfortunately i have no issues of hopping in visual mode, as long i don't try to move or resize the terminal

 
Ah yeah, I read that article sometime ago :))) Seems I wasn't paying 100% attention :I else I'd know where I got idea from.