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

[amibroker] how to improve loop speed



PureBytes Links

Trading Reference Links


Hi

I am curious to find out how to make a loop to run from firstvisiblebar


I think I need to write something like the following ? but I don?t know how


lvb = Status("lastvisiblebar");

fvb = Status("firstvisiblebar");


for( i = 0; i < ??? ; i++ )

{


I have an example here that executes very slowly in live intra day chart

Can you tell me please how I can correct this example ?


Q=Param( "% Change",1.50,.25,14 ,0.25);

Z= Zig(C,q ) ;

HH=((Z<Ref(Z,- 1) AND Ref(Z,-1) >

  Ref(Z,-2)) AND (Peak(z,q,1 )

 >Peak(Z,q,2 )));

LL=((Z>Ref(Z,- 1) AND Ref(Z,-1) < Ref(Z,-2)) AND (Trough(Z,q,1 )

<Trough(Z,q,2 )));


dist = 0.5*ATR (20);


for( i = 0; i < BarCount; i++ )

{

if( HH [i]) PlotText( "HH"+ "\n"+H[ i ], i, H[ i

]+dist[i], colorGreen );

if( LL [i] ) PlotText( ""+L[ i ]+"\nLL", i, L[ i

]-dist[i], colorRed );

}


Plot(C,"",IIf(C>O,colorGreen,colorRed),styleCandle);


Thank you

Panos





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

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

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

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

For other support material please check also:
http://www.amibroker.com/support.html

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