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

[amibroker] Re: Speeding up code ???



PureBytes Links

Trading Reference Links

Thanks for the input. I'll start working on the cleanup.
Your last comment about doing all this in an Exploration. Well not nearly as cool as dual heatmaps linked to a sector/ industry indicator linked to a relative strength indicator, with index and composite plots, of the list (any list) keyed off a signal pane of inputs :-) all symbol linked together.
Is that what you meant by doing to much with indicators :-)
I've uploaded an image to the Files section called - HeatMaps_RelStr.jpg
Thanks again for all the help.


--- In amibroker@xxxxxxxxxxxxxxx, Tomasz Janeczko <groups@xxx> wrote:
>
> Hello,
> 
> What is posted in the files section is incomplete - it uses several
> #includes and none of the files are there.
> 
> Also the code looks overly complicated and it abuses many things.
> It should be written again from scratch.
> 
> Any kind of symbol by symbol matrix should be generated as EXPLORATION
> not indicator.
> This is so because exploration is done one demand (not with every
> refresh) and it has
> ability to iterate through symbols while displaying progress bar
> and processing windows messages between symbols making
> way more responsive.
> 
> Also the code uses JScript to change the symbol for chart being
> actually executed - a big no-no.
> 
> Entire code should be totally re-written using Exploration mode.
> 
> Third thing is that the code uses Status("Action") to execute
> parts of the code only when used in indicator, therefore
> you won't have this part profiled using Tools->Code Check And Profile
> because code check is not run with Action == 1.
> 
> 
> Generally speaking I see people largely abusing indicators
> for things that should be done in AA window (mainly exploration).
> 
> An example correlation heat map formula looks as follows.
> Note that it is just 6 lines.
> 
> /*This is the formula to create a correlation matrix in AB.
> It is set up to run the correlation of the symbols in Watchlist 2
> with the "define" filter catagory in the auto-analyser. In this
> default case
> this code will correlate the symbols in watchlist 2 with the symbols
> in watchlist 2.
> - Tools -> Send to Analysis
> - press FILTER button and select Watchlist 2 in INCLUDE tab
> - press EXPLORE button in AA window.*/
> 
> symlist = CategoryGetSymbols( categoryWatchlist, 2 );
> Filter = Status("lastbarinrange");
> for( i = 0; ( sym = StrExtract( symlist, i ) ) != ""; i++ )
> {
>   Corr = Correlation( C, Foreign( sym, "C" ), 252 );
>   Clr = 32 + SelectedValue( Corr ) * 32;
>   AddColumn( Corr, sym, 1.2, ColorHSB( 128+Clr, 255, 255 ) ,
> ColorHSB(Clr, 255, 255 ) );
> }
> 
> 
> Best regards,
> Tomasz Janeczko
> amibroker.com
> 
> gmorlosky wrote:
> > Thanks TJ - I have uploaded the file to the Files section as HeatMap.afl 
> > HeatMap v1.1a
> > I actually use 3 of these heatmap indicators at once in a single window with different scoreing selected. So anything to speed things up would help.
> >
> >
> > --- In amibroker@xxxxxxxxxxxxxxx, Tomasz Janeczko <groups@> wrote:
> >   
> >> Hello,
> >>
> >> Sorry, but I can't see any formula attached to your e-mail. Please send
> >> the formula you are using,
> >> then we could discuss the details.
> >>
> >> Best regards,
> >> Tomasz Janeczko
> >> amibroker.com
> >>
> >>
> >> gmorlosky wrote:
> >>     
> >>> Thanks - So I am really doing 123 * 123 in the orginal example... How do I speed that up ?
> >>>
> >>> Yes - the example was a partial list as I left off some of the "lesser" functions, but I have included all below (119 symbols).
> >>>
> >>>  Function name      Call Count      Total Time[ms]  Time per Call [ms]
> >>>  StrExtract         120             0.530           0.004
> >>>  CategoryGetSymbols   1             0.125           0.125
> >>>  GetCategorySymbols   1             0.107           0.107
> >>>  Param                6             0.038           0.006
> >>>  paramcategory        1             0.034           0.034
> >>>  ParamList            4             0.031           0.008
> >>>  ParamToggle          4             0.031           0.008
> >>>  NumToStr             1             0.030           0.030
> >>>  StaticVarGet         3             0.019           0.006
> >>>  array operator -     1             0.015           0.015
> >>>  paramlistnum         1             0.014           0.014
> >>>  ParamTrigger         2             0.010           0.005
> >>>  _SECTION_BEGIN       1             0.008           0.008
> >>>  Status               1             0.005           0.005
> >>>  IIf                  2             0.003           0.002
> >>>  StrLen               1             0.002           0.002
> >>>  _SECTION_END         1             0.002           0.002
> >>>  EnableScript         1             0.002           0.002
> >>>  StrFind              1             0.002           0.002
> >>>  EnableTextOutput     1             0.001           0.001
> >>>  GetChartID           1             0.000           0.000
> >>>
> >>>
> >>>
> >>>
> >>> --- In amibroker@xxxxxxxxxxxxxxx, Tomasz Janeczko <groups@> wrote:
> >>>   
> >>>       
> >>>> The list looks incomplete.  Your formula probably uses
> >>>> 123 * 123 (=15129) calls to Foreign function to generate heat map /
> >>>> correlation for 123 symbols. That's
> >>>> where it apparently spends most time.
> >>>>
> >>>> gmorlosky wrote:
> >>>>     
> >>>>         
> >>>>> Explain something to me. This particular indicator code (HeatMap of 123 symbols)runs like a dog (5 seconds or more to complete. I have no plugins or scripting. The details of each function are below. Is it the StrExtract and/or the *Symbols, that needs to be sped up ? and how ?
> >>>>>
> >>>>> Function name Call Count Total Time [ms] Time per Call [ms]
> >>>>> StrExtract         123   0.563           0.005
> >>>>> CategoryGetSymbols   1   0.403           0.403
> >>>>> GetCategorySymbols   1   0.285           0.285
> >>>>> Param                6   0.038           0.006
> >>>>> ParamList            4   0.035           0.009
> >>>>> Paramcategory        1   0.033           0.033
> >>>>> ParamToggle          4   0.032           0.008
> >>>>> NumToStr             1   0.030           0.030
> >>>>> AddColumn            1   0.023           0.023
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>>> ------------------------------------
> >>>>>
> >>>>> **** 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
> >
> >
> >
> >
> >
>




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

**** 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/