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

Re: [amibroker] Drawing Stop Loss Line



PureBytes Links

Trading Reference Links

Hi Rick,Graham
Thanks for the code.I will try it out and let you.
A special thanks to Rick for helping me even after a major surgery.
I wish for youe speedy recovery.
Get well soon
with bwst wishes
rpc

 
On 05/05/07, Rick Osborn <ricko@xxxxxxxxxx> wrote:

Thanks
Oh how we try to complicate things.
R


--- Graham <kavemanperth@xxxxxxxxx> wrote:

> there are a number of ways to calculate this, here
> is one
>
> Priordate = ValueWhen(Buy,ref(bi,-1),1);
>
> or simplify it by removing a step
>
> BuydateLow = ValueWhen(Buy,L,1);
> PriordateLow = ValueWhen(Buy,ref(L,-1),1);
>
> --
> Cheers
> Graham
> AB-Write >< Professional AFL Writing Service
> Yes, I write AFL code to your requirements
> http://www.aflwriting.com
>
>
> On 05/05/07, Rick Osborn < ricko@xxxxxxxxxx> wrote:
> > rpc
> >
> > Here is a second attempt.
> >
> > _SECTION_BEGIN("Stop Calculator");
> > // Stop Calculator
> > bi = BarIndex()+1;
> > Buydate = ValueWhen(Buy,bi,1);
> > Priordate = Buydate -1;
> >
> > BuydateLow = ValueWhen(bi == Buydate ,L,1);
> > PriordateLow = ValueWhen(bi == Priordate ,L,1);
> >
> > slpoint = Min(BuydateLow ,PriordateLow )*0.95;
> > y2 = LastValue(slpoint);
> > x2 = BarCount -8;
> > x3 = BarCount -1;
> > Line = LineArray( x2, y2, x3, y2, 0 );
> > Plot( Line, "Trend line", colorPaleTurquoise);
> > _SECTION_END();
> >
> > The only problem is that the line
> >
> > <PriordateLow = ValueWhen(bi == Priordate ,L,1);>
> >
> > returns {EMPTY} value which makes the calculation
> of
> > the line zero.
> >
> > I am recovering from major surgery and don't have
> the
> > energy to figure out what is wrong.
> >
> > Perhaps the true programmers out there can help
> >
>

Rick Osborn & Associates
885 Sorrento Ave.
Oshawa, Ontario L1J 6V6
(905) 728-8543 fax 728-0815


__._,_.___

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

For other support material please check also:
http://www.amibroker.com/support.html





SPONSORED LINKS
Investment management software Investment property software Investment software
Investment tracking software Return on investment software

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___