Which instruments to trade at Otkritie - page 9

 
Anton Zverev:

I need to write a function that would return ticks from one date to the next. If successful, it would be true, otherwise it would be false.

And I can't manage to write such a nonsense. Because I don't know what to do with asynchrony. Renat's example through OnTimer is probably an option. But definitely not the way he cited. OnTimer can be used for a lot of things.

In short, an elementary date-to-date function can be brought in to make it work.

The tick volumes of the bars are completely inconsistent with what sits in the copyticks, so it's not clear how many ticks to query.

The script asks for data from a certain date.

Here is the result of two runs of the script at intervals of a few minutes:

2016.04.22 11:32:38.538 CopyTicks_1_02 (RTS-6.16,H3)    Получено тиков: 409 код ошибки: 0
2016.04.22 11:32:38.538 CopyTicks_1_02 (RTS-6.16,H3)    Тик: 2016.04.22 11:30:00 bid: 92480.0 ask: 92540.0 last: 92520.0 [0]
2016.04.22 11:32:38.538 CopyTicks_1_02 (RTS-6.16,H3)    Тик: 2016.04.22 11:32:38 bid: 92380.0 ask: 92390.0 last: 92380.0 [408]
2016.04.22 11:32:38.538 CopyTicks_1_02 (RTS-6.16,H3)    Size 0 Mb
2016.04.22 11:34:26.502 CopyTicks_1_02 (RTS-6.16,H3)    Получено тиков: 632 код ошибки: 0
2016.04.22 11:34:26.502 CopyTicks_1_02 (RTS-6.16,H3)    Тик: 2016.04.22 11:30:00 bid: 92480.0 ask: 92540.0 last: 92520.0 [0]
2016.04.22 11:34:26.502 CopyTicks_1_02 (RTS-6.16,H3)    Тик: 2016.04.22 11:34:26 bid: 92410.0 ask: 92440.0 last: 92420.0 [631]
2016.04.22 11:34:26.502 CopyTicks_1_02 (RTS-6.16,H3)    Size 0 Mb

That is, the ticks are requested from a certain date to the current moment.

Files:
 
Karputov Vladimir:

The script asks for data from a certain date.

This is the result of two runs of the script at intervals of a few minutes:

That is, the ticks are requested from a certain date to the current moment.

I don't understand why you cite code that is inferior even to the documentation in terms of information. Thank you, of course. But that's not at all what I asked for.

Renate's code is much better, but it's not the same at all.

 
Renat Fatkhullin:

No, all previously downloaded ticks for each trade server are cached locally and extracted automatically.

There's a screenshot of the tick files on the previous page.

Thanks, I haven't studied the Bases folder in detail.

How can I request copyticks in OnTester to get all ticks that have been passed?

 
Anton Zverev:
How can we query copyticks in OnTester to get all the ticks that have been passed?

In the current beta (today's release), call CopyTicks and get the last tens of thousands of ticks.

The tester uses a ring buffer to store ticks without the ability to get millions of ticks. It's costly to store all the ticks, hence the ring buffer. Maybe we can change this behavior though.

 
Anton Zverev:

I don't understand why you cite code that is less informative than even the documentation. Thank you, of course. But that's not at all what I asked.

Renate's code is much better, but not at all.

My code is just for demonstration of principle "to get very deep ticks you should call CopyTicks several times to wait for paging". OnTimer is good for that.
 
Renat Fatkhullin:

In the current beta (today's release), call CopyTicks and get the last tens of thousands of ticks.

The tester uses a ring buffer to store ticks without the ability to get millions of ticks. It's costly to store all the ticks, hence the ring buffer. We can change this behaviour though.

How to determine the size of the ring buffer without having to query on every tick (very costly to do it in the tester) copyticks?

Let's say the ring buffer is 10000. Then I'll call copyticks every 10000 to make sure there's no skips. But there appears a problem in the form of ticks with one time (with accuracy to msec). I have them on the exchange. I do not want to count them twice, requesting copyticks from this time in ms.

 
Renat Fatkhullin:
My code is just to demonstrate the principle "to get very deep ticks you have to call CopyTicks several times to wait for paging". OnTimer suits well for it.

I realised that it was for demonstration purposes. That's why OnCopyTicks immediately came to mind.

Help with this, I'm having trouble with one or the other.

Anton Zverev:

I need to write a function that would return ticks from one date to another. If successful it would be true, otherwise it would be false.

 
Anton Zverev:

I don't understand why you give code that is less informative than even the documentation. Thank you, of course. But that's not at all what I asked.

Renate's code is much better, but it's not the same at all.

If you need to get from (old date) to (young date), you need it like this:

Query ticks (with a margin) from "old date". In received array go from index "0" and check date. As soon as you find the first occurrence (young date), you memorize it (index young date). At this point, you have determined that the array of ticks from index 0 to (index young date) contains the ticks you want.

 
It would be nice to add a function to check the status of ticks uploaded/injected - in the local terminal database. Something like CheckXXX( symbol ). So that you don't have to keep pulling the copier all the time.
 
Karputov Vladimir:

If you want to get from (old date) to (young date), do the following:

Query ticks(with a margin) from "old date". In the received array go from index "0" and check the date. As soon as you find the first occurrence (young date), you memorize it (index young date). At this point you have determined that the array of ticks from index 0 to (index young date) contains the ticks you want.

With a margin, it's a waste. I make default request (2000 ticks, I think), and continue from the point (it's easy to get duplicated ticks), where I finished.

I do not understand why there is no such a function from the developers themselves. Why not overload copyticks with another working option?