I am using analysis window, and I want to understand the data given in the report and want to optimize my code based on that understanding. Apparently, the report is clear but if I get more details on what's going inside/who is taking using time resource and how and why?
If possible please cover all item from it. Thanks.
This is covered in the Knowledge Base article here:
From your example picture, out of 34.83 seconds took by exploration, 20.42 seconds is spent accessing data (reading the data or getting the data from the plugin). The rest is consumed by AFL execution. It took 120 seconds of (parallel) time to execute AFL but it was done IN PARALLEL (in at least 8 threads, guessing from timing) so it took only (approx 120/8) 14.41 seconds of "real world" time.
Unfortunately you did not say a word about a DATA SOURCE that you are using and the FORMULA you are using and the CPU you are using. Please follow this advice: How to ask a good question
Thanks Tomasz, I have got enough material from your links. I will study them first and then revert back to this post. And I was asking for general information that's why I didn't share machine/environment specific details.
Still there is one thing that I would like to highlight here:
Realtime data(I have used "globaldatafeed" and "truedata" from India) that use data-plugin, do not refresh data of inactive symbols, that's why even if the formula is just needed to run in single symbol and data from other symbol is fetched with 'foreign' call, we are forced to run it on all symbol whose real-time data are required with "wait for backfill" this takes most of the time resources. If data could be fetched without running analysis with "wait for backfill" option, then this would take very very less time in the order of 100 to 10000x improvement.
And we have no provision for asking for other symbol backfill with 'foreign' call in afl as per my knowledge (Please confirm if I am wrong)
In short if I have a symbol, it should have updated data even if I am not asking for it because that is what we expect when we call 'foreign', we can provide this optional, for considering other scenarios.
Thanks for the reply.
those data vendors are having many limitations. Most Brokers now provide websocket realtime data and APIs.
Normally you don't need "wait for backfill". It is meant to be used for initial backfill only, when you don't have any history already in the database.
Normally, data should be subscribed at first access and then they should stream real-time all the time, they should be current all the time and there should be no need for any wait.
If 3rd party plugins that you use don't do that - it is plugin problem, not AmiBroker.
It does not matter if you use Foreign or other way. There is absolutely ZERO difference in access speed with regards of what function caused access. Data request is a request. No matter if it was caused by chart, analysis, foreign or whatever else. Plugins should deliver data immediately. That is plugin responsibility.
Plugins should follow guidelines presented in the ADK docs. Complain to 3rd party data vendors. They should fix their stuff. They are responsible for their products.
Go to Gitlab and see the docs
especially part 3.4.1:
3.4.1 Recommended way of implementing interactions between AmiBroker and real-time data plugin
Data vendors should read that and follow.
@Tomasz Thanks for reply and confirming, that it is implementation specific problem with data plugin/vendors. I will dig more with them if they wish to update their system.
I think with this reply I have got all expected. Thanks.
Yes that is the better way. But broker API need a development and integration with Amibroker, that is not suitable for all users. Only very few broker provide direct integration with Amibroker.
One of the things I had requested was for a Websocket plugin, hopefully if enough people need it then it would make progress.
Such a plugin will be a good one. Not sure whether the amipy plugin can be used to stream websocket data from brokers API to amibroker through Python, since most of the Indian brokers provide API interface through python. If such a plugin /method through python is available it will be nice.
you can show support here
Request for Generic Websocket Data Plugin - Plug-ins - AmiBroker Community Forum