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

[amibroker] Exploration AFL is causing AB to throw and exception



PureBytes Links

Trading Reference Links

I am trying to create an exploration which allows me to pick out stocks
that meet a number of conditions over a customizable time interval.
Here's my approach:

1) Double Click in Chart to set begin and end markers.
2) Open Automatic Exploration window
3) Set Range to last n bars, with n=1
4) Pick Exploration AFL (shown below)
5) Click on Explore.

Unfortunately, I keep having AB throw an exception and ask me if I want
to submit a bug report.  I have done so, but I also thought it worth
asking the experienced AFL coders on this list what they may see that I
am doing wrong.  Here's my AFL script:

---- Script begins after this line -----
/*
 * Scan for stocks in an Interval that have:
 *
 *  - a higher Close at the end of the interval than at the beginning of
 *    the interval
 *  - a price higher than 2 
 *  - a volume higher than 100,000 (based on bar at the beginning of the
 *    interval)
 *
 * NOTE:  YOU MUST SET THE BEGIN AND END MARKERS ON THE CHART BEFORE
 *        RUNNING THIS EXPLORATION.
 */

Ci = BeginValue(C);
Cf = EndValue(C);
Vi = BeginValue(V);

if (Ci != 0) {
   Pct_Change = 100.0 * ( Ci - Cf )/ Ci;

   C1 = Pct_Change > 0.5;
   C2 = Ci > 2 AND Cf > 2;
   C3 = Vi > 100000;
}
else{
   C1 = 0;
   C2 = 0;
   C3 = 0;
}

Filter = C1 AND C2 AND C3;

if( Filter != 0 )
{
  AddColumn( C, "Close" );
  AddColumn( Pct_Change, "Pct Change" );
  AddColumn( V, "Volume" );
}
---- Script ends above this line -------

Some of the conditional logic is in the code as an attempt to get around
the problem I am running into.   Can anybody see what's causing the
exception?

Kind regards,
                                       Nick

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
                   Help fight the war against Spam;
       Erase all addresses before forwarding any item of email.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Transfer from your equities account.  
Receive up to $1,000 from GFT. Click here to learn more.
http://us.click.yahoo.com/aZttyC/X_xQAA/cosFAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Please note that this group is for discussion between users only.

To get 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/