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

Re: [amibroker] Re: need a buystop reference



PureBytes Links

Trading Reference Links

Dimitris,

It IS FOR ANY interval INCLUDING EOD.

There is NO conflict.
===============

Just think about it.

Let's say that that previous day H was 10.00 and previous day low was 9.60.
The previous day range ref( H - L, -1 ) is 10-9.60 = 0.40.

Now our buy condition is
stoplevel = open + 0.5 * Ref( H - L, -1 );
buy = high >= stoplevel;

Let's say trading session just started and we now that open
is say 10.10 (a little gap up).

according to our formula stop level is placed at the:

10.10 + 0.5 * 0.4 = 10.10 + 0.20 = 10.30

Now let us suppose that prices move like this
Hour Price
10.00 -> 10.10
11:00 -> 10.15
12:00 -> 10.20
13.00 -> 10.30   -- >>> BUY STOP TRIGGERS at 10:30
14.00 -> 10.45 --- a higher high
15.00 -> 10.40 --- prices go down
15.30 -> 10.20 --- go down
16.00 -> 10.00 --- a days low

In that case our EOD price record is:
Open = 10.10
High = 10.45
Low = 10.00
Close = 10.00


Note that using EOD record the condition
stoplevel = open + 0.5 * Ref( H - L, -1 );

Buy = High >= StopLevel;

IS STILL VALID !

It is because EOD High must be GREATER OR EQUAL of ANY INTRADAY high !



Best regards,
Tomasz Janeczko
amibroker.com
----- Original Message -----
From: <TSOKAKIS@xxxxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Monday, February 17, 2003 11:54 AM
Subject: [amibroker] Re: need a buystop reference


Tomasz,
I thought your formula was for EOD.
Is it possible to use your condition in an EOD backtesting and avoid
the conflict I mentioned ?
Dimitris Tsokakis
--- In amibroker@xxxxxxxxxxxxxxx, "Tomasz Janeczko" <amibroker@xxxx>
wrote:
> Dimitris,
>
> Not true.
>
> If you have a real time feed this condition is perfectly valid.
> The Buy occurs when intraday price rises above StopLevel.
>
> This is how buy-stop orders work - you place the limit and
> wait until intraday price rises above this limit.
>
> As intraday price forms a new intraday high above the limit
> the buy is triggered. We really don't care what will happen next
> - it does not matter if prices continue to rise (and the EOD high is
> higher) or if prices start to fall (and our intraday temporary high
> becomes EOD high) the condition still remains valid and perfectly
> tradeable.
>
> Best regards,
> Tomasz Janeczko
> amibroker.com
> ----- Original Message -----
> From: <TSOKAKIS@xxxx>
> To: <amibroker@xxxxxxxxxxxxxxx>
> Sent: Monday, February 17, 2003 11:34 AM
> Subject: [amibroker] Re: need a buystop reference
>
>
> Tomasz,
> with Buy = High >= StopLevel; you can not Buy today, you have to
wait
> the end of the session to know H. Consequently, you will try to buy
> tomorrow. But, it is not sure you will meet this BuyPrice into
> tomorrow´s range.
> Dimitris Tsokakis
> --- In amibroker@xxxxxxxxxxxxxxx, "Tomasz Janeczko" <amibroker@xxxx>
> wrote:
> > Hello,
> >
> >
> > Stoplevel = Open + 0.5 * Ref( H - L, -1 );
> >
> > Buy = High >= StopLevel;
> > BuyPrice = StopLevel;
> >
> > Best regards,
> > Tomasz Janeczko
> > amibroker.com
> > ----- Original Message -----
> > From: "Yuki Taga" <yukitaga@xxxx>
> > To: <amibroker@xxxxxxxxxxxxxxx>
> > Sent: Monday, February 17, 2003 10:33 AM
> > Subject: [amibroker] need a buystop reference
> >
> >
> > > All:
> > >
> > > Can anyone point me to some code in the help file that will show
> me
> > > how to designate a buy stop today, based on yesterday's range?
I
> > > have tried like the devil to research this myself, and to code
it,
> > > but I'm not getting even close.
> > >
> > > What I'm looking for is something like, if today's price is X
> percent
> > > of yesterday's range above today's open, buy.  Something similar
> but
> > > opposite of course, for shorting.
> > >
> > > Yuki ^_^
> > >
> > > mailto:yukitaga@x...
> > >
> > >
> > > Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
> > > (Web page: http://groups.yahoo.com/group/amiquote/messages/)
> > >
> > > Check group FAQ at:
> http://groups.yahoo.com/group/amibroker/files/groupfaq.html
> > >
> > > Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
> > >
> > >
> > >
>
>
> Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
> (Web page: http://groups.yahoo.com/group/amiquote/messages/)
>
> Check group FAQ at:
http://groups.yahoo.com/group/amibroker/files/groupfaq.html
>
> Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/


Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
(Web page: http://groups.yahoo.com/group/amiquote/messages/)

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/




Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/