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

[amibroker] Basisc - Array vs Loop Processing



PureBytes Links

Trading Reference Links



Hi,

just make my first steps in AFL, to get a "Debugging" functionality I try to put a shape on a chart if a condition is met. (Software development is givin`.

target: if "GAP DOWN" appears show a shape.

 "ARRAY"-Version

it_gap     = GapDown();

PlotShapes( IIf( it_gap,  shapeDownTriangle , shapeNone ), colorRed );
PlotShapes( IIf( GapUp(),  shapeUpTriangle , shapeNone ), colorGreen);

does function !!!! :)

 "LOOP"-Version:

it_gap     = GapDown();
for( i = 1; i < BarCount; i++ )
{

   if( it_gap[i] == True )
   {
     PlotShapes(   shapeUpTriangle , colorGreen );
    }
    else
    {
      PlotShapes(   shapeNone , colorRed );
    }
}


->result is .... on every single bar a shape is drawn.

here is how I think the "LOOP-Version" is function ...

1) the array it_gap is filled via function "GAP_DOWN()"

    in it_gap is for every bar that has a gap the "number" 1.

2) FOR loop
         
     doesn`T work ... I thought in the For loop I look at every single day. if it is true (1) a green shape should appear,
    otherwise no shape will be drawn  ..



thx for your reply schnitt ...

__._,_.___


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





Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___