Hello, Thanks for your comments.
Yes I saw an improvement in times, but in my case of taking the average of the foreign's and plotting on 3 other charts I have slightly different looking moving averages! Probably due to the 3 charts being on a slightly different time frame. Improvement around 20% to 25%. JG -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Steve Dugas Sent: Wednesday, December 02, 2009 9:32 PM To: [email protected] Subject: Re: [amibroker] Is there a faster way of writing this AFL? Hi - Don't know if this will help you much unless you are plotting the same foreign tickers many times, but for those who optimize here is a good tip - I have some systems that use a lot of market internals which my code called using Foreign(). I could see in the profiler that all the calls to Foreign() accounted for a lot of time, so following a thought that someone posted here a while back I wrote a seperate little code just to call the foreign tickers and plotted it as a chart. Not much to see, it just calls the foreign tickers and saves them to memory using StaticVarSet(). I can turn it on/off in the params and the title changes to "Success" in green to let me know whether the static vars are on or off 8 - ) Then in my system code I replaced all the Foreigns with StaticVarGet(), and just like that the new code ran 25% faster. And actually I realized a productivity increase of 50% from it, because the code took 2+ days to run and it always finished in the middle of the night and the computer would sit there doing nothing for hours while I was sleeping - I could only run it every 3 days ( 10 times a month ). Now the new code finishes in 2 days and I can crank up another opt right away so I can run 15 in a month instead of 10 - a very nice improvement, and thanks very much to whoever mentioned it! ----- Original Message ----- From: "potatosoupz" <[email protected]> To: <[email protected]> Sent: Wednesday, December 02, 2009 11:29 PM Subject: [amibroker] Is there a faster way of writing this AFL? > Plot(Foreign("ZZZZ", "Close")/Foreign(XYZ", "Close"), "ZZZZ/ZYX Ratio", > colorGreen); > > I have a few of these and they seem to be slowing down the whole app. Is > that possible? > > > > ------------------------------------ > > **** 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
