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

Re: [amibroker] Re: need a buystop reference



PureBytes Links

Trading Reference Links

OK, I gotcha. In the particular case where the price gapped to 10.45 and
then went down the rest of the day, you wouldn't even buy at all because the
price (high) never reached the open + 0.5*ref(H-L,-1). Thanks.

AV

----- Original Message -----
From: "Tomasz Janeczko" <amibroker@xxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Monday, February 17, 2003 9:48 AM
Subject: Re: [amibroker] Re: need a buystop reference


> Al,
>
> You would be 100% correct if stoplevel was defined freely.
>
> But in our case:
> stoplevel = open + 0.5 * Ref( H - L, -1 );
>
> So it is always ABOVE open price.
>
> Therefore in this particular case MAX( O, stoplevel) is always
> equal to stoplevel (because it is higher than Open)
>
> So in this case the code I submitted was correct.
>
> But generally speaking (if stoplevel is not guaranteed
> to be above open) you are right.
>
> Best regards,
> Tomasz Janeczko
> amibroker.com
> ----- Original Message -----
> From: "Avcinci" <avcinci@xxxxxxxxxxx>
> To: <amibroker@xxxxxxxxxxxxxxx>
> Sent: Monday, February 17, 2003 3:25 PM
> Subject: Re: [amibroker] Re: need a buystop reference
>
>
> > TJ:
> >
> > I believe you need one minor correction in your BuyPrice statement. I
think
> > you need to state:
> >
> > BuyPrice = Max(O,Stoplevel);
> >
> > because in your example, suppose the open was 10.45 rather than 10.10,
and
> > the stock price went down thereafter. Your buyprice would then
necessarily
> > have to be the open, not the lower stoplevel.
> >
> > Al Venosa
> >
> > ----- Original Message -----
> > From: "Tomasz Janeczko" <amibroker@xxxxxx>
> > To: <amibroker@xxxxxxxxxxxxxxx>
> > Sent: Monday, February 17, 2003 6:13 AM
> > Subject: Re: [amibroker] Re: need a buystop reference
> >
> >
> > > 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/
> > >
> >
> > 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/