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

Re: [amibroker] Calculating statistical occurrences



PureBytes Links

Trading Reference Links

Hi, try this:

- paste the AFL code below into the Automatic Analysis window
- select your stock (fe. DROOY)
- select "Apply to current stock"
- select "Range: all quotiations"
- click Explore 
- doubleclick on one of the result lines 

This will mark these days where the condition was met
with a green or red arrow on the main chart (but only if doubleclicked)
and in the table a counter will be given.... 
UM

/***** code starts here *****/
Diff    = 0.20;    // set your own value

CountL  = 0;
CountH  = 0;

prevC   = Ref(C, -1);
FilterL = L <= (prevC - Diff);
FilterH = H >= (prevC + Diff);
      
CountL = CountL + FilterL;
CountH = CountH + FilterH;

Buy  = FilterL;
Sell = FilterH;
Filter = Buy or Sell;

AddColumn(cum(CountL),  "LCounter", 1.0);
AddColumn(cum(CountH),  "HCounter", 1.0);
AddColumn(cum(CountL) + cum(CountH),  "Sum", 1.0);
/***** code ends here *****/


----- Original Message ----- 
From: "epintoem" <epintoem@xxxxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Thursday, April 10, 2003 5:28 PM
Subject: [amibroker] Calculating statistical occurrences


> How would I go about Calculating the number of times a certain event
> happens with regard to a security.
> 
> the problem in this case is as follows:
> 
> In a security...I would like to determine how many times in its
> lifetime dit the next days high or low come to within say 20 cents of
> the previous days close. and mark that position on the chart.
> 
> TIA





------------------------ Yahoo! Groups Sponsor ---------------------~-->
FREE Cell Phones with up to $400 Cash Back!
http://us.click.yahoo.com/_bBUKB/vYxFAA/i5gGAA/GHeqlB/TM
---------------------------------------------------------------------~->

Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/