PureBytes Links
Trading Reference Links
|
Tomasz, Graham, Dingo
Thank you for all your input. It certainly opened up more options
than I can quickly digest, but that is just a matter of my spending
time with the code.
Once again, I am totally impressed with the knowledge and willingness
to share that I have found on this board and in the AB community in
general. Hopefully, I will someday be able to return the favors.
Thanks again
Bill
--- In amibroker@xxxxxxxxxxxxxxx, "Graham" <gkavanag@xxxx> wrote:
> Thanks for that Tomasz, I only spent a few minutes on it this
morning in
> between trading, so did not think to investigate alternative last
bar
> formulae.
>
>
>
> Cheers,
>
> Graham
>
>
>
> -----Original Message-----
> From: Tomasz Janeczko [mailto:amibroker@x...]
> Sent: Wednesday, 5 February 2003 4:45 PM
> To: amibroker@xxxxxxxxxxxxxxx
> Subject: Re: [amibroker] Creating an artifical security.
>
>
>
> Graham,
>
>
>
> By the way DateNum()==LastValue(DateNum())
>
> works good for EOD only databases.
>
>
>
> To make it work for all databases (including intraday) you would
either
> use
>
> Cum(1) == LastValue( Cum(1) )
>
>
>
> or (in newer versions):
>
> DateTime() == LastValue(DateTime())
>
>
>
> or
>
> BarIndex() == LastValue(BarIndex())
>
>
> Best regards,
> Tomasz Janeczko
> amibroker.com
>
> ----- Original Message -----
>
> From: Graham <mailto:gkavanag@x...>
>
> To: amibroker@xxxxxxxxxxxxxxx
>
> Sent: Wednesday, February 05, 2003 9:30 AM
>
> Subject: RE: [amibroker] Creating an artifical security.
>
>
>
> Thanks for the compliment Tomasz
>
> Have been thinking about this one myself today and considered it
> unnecessary to produce the composite unless needed for some reason.
I
> have simplified the code a bit, and then made more complex with
adding
> the trading tick and the available range of modifying the last price
> values :-)
>
>
>
> //allow for minimum trading ticks
>
> tick = 0.5;
>
>
>
> xo = LastValue(O);
>
> do = round(xo*0.2);
>
> O =
> IIf(DateNum()==LastValue(DateNum()),Param("O",xo,xo-
do,xo+do,tick),Ref(O
> ,1));
>
> xh = LastValue(H);
>
> dh = round(xh*0.2);
>
> H =
> IIf(DateNum()==LastValue(DateNum()),Param("H",xh,xh-
dh,xh+dh,tick),Ref(H
> ,1));
>
> xl= LastValue(L);
>
> dl = round(xl*0.2);
>
> L =
> IIf(DateNum()==LastValue(DateNum()),Param("L",xl,xl-
dl,xl+dl,tick),Ref(L
> ,1));
>
> xc = LastValue(C);
>
> dc = round(xc*0.2);
>
> C =
> IIf(DateNum()==LastValue(DateNum()),Param("C",xc,xc-
dc,xc+dc,tick),Ref(C
> ,1));
>
>
>
>
>
> Plot( EMA (C,10),"EMA",colorBlue,styleLine);
>
> Plot(C,"chart",colorBlack,styleCandle);
>
> Plot(StochD(14),"stochD",colorGreen,styleLine+styleOwnScale);
>
> Plot(StochK(14),"stochK",colorRed,styleLine+styleOwnScale);
>
>
>
> Cheers,
>
> Graham
>
>
>
>
>
> -----Original Message-----
> From: Tomasz Janeczko [mailto:amibroker@x...]
> Sent: Wednesday, 5 February 2003 3:51 PM
> To: amibroker@xxxxxxxxxxxxxxx
> Subject: Re: [amibroker] Creating an artifical security.
>
>
>
> Bill,
>
>
>
> Graham already presented the code and it is nice.
>
> But I started to wonder if it wouldn't be easier for you to use
>
> Foreign/Ref function instead. I mean instead of creating artificial
> ticker
>
> and then using it somewhere else
>
> use
>
>
>
> Dummy = Ref( Foreign("Original Security", "C" ), -1 );
>
>
>
> in the *final* indicator you want to create.
>
>
>
> To change the last day data simply use:
>
>
>
> Dummy = Ref( Foreign("Original Security", "C" ), -1 );
>
> Dummy = IIF( Cum(1) == LastValue( Cum(1) ), FINALDAYVALUE, Dummy );
>
>
>
> (in most recent version 4.28 it can be also coded using BarIndex
() :)
>
>
>
> Dummy = IIF( BarIndex() == LastValue( BarIndex() ), FINALDAYVALUE,
Dummy
> );
>
>
>
>
>
> Best regards,
>
> Tomasz Janeczko
>
> amibroker.com
>
> ----- Original Message -----
>
> From: <wbarack@xxxx>
>
> To: <amibroker@xxxxxxxxxxxxxxx>
>
> Sent: Tuesday, February 04, 2003 9:30 PM
>
> Subject: [amibroker] Creating an artifical security.
>
>
>
>
>
> > Help! I want to be able to create a security that has all data
>
> > shifted back in time by one day and then be able to put in my
best
>
> > guess for the final day's data.
>
> >
>
> > Shifting can be done, I think, using the ref function.
>
> >
>
> > Dummy = ref(original security,-1)
>
> >
>
> > But how can I plug in the final days data. I can't quite figure
that
>
> > one out. Any great ideas out there?
>
> >
>
> > Bill
>
> >
>
> >
>
> > 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 the Yahoo! Terms of Service
> <http://docs.yahoo.com/info/terms/> .
>
>
>
>
>
>
> Yahoo! Groups Sponsor
>
>
>
> ADVERTISEMENT
>
>
<http://rd.yahoo.com/M=243376.2803712.4220031.1927555/D=egroupweb/S=17
05
>
632198:HM/A=1414910/R=0/*http:/ad.doubleclick.net/jump/N879.ameritrade
.y
> ahoo/B1054521.29;sz=300x250;adc=zhs;ord=1044434724138913?>
>
>
>
> <http://us.adserver.yahoo.com/l?
M=243376.2803712.4220031.1927555/D=egrou
> pmail/S=:HM/A=1414910/rand=674401020>
>
>
> 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 the Yahoo! Terms of Service
> <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/
|