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

RE: [amibroker] Intraday entries



PureBytes Links

Trading Reference Links

Hello TJ, hello List,



>
> First of all - it seems that in the Settings page you have set "1" day delay for the
Long trades.


No, I didn't! I never use delays anyway. But all's clear now (please see below).

(snip)

> Because there is actually NO way for AmiBroker to guess "desired" order
> of trades (out of EOD data) if all 4 signals (buy/sell/short/cover) happen on the very
same day
> in that case AmiBroker enters long position first and then enters short position.
>
> This can be illustrated by:
> Buy=Short=Cover=Sell= (Cum(1) % 10 )==0; // enter every 10th day, all signals the same
>


This explains everything, thank you!
A "delayed trade" phonemonenon comes exactly from this. On Day 1 AmiBroker checked for
long trade first, the high was higher than Ref(H,-1) but Ref(H,-1) was also higher than
Ref(H,-2) so this signal was redundant. Next, AB checked for a short trade and it entered
short because L was <Ref(L,-1)...
Day 2 had a higher high and higher low so, since the system was short, and there was no
"raw" short signal, AB simply reversed to long. And so on. The sequence explains it all.
Thank you.

I think just about every kind of intraday entry would be affected :-(( Take for example
ATR breakout entries, where the system buys when price crosses above the Open +
ref((ATR(X)*y),-1) and sells when it goes below Open-Ref((ATR(X)*y),-1), if there is a
pair of these signals there would always be the problem which came first :-((

So no way to test intraday entries, just something "fixed for good" like the Open or the
Close?

In this case. Assuming I pull up an intraday chart, how do I test a system referring to
previous _day_ high or low?
And, - this would be the top of dreams ;-)) - does AmiBroker have a way - testing intraday
system - to refer to previous _day_ value of an indicator? Lets say Monday's ATR(5) is 20,
would this information be available to Automatic Analysis when it tests intraday for
Tuesday? Metastock would in this situation spit out something like: "Please choose a
security with compatible periodicity" :-((

Thanks, all the best
Yarroll




> amibroker.com
> ----- Original Message -----
> From: "Yarroll" <komin@xxxx>
> To: <amibroker@xxxxxxxxxxxxxxx>
> Sent: Friday, April 19, 2002 2:15 AM
> Subject: RE: [amibroker] Intraday entries
>
>
> > Thanks Tomasz for the answer.
> >
> > I re-wrote the rules as you suggested... Unfortunately, the problem gets even weirder
:-((
> > The formula now was:
> > Buy = High > Ref(High,-1);
> > Sell = Ref(Low,-1) < Low;
> > Short = Sell;
> > Cover = Buy;
> >
> > and the picture describes the problem in detail. Sorry for the extra arrows, I don't
know
> > how to remove them. But to the right of the chart you can see the list of trades and I
> > picked 4 days in a row to illustrate the problem - they're marked "1", "2", "3", "4"
both
> > in the list of trades and in the chart.
> > Sorry for the colors, a green candle should be white, and blue candle=traditional
black.
> >
> > Let's have a look:
> > Day 1 - 02/1/24 - is a white candle. The open was below the previous day low which
should
> > get me short; but, later, the market went all the way up - past previous day high -
which
> > should get me reverse from short to long. But AmiBroker in the list of trades says
only
> > "Short" for that day (1438.03) . Instead, I got long the next day (02/1/25) - a day
which
> > doesn't even have a raw signal :-(( So it's impossible to have 2 signals for the same
> > day?
> > Day 2 - 02/1/25 - is this day which got me long following failure to do so the
previous
> > day;
> > Day 3 - 02/1/28 is a huge black candle and - since the candle crossed below previous
day
> > low (1443.06) I got short at that price. BUT, I also covered and went long that very
same
> > day at 1482.44 so this time I got 2 signals the same day, unlike 02/1/24.
> > Day 4 - 02/1/29 - got me short at 1420.45, which shouldn't have happened as I should
have
> > been short from the day before.
> >
> > The problem here is that AmiBroker can't tell the sequence of these events? Like, Day
3
> > (02/1/28) is an outside day - the high is higher and the low is lower than the
previous
> > day, but, since this is also a long black candle we assume that the high for the day
came
> > first (so no need for the long signal, as the system was already long) and the low
came
> > second (so, that day the system should have reversed to short).
> >
> > Frankly I very much doubt that this is testable at all :-(( - at least, not with EOD
data.
> > In case of an outside day we can only assume by the color of the candle which came
first,
> > the low or the high. In fact prices could have traversed many times from high to low
> > within the body of the candle, producing multiple reversal signals. And in case of a
doji
> > there's just no way to tell which came first, the high or the low.
> >
> > Or, does AmiBroker make assumptions as to the sequence of highs or lows?
> > Also, why there can't be 2 signals for 02/1/24 ("1") but there are 2 signals for
02/1/28
> > ("3")?
> > If indeed this system can't be tested with EOD data then is there a simple way to
apply a
> > system to intraday data, and use a rule which would refer to previous _day's_
low/high?
> >
> > Thanks for your patience, all the best
> > Yarroll
> >
> > PS. Most surprising is, in spite of these disaster reversals the system still looks
quite
> > good.
> >
> >
> >
> >
> >
> > Sent: Thursday, April 18, 2002 10:23 PM
> > Subject: Re: [amibroker] Intraday entries
> >
> >
> > > 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/
> > > > >
> > > > >
> > > >
> > >
> > >
> > >
> > >
> > >
> > > 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/
> >
> >
>
>
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>