[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [amibroker] Per Chart Refresh Rates



PureBytes Links

Trading Reference Links

Yofa,

Good thoughts.  This is similar to something I had requested before,  
but I worded mine in a more clumsy way, not understanding Windows  
internals.  I wanted to be able to keep the old chart painted, even  
though I was running more passes at a higher speed than the chart  
refreshed (I also wanted faster timed refresh rate for when no quotes  
were coming in).  That way I could do high speed and low speed  
processing in the same chart.  Essentially, if I did not issue a plot  
command, then I wanted the old chart to remain untouched on the  
current AFL pass.

The thing that would really make my day though is if the Gfx layer was  
independent (like an overlaid window), so that Gfx commands would plot  
while leaving the normal AFL plot commands in the current chart  
layer.  That way a responsive Gfx UI could be built on top of the  
charts that ran slower. I would even be willing to run the AFL as if  
it were two charts (like two panes) on top of each other (Gfx on top).

However, even though I would not touch Vista with a ten foot pole, I  
could easily consider a Windows 7 upgrade if it cleans up all the  
Vista problems and makes it easier for Tomasz to bring better  
functionality to AB.

  It seems there are many different ways to approach this problem and  
related ideas.  Tomasz certainly has his job cut out to weigh all the  
possibilities.

BR,
Dennis

On Jul 12, 2009, at 3:47 PM, Yofa wrote:

> Hi Thomas,
>
>> Tomasz wrote in the "Data And PlugIn Speed" thread
>> I may add that the concept of independent rendering from multiple  
>> threads
>> although attractive from first look, it inevitably hits the wall of  
>> GDI
>> which in all current versions of Windows has
>> single system-wide exclusive global lock, which means that only ONE  
>> thread
>> can actually render at one time. This means that adding threads  
>> does not
>> give you better performance.
>
>> The truth is that all current releases of Windows are not  
>> particularly
>> suited for multi-core/multi-CPU
>> but good news is that Microsoft apparently have given these  
>> limitations
>> some thought and
>> many of them are removed in Windows 7.
>
> That is true for rendering only! (Apps main thread is allowed to  
> write the
> GDI device. So rendering is limited to a single thread.)
>
> But indicator calculation (and trading logic) could get executed by  
> any
> threads. Am I right? So doing the calculation on a background thread  
> than
> doing chart painting with the "main" thread would increase processor  
> usage
> and increase chart refresh reate? (I guess we all have dual and quad  
> core
> CPUs...)
>
> How about separating "calculation refresh rate" and "chart refresh  
> rate"? So
> I could request my panel to execute 3 times per sec without chart  
> repaint
> (this could be executed by any threads) and refresh visible chart in  
> every
> 3rd sec (this requires rendering, so calculation is done by a  
> background
> thread, and painting is done by main thread))?
>
> Any thoughts?
>
> Regards,
>
> Y
>
> (I know it is not doable in a day work, but I guess all short
> term/daytraders are having trouble bacause of refresh limitations.)
>
>
> --------------------------------------------------
> From: "Julian" <juliangoodsell@xxxxxxxxxxxx>
> Sent: Sunday, July 12, 2009 8:14 PM
> To: <amibroker@xxxxxxxxxxxxxxx>
> Subject: [amibroker] Per Chart Refresh Rates
>
>> Hi Tomasz, I thought I'd start a new thread on this topic as I  
>> think it's
>> an interesting one.
>>
>> Tomasz wrote in the "Data And PlugIn Speed" thread
>>> I may add that the concept of independent rendering from multiple  
>>> threads
>>> although attractive from first look, it inevitably hits the wall  
>>> of GDI
>>> which in all current versions of Windows has
>> single system-wide exclusive global lock, which means that only ONE  
>> thread
>> can actually render at one time. This means that adding threads  
>> does not
>> give you better performance.
>>
>> In response to that Tomasz,
>> you're referring to performance on the basis of multiple charts being
>> rendered per refresh update.
>> E.g. If you have ten charts on screen, and they take a total of 2  
>> seconds
>> to render, then there's little performance gain to be had by  
>> threading
>> them because of the GDI lock. That is fine and I get that.
>>
>> But what I'm referring to is the ability to control which charts  
>> render
>> when, so that all ten don't have to be updated every refresh.
>> The problem is that in real time mode with the refresh interval set  
>> to 0
>> in the preferences, if I have a tick chart that only takes 10ms to  
>> update,
>> it's still only going to be rendered every 2 seconds because that's  
>> how
>> long the other nine charts take to render, even though I don't need  
>> them
>> to be updated multiple times per second, but maybe only once every 5
>> seconds or even every minute.
>>
>> If we could set refresh rates per chart, then you could have time  
>> critical
>> tick charts update as fast as possible, and longer timeframe or  
>> more time
>> expensive/less critical charts only update every 5 seconds or even  
>> longer.
>>
>> By staggering chart updates, traders would have much greater  
>> control over
>> performance and not waste so much processing power updating charts  
>> that
>> don't need to be. This would trounce any other kind of performance
>> improvement that could be gained by optimizing the rendering engine
>> itself, and would require no threading or any real change to the  
>> current
>> architecture that I can see.
>>
>> Moreover, it appears this functionality is already in AB, but just  
>> that
>> there's no way for the user to control it.
>> The requestTimedRefresh() function enables you to update only the  
>> chart it
>> is applied to, so they can obviously be rendered independently of  
>> each
>> other.
>>
>> The problem though is that it is not enforceable. If I specify a  
>> refresh
>> interval of 1 in the preferences, and then requestTimedRefresh(10)  
>> on a
>> chart, that chart still gets updated every second along with all the
>> others, and then once more after ten seconds.
>>
>> Giving the option to make requestTimedRefresh() enforceable would  
>> be one
>> way of enabling this functionality. Perhaps add an enforceable  
>> parameter
>> to the function like:
>> requestTimedRefresh(10, onlyvisible=True, enforceable=false).
>> Then if I specify requestTimedRefresh(10, true, true), that chart  
>> should
>> only update every 10 seconds, irrespective of what I've set in the
>> preferences.
>>
>> Would this be as easy to implement as I think it is? If so, I think  
>> the
>> benefits would be rather large.
>>
>> Jules.
>>
>>
>>
>> ------------------------------------
>>
>> **** IMPORTANT PLEASE READ ****
>> This group is for the discussion between users only.
>> This is *NOT* technical support channel.
>>
>> TO GET TECHNICAL SUPPORT send an e-mail directly to
>> SUPPORT {at} amibroker.com
>>
>> TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
>> http://www.amibroker.com/feedback/
>> (submissions sent via other channels won't be considered)
>>
>> For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
>> http://www.amibroker.com/devlog/
>>
>> Yahoo! Groups Links
>>
>>
>>
>>
>
>
> ------------------------------------
>
> **** IMPORTANT PLEASE READ ****
> This group is for the discussion between users only.
> This is *NOT* technical support channel.
>
> TO GET TECHNICAL SUPPORT send an e-mail directly to
> SUPPORT {at} amibroker.com
>
> TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
> http://www.amibroker.com/feedback/
> (submissions sent via other channels won't be considered)
>
> For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
> http://www.amibroker.com/devlog/
>
> Yahoo! Groups Links
>
>
>



------------------------------------

**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to 
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/