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

bross function



PureBytes Links

Trading Reference Links

I am experimenting cross function. The following simple system just 
gave one buy signal. I know for sure it should give more from chart 
inspection.

=================
BuyStop= Ref(HHV(C, 20), -1);
SellStop=Ref(LLV(C, 20), -1);
BuyPrice = max( BuyStop, Low ); // make sure buy price not less than 
Low 
SellPrice = min( SellStop, High );
Buy = Cross( High, BuyStop ); 
Sell = Cross( SellPrice, sellstop);


--- In amibroker@xxxx, "Tomasz Janeczko" <amibroker@xxxx> wrote:
> Hello,
> 
> Why don't you use Cross function?
> 
> BuyPrice =Ref(LLV(L, 3), -1) ;
> Buy = Cross( BuyPrice, Low ); 
> sell= ref(buy, -5);
> 
> (You may also add this at the end:
> 
> Buy = ExRem( Buy, Sell );
> Sell = ExRem( Sell, Buy );
> )
> 
> Best regards,
> Tomasz Janeczko
> ===============
> AmiBroker - the comprehensive share manager.
> http://www.amibroker.com
> 
> ----- Original Message ----- 
> From: <bmx888@xxxx>
> To: <amibroker@xxxx>
> Sent: Saturday, November 10, 2001 7:17 PM
> Subject: [amibroker] Re: count bars since entry
> 
> 
> > Hi Tomasz,
> > 
> > Thanks for the reply. It works better. The system is still 
confused 
> > when it sees several buy signal in a row. Here is my test system.
> > 
> > BuyPrice =Ref(LLV(L, 3), -1) ;
> > Buy =Low<BuyPrice; 
> > sell= ref(buy, -5);
> > 
> > It can geneate several signals in a row. When I test it on BA, I 
got 
> > 6/29/01 entry and 6/29/01 exit.
> > 
> > I guess my question is related to position management which is 
very 
> > tricky in writing the logic there. Would it be possible to add 
> > a "position" function to describe current position (long, sort, 
> > neutral). Then I can write
> > Sell=barssince (position=1)>5;
> > 
> > Thank you,
> > 
> > Bai
> > 
> > Since it can generate several buy signal in a row so sometimes 
the 
> > system close when 
> > --- In amibroker@xxxx, "Tomasz Janeczko" <amibroker@xxxx> wrote:
> > > Hello,
> > > 
> > > First:
> > > if you write buy=1 you ASSIGN 1 to buy variable.
> > > To check if it is equal you have to use double = operator:
> > > 
> > > buy == 1
> > > 
> > > but it is not necessary because AFL works in a way
> > > similar to C/C++: zero value are treated as "false" and
> > > non-zero values are treated as "true", so you can write:
> > > 
> > > sell = barssince(buy)>5; // sell after 5 bars from the last buy 
> > signal
> > > 
> > > For repeating buy signals it is better to use
> > > 
> > > sell = ref( buy, -5 ); // sell after 5 bars from the initial 
buy 
> > signal
> > > 
> > > 
> > > Best regards,
> > > Tomasz Janeczko
> > > ===============
> > > AmiBroker - the comprehensive share manager.
> > > http://www.amibroker.com
> > > 
> > > 
> > > ----- Original Message ----- 
> > > From: <bmx888@xxxx>
> > > To: <amibroker@xxxx>
> > > Sent: Saturday, November 10, 2001 6:17 PM
> > > Subject: [amibroker] count bars since entry
> > > 
> > > 
> > > > I use the following to count bars since entry and it did not 
work.
> > > > Is there any function in AFL that refers to position?
> > > > 
> > > > sell=barssince(buy=1)>5;
> > > > 
> > > > 
> > > > 
> > > > 
> > > > Your use of Yahoo! Groups is subject to 
> > http://docs.yahoo.com/info/terms/ 
> > > > 
> > > > 
> > > >
> > 
> > 
> > 
> > 
> > 
> > Your use of Yahoo! Groups is subject to 
http://docs.yahoo.com/info/terms/ 
> > 
> > 
> >