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

RE: [amibroker] Re: Neural Netowrks in AmiBroker



PureBytes Links

Trading Reference Links

Bruiser,

I'm not sure of you familiarity with AFL so I'll go through it step by
step following the spec, this way it might help other to spot errors.

If we are simply writing a filter for the setup day then we won't include
the requiements for the trading day itself.

Condition 1
> To begin, I only take this trade, tomorrow, if today is Monday,
> Thursday or Friday. Those are my set up days as many notable rallies
> have taken place the next day.

Here we test to see if the testing day is either a Monday, Thursday or
Friday. Using the DayOfWeek() function it is possible to test for this.
( Monday = 1, Thursday = 4 and Friday = 5 )
http://www.amibroker.com/guide/afl/afl_view.php?name=DAYOFWEEK

Formula:
SetUpDays = DayOfWeek() == 1 OR DayOfWeek() == 4 OR DayOfWeek() == 5;


Condition 2
> The pattern is simply an inside day (one that has a lower high and
> higher low than the prior day), the direction of the close of the
> inside day does not matter.

Here we are testing for an inside day. AmiBroker provides a function
to do this, it is simply called:

InSide()

Condition 3
> But, I do want the close of the day before the inside day to close
> higher than the opening of that same day.

We test whether the close price of the previous day is greater
than the open price of the previous day.

Formula:
Ref( C, -1 ) > Ref( O, -1 )


Combine all three conditions and you get the following formula, which
is the setup day:

SetUpDays = DayOfWeek() == 1 OR DayOfWeek() == 4 OR DayOfWeek() == 5;
Filter  = SetUpDays AND Inside() AND Ref( C, -1 ) > Ref( O, -1 );
AddColumn( Close, "Close  " );

(The following day you will need to check for the final conditions.
These conditions *can* be coded into the exploration.)


Regards,
William Peters
www.amitools.com




Friday, September 3, 2004, 2:27:57 AM, you wrote:

b> Thanks William...but its not quite right.
b> Larry gives a few examples of actual trades and one happened on 
b> 04/17/01 where the S&P went up 400 Pt's

b> I ran your code over the month of April 2001 and it came up with
b> the 6th & 20th rather than the 16th.

b> other examples: 07/14/98      06/3/97      05/12/97     10/19/92


b> Thanks once again William.

b> Cheers Bruiser



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

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