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

[amibroker] How to Draw a Chart Just Once?


  • Date: Wed, 09 Dec 2009 13:43:59 -0000
  • From: "progster01" <progster@xxxxxxxxxxxxxxxxxx>
  • Subject: [amibroker] How to Draw a Chart Just Once?

PureBytes Links

Trading Reference Links

Hi.

I'm working a new-to-me corner of the AB universe lately, and I'm having an issue that I don't yet know a solution for.  Perhaps someone else has been here before and can point me in the right direction.

I've created a complex chart that requires alot of CPU to calculate and draw.

Using _TRACE() I can see that the chart code is executing approximately once per second.  The effect of this is to tie up the CPU.

The nature of this chart is such that I only need to draw it once and I am not interested in updating it a) on every tick, or b) every second.

IOW, I'd basically be satisfied to draw this chart once when I apply the AFL to the pane.  (Secondarily, I might want to add a manual refresh button, but that's beside the point at the moment.)

I have tried to put the entire code in a Status() condition like so:

RequestTimedRefresh( 20, onlyvisible = True ) ;		//	trying to reduce CPU load, but this does not stop the "regular" refresh

RAS = Status( "redrawaction" ) ; // 1 if a timed refresh, else 0
if( RAS == 1 ){
   <Complex code here>
}

The goal here is to prevent any "automatic" refreshes, and allow me to specify a (much less frequent) TimedRefresh.

What I observe to happen in this case is that the chart paints (quickly) at the TimedRefresh frequency, then disappears (goes blank, to the background color) until the next TimedRefresh.

So, I'm currently stuck at either seeing the chart and paying the price for constant refreshes, or having a flashing/disappearing chart which is useless (but cheap!).

Thus the question, in a nutshell:

   How to Draw a Chart Just Once?

(and not have it disappear on you).

Thanks to anyone who can shed some light on this for me!






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

**** 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:
    amibroker-digest@xxxxxxxxxxxxxxx 
    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/