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

[amibroker] Re: Not sure how to create a trigger



PureBytes Links

Trading Reference Links

Hi Guys,
Many thanks for your replies.

I guess where I was looking was in the wrong spot.

I has assumed that you could create a system in AFL for the purpose 
of baktesting that would scan from day one looking for an event, like 
oversold condition on an indicator - ie RSI < 30.

Once this 1st event occurred then it would look for a second event. 
Like a loop where the system doesn't even know of the second event 
until it has found the first one.

Once event 1, and then event 2 takes place, a trade is made. When the 
trade finally ends at some exit event, the system goes back to the 
start again looking for event 1 (RSI < 30) from the day after the 
last trade was exited.

in other words the trade itself is not dependant on event 1, only 
event 2, but event 2 IS dependant on event 1 occuring

Are what you all suggesting going to do this?

Many thanks


--- In amibroker@xxxxxxxxxxxxxxx, "Mike" <sfclimbers@xxx> wrote:
>
> Graham,
> 
> Nicely done. My post would have been better had it 
> suggested "...within some predefined period OR since some 
meaningful 
> event". You captured that perfectly with your code suggestion.
> 
> Mike
> 
> --- In amibroker@xxxxxxxxxxxxxxx, Graham <kavemanperth@> wrote:
> >
> > try this, assuming interpretation of your description is correct
> > 
> > MA5 = MA( C, 5 );
> > MA10 = MA( C, 10 );
> > Buy = Cross( MA5, MA10 ) AND LowsetSince( Cross( MA10, MA5 ),  RSI
> (14) ) < 30;
> > 
> > 
> > -- 
> > Cheers
> > Graham Kav
> > AFL Writing Service
> > http://www.aflwriting.com
> > 
> > 
> > 2008/7/9 Mike <sfclimbers@>:
> > > Also,
> > >
> > > you may want to rethink your logic to be more restrictive. Just
> > > looking to see if the RSI was less than 30 *ever* is not going 
to 
> be
> > > very usefull. You might want to adjust your strategy for 
trigger1 
> to
> > > be RSI < 30 within some predefined time period (e.g. within 
last 
> 20
> > > bars) giving the following:
> > >
> > > Buy = BarsSince(RSI(14) < 30) < 20
> > > AND Cross(MA(Close, 5), MA(Close, 10));
> > >
> > > If you specifically wanted to measure from the point that the 
RSI
> > > *first crossed* below 30 (as opposed to the most recent day at 
> which
> > > it was *still* below 30), you would use Cross in the first 
> expression
> > > too:
> > >
> > > Buy = BarsSince(Cross(30, RSI(14))) < 20
> > > AND Cross(MA(Close, 5), MA(Close, 10));
> > >
> > > Mike
> > >
> > > --- In amibroker@xxxxxxxxxxxxxxx, "wavemechanic" <timesarrow@>
> > > wrote:
> > >>
> > >> Sounds like you want something along these lines: barssince
(rsi <
> > > 30) > 1 and (moving average condition).
> > >>
> > >> Bill
> > >>
> > >>
> > >>   ----- Original Message -----
> > >>   From: tridean34
> > >>   To: amibroker@xxxxxxxxxxxxxxx
> > >>   Sent: Tuesday, July 08, 2008 8:26 AM
> > >>   Subject: [amibroker] Re: Not sure how to create a trigger
> > >>
> > >>
> > >>   Hi Guys,
> > >>   sorry for not being more specific.
> > >>
> > >>   Let's say it is RSI I am using.
> > >>
> > >>   If RSI < 30 then look for trigger 2. Let's say trigger 2 is 
mav
> > >>   crossover. Say 5 and 10
> > >>
> > >>   If mav 5 crosses above mav 10 then buy.
> > >>
> > >>   As this stands I can have
> > >>
> > >>   Buy = RSI < 30
> > >>   AND
> > >>   MAV 5 > MAV 10; (or something like that)
> > >>
> > >>   The problem is, I don't care if the RSI is < 30 when the 5 
mav
> > >>   actually crosses above the 10 mav, only that it occurred 
before
> > > hand.
> > >>   The RSI MUST hit or go below 30 before the system looks for 
the
> > > mav
> > >>   crossover, but once the crossover takes place, the RSI does 
NOT
> > > have
> > >>   to be at any specific level
> > >>
> > >>   And it is this I don't know how to code.
> > >>
> > >>   cheers
> > >>   Dean
> > >>
> > >>
> > >>   ------------------------------------
> > >>
> > >>   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
> > >>
> > >>
> > >>
> > >>
> > >>   No virus found in this incoming message.
> > >>   Checked by AVG - http://www.avg.com
> > >>   Version: 8.0.138 / Virus Database: 270.4.6/1539 - Release 
Date:
> > > 7/7/2008 6:35 PM
> > >>
> > >
> > >
> > >
> > > ------------------------------------
> > >
> > > 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
> > >
> > >
> > >
> > >
> >
>



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

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/