PureBytes Links
Trading Reference Links
|
Yaroll,
This is due to the fact that you are using Cross function.
I will refer to your original picture:
Let's analyse "situation 1"
On a day "1" a short signal occurred because Low crossed below Ref( Low, -1 )
but note the High price was higher than previous day high (H>Ref( H, -1 ) );
On the next day "day 2" you think that AmiBroker should generate an long entry
( H > Ref( H, -1 ) ) but it does not do that because there is NO CROSS here.
High > Ref( H, -1 ) but also Ref( H, -1 ) > Ref( H, -2 ) !!!!
Cross would generate a signal only if previous day relationship between prices
was opposite.
This happens where green arrow is shown.
You need to modify your rule to:
Buy = High > Ref(High,-1);
Sell = Ref(Low,-1) < Low;
if you want to work it in a way you described. (you may add Exrem statements if you don't want to
see extra arrows)
Best regards,
Tomasz Janeczko
amibroker.com
> ----- Original Message -----
>From: "Yarroll" <komin@xxxx>
> To: <amibroker@xxxxxxxxxxxxxxx>
> Sent: Thursday, April 18, 2002 7:18 PM
> Subject: [amibroker] Intraday entries
>
>
> > Hello Group,
> >
> > I have run against another very disturbing problem lately trying to check if systems
> > written in AFL can enter trades with entry prices other than Close, Open etc. known from
> > Metastock.
> >
> > I have used the simplest system I could think of which buys when price crosses above
> > Ref(High,-1) and goes short when it crosses below Ref(L,-1), please find the formula
> > below. The problem is, Amibroker would take only some trades and wouldn't touch the
> > others :-(( Please see the attached .gif with 2 such situations described.
> >
> > Do I get it all wrong? Or something wrong with the formula? Please help...
> > Thanks,
> > Yarroll
> >
> > PS. I tried to trim the size of the gif, I got it as low as I could, sorry if it's still
> > large at 14 KB.
> >
> > ***
> >
> >
> > BuyStop =Ref(High,-1);
> > SellStop = Ref(Low,-1);
> >
> > Buy = Cross( High, Ref(High,-1) );
> > Sell = Cross( Ref(Low,-1), Low);
> > Short = Cross( Ref(Low,-1), Low);
> > Cover = Cross( High, Ref(High,-1));
> >
> > BuyPrice = Max( BuyStop, Low );
> > SellPrice = Min( SellStop, High );
> > CoverPrice = Max( BuyStop, Low );
> > ShortPrice = Min( SellStop, High );
> >
> >
> >
> >
> >
> > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
> >
> >
>
|