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

Re: [amibroker] Intraday entries



PureBytes Links

Trading Reference Links

Yaroll,

First of all - it seems that in the Settings page you have set "1" day delay for the Long trades.
Second thing: use "Show arrows for actual trades" option from right mouse button menu.

Now to the rest of your questions/observations:
in end of day mode you can have upto 2 trades per day:
one long and one short. 
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

As you noticed with EOD data you don't know if day's low happens before day's high.
You don't know the shape of intraday price movement so it is actually NO way to guess
what is correct order of intraday trades having only EOD data.

Best regards,
Tomasz Janeczko
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/ 
> 
>