PureBytes Links
Trading Reference Links
|
Peter,
Did you read my answer to the end
?
I wrote
<FONT
face="Times New Roman" size=2>So in your code you
should simply replace:
<FONT face="Times New Roman"
size=3>
<FONT
face="Courier New" color=black size=1><SPAN
><SPAN
> currADX =
ForeignADX( ticker, <FONT face="Courier New" color=fuchsia
size=1><SPAN
>14<FONT
face="Courier New" color=black size=1><SPAN
>
);
<FONT
face="Courier New" color=green size=1><SPAN
>//<SPAN
> ^ should hold
ForeignADX Array<SPAN
>
<FONT
face="Courier New" color=black size=1><SPAN
><SPAN
>
<FONT face="Courier New"
color=maroon><SPAN
>for<FONT
face="Courier New" color=black><SPAN
>
(i=<SPAN
>1<FONT
face="Courier New" color=black><SPAN
>;i<<SPAN
>BarCount;i++)
<FONT
face="Courier New" color=black><SPAN
><FONT
size=4>
{
<FONT
face="Courier New" color=black><SPAN
><FONT
size=4><SPAN
>
MeanADX[i] = MeanADX[i] + currADX[i];
<FONT
face="Courier New" color=black><SPAN
><FONT
size=4>
}
<FONT
face="Times New Roman" size=3><SPAN
>
<FONT
face="Courier New" color=black size=1><SPAN
>by
<FONT
face="Times New Roman" size=3><SPAN
>
<FONT
face="Courier New" color=black size=1><SPAN
><SPAN
> currADX =
ForeignADX( ticker, <FONT face="Courier New" color=fuchsia
size=1><SPAN
>14<FONT
face="Courier New" color=black size=1><SPAN
>
);
<FONT
face="Courier New" color=green size=1><SPAN
>//<SPAN
> ^ should hold
ForeignADX Array<SPAN
>
<FONT
face="Courier New" color=black size=1><SPAN
>
<SPAN
>
MeanADX = MeanADX +
currADX;
<FONT
face=Tahoma color=black size=2><SPAN
>
<FONT
face="Courier New" color=black size=2><SPAN
>
<FONT
face="Courier New" color=black size=1><SPAN
>
Then it should work with UM's plugin too and there would be no need to list
the tickers explicitely.
Best regards,Tomasz Janeczkoamibroker.com
<BLOCKQUOTE
>
----- Original Message -----
<DIV
>From:
<A title=investor@xxxxxxxxxxxxx
href="">bluesinvestor
To: <A title=amibroker@xxxxxxxxxxxxxxx
href="">amibroker@xxxxxxxxxxxxxxx
Sent: Tuesday, May 13, 2003 8:43 PM
Subject: RE: [amibroker] Array processing
in Loops (Tomasz) [was] Re: The use of the Powsmooth
<SPAN
>Tomasz,
<SPAN
>
<SPAN
>Thank you, but the
NDX is made up of more than 3 tickers.
We would have to code GetTicker( index ) for all of those symbols
(S&P 500 would be a treat $B!D(B hmm what about the Russel 2000). <SPAN
> Plus if the symbols that compose the
NDX change (as they do at least once a year) not only would we have to change
the watchlist but also the code.
<SPAN
>
<SPAN
>The thread was
started to see if there was a way to create a this indicator without
AddtoComposit.
<SPAN
>
<SPAN
>But maybe it is
UM$B!G(Bs tool that I am having a problem with.
<SPAN
>
<SPAN
>Thank
you,
<SPAN
>Peter
<SPAN
>
<SPAN
>-----Original
Message-----From: Tomasz
Janeczko [mailto:amibroker@xxxxxx] <SPAN
>Sent: <st1:date Year="2003"
Day="13" Month="5"><SPAN
>Tuesday, May 13,
2003<SPAN
> <st1:time
Minute="27" Hour="14"><SPAN
>2:27
PM<SPAN
><SPAN
>To: amibroker@xxxxxxxxxxxxxxx<SPAN
>Subject: Re: [amibroker] Array processing
in Loops (Tomasz) [was] Re: The use of the Powsmooth
<FONT face="Times New Roman"
size=3>
<FONT face="Times New Roman"
size=2>Hello,
<FONT face="Times New Roman"
size=3>
<FONT face="Times New Roman"
size=2>... and of course use
AddToComposite.
<FONT face="Times New Roman"
size=3>
<FONT face="Times New Roman"
size=2>As to your question: arrays in loops are
processed in the same way as usual:
<FONT face="Times New Roman"
size=3>
<FONT face="Times New Roman" color=maroon
size=1><SPAN
>function<FONT
size=1> GetTicker( index ){
<SPAN
>if( index == <FONT
color=fuchsia>0 ) result = <FONT
color=fuchsia><SPAN
>"MSFT"; <FONT
face="Times New Roman" color=maroon>
else<SPAN
><FONT
face="Times New Roman"> if( index
== 1 ) result =
<SPAN
>"INTC"; <FONT
color=maroon>else
if( index == <SPAN
>2 ) result = <SPAN
>"AAPL"; <FONT
color=maroon><SPAN
>return
result;
<SPAN
>}
<SPAN
>Composite = <FONT
color=fuchsia><SPAN
>0;
<FONT face="Times New Roman" color=maroon
size=1><SPAN
>for<FONT
size=1>( <FONT face="Courier New"
size=1><SPAN
>index<FONT
size=1> = <SPAN
>0; i<FONT
face="Courier New" size=1><SPAN
>ndex<FONT
size=1> < <SPAN
>3; i<FONT
face="Courier New" size=1><SPAN
>ndex<FONT
size=1>++ ){ ticker =
GetTicker( index ); Composite = Composite + <FONT
color=blue>Foreign( ticker, <FONT
color=fuchsia>"C"
);}
<FONT face="Times New Roman" color=blue
size=1><SPAN
>AddColumn<FONT
size=1>( Composite<FONT
face="Courier New" size=1><SPAN
>/<FONT
color=fuchsia>3<FONT
size=1>, <SPAN
>"<FONT face="Courier New"
color=fuchsia size=1><SPAN
>Close of
<SPAN
>MSFT+INTC+AAPL"<FONT
size=1> );<SPAN
>Filter = <SPAN
>1;
<SPAN
>
<FONT face="Times New Roman"
size=2><SPAN
>=============
<FONT
face="Times New Roman" size=2>So in your code
you should simply replace:
<FONT face="Times New Roman"
size=3>
<P class=MsoNormal
><FONT
face="Courier New" color=black size=1><SPAN
><SPAN
> currADX =
ForeignADX( ticker, <FONT face="Courier New" color=fuchsia
size=1><SPAN
>14<FONT
face="Courier New" color=black size=1><SPAN
>
);
<P class=MsoNormal
><FONT
face="Courier New" color=green size=1><SPAN
>//<SPAN
> ^ should hold
ForeignADX Array<FONT face="Courier New" color=black
size=1><SPAN
>
<P class=MsoNormal
><FONT
face="Courier New" color=black size=1><SPAN
><SPAN
>
<SPAN
>for<FONT
face="Courier New" color=black size=1><SPAN
>
(i=<SPAN
>1<FONT
face="Courier New" color=black size=1><SPAN
>;i<<SPAN
>BarCount;i++)
<P class=MsoNormal
><FONT
face="Courier New" color=black size=1><SPAN
><SPAN
> {<SPAN
>
<P class=MsoNormal
><FONT
face="Courier New" color=black size=1><SPAN
><SPAN
>
MeanADX[i] = MeanADX[i] + currADX[i];
<P class=MsoNormal
><FONT
face="Courier New" color=black size=1><SPAN
><SPAN
>
}
<P class=MsoNormal
><FONT
face="Times New Roman" size=3><SPAN
>
<P class=MsoNormal
><FONT
face="Courier New" color=black size=1><SPAN
>by
<P class=MsoNormal
><FONT
face="Times New Roman" size=3><SPAN
>
<P class=MsoNormal
><FONT
face="Courier New" color=black size=1><SPAN
><SPAN
> currADX =
ForeignADX( ticker, <FONT face="Courier New" color=fuchsia
size=1><SPAN
>14<FONT
face="Courier New" color=black size=1><SPAN
>
);
<P class=MsoNormal
><FONT
face="Courier New" color=green size=1><SPAN
>//<SPAN
> ^ should hold
ForeignADX Array<SPAN
>
<P class=MsoNormal
><FONT
face="Courier New" color=black size=1><SPAN
>
<SPAN
>
MeanADX = MeanADX + currADX;<FONT face="Courier New" color=black
size=1><SPAN
>
<P class=MsoNormal
><FONT
face="Times New Roman" color=black size=3><SPAN
> <FONT
face="Courier New" color=black size=1><SPAN
>
<P class=MsoNormal
><FONT
face="Times New Roman" color=black size=3><SPAN
> <FONT
face="Courier New" color=black size=1><SPAN
>
<P class=MsoNormal
><FONT
face="Times New Roman" color=black size=3><SPAN
> <FONT
face="Courier New" color=black size=1><SPAN
>
<FONT
face="Times New Roman" size=3>(you can add
arrays directly without loop thanks to AFL powerfull array
processing)
<FONT face="Times New Roman"
size=3>
<FONT face="Times New Roman"
size=3>Best regards,Tomasz
Janeczkoamibroker.com
<BLOCKQUOTE
>
<SPAN
>----- Original Message -----
<FONT
face=Arial size=2><SPAN
>From:<FONT
face=Arial size=2> <A
title=amibroker@xxxxxx href="">Tomasz Janeczko
<FONT face=Arial
size=2><SPAN
>To:<FONT
face=Arial size=2> <A
title=amibroker@xxxxxxxxxxxxxxx
href="">amibroker@xxxxxxxxxxxxxxx
<FONT face=Arial
size=2><SPAN
>Sent:<FONT
face=Arial size=2>
<FONT face=Arial
size=2>Tuesday, May 13,
2003<SPAN
> <st1:time
Minute="3" Hour="20"><SPAN
>8:03
PM<SPAN
>
<FONT face=Arial
size=2><SPAN
>Subject:<FONT
face=Arial size=2> Re:
[amibroker] Array processing in Loops (Tomasz) [was] Re: The use of the
Powsmooth
<FONT face="Times New Roman"
size=3><SPAN
>
<FONT face="Times New Roman"
size=2><SPAN
>Hello,
<FONT face="Times New Roman"
size=3><SPAN
>
<FONT face="Times New Roman"
size=2>Why do things so much complicated when
they are easy.
<FONT face="Times New Roman"
size=3><SPAN
>
<FONT face="Times New Roman"
size=2>You CAN iterate through watch
list.
<FONT face="Times New Roman"
size=2>Simply click on FILTER
button and set it to watch list of your
choice.
<FONT face="Times New Roman"
size=2>Then AA will automatically go through
your watch list.
<FONT face="Times New Roman"
size=3><SPAN
>
<FONT face="Times New Roman"
size=3>Best regards,Tomasz
Janeczkoamibroker.com
<BLOCKQUOTE
>
<FONT face=Arial
size=2>----- Original
Message -----
<P class=MsoNormal
><FONT face=Arial
size=2><SPAN
>From:<FONT
face=Arial size=2> <A
title=investor@xxxxxxxxxxxxx
href="">bluesinvestor
<FONT face=Arial
size=2><SPAN
>To:<FONT
face=Arial size=2> <A
title=amibroker@xxxxxxxxxxxxxxx
href="">amibroker@xxxxxxxxxxxxxxx
<FONT face=Arial
size=2><SPAN
>Sent:<FONT
face=Arial size=2>
<FONT face=Arial
size=2>Tuesday, May 13,
2003<SPAN
> <st1:time
Minute="11" Hour="17"><SPAN
>5:11
PM<SPAN
>
<FONT face=Arial
size=2><SPAN
>Subject:<FONT
face=Arial size=2>
[amibroker] Array processing in Loops (Tomasz) [was] Re: The use of the
Powsmooth
<FONT face="Times New Roman"
size=3><SPAN
>
<FONT face="Courier New"
size=2>Tomasz,
<FONT face="Courier New"
size=2>
<FONT face="Courier New"
size=2>I am trying to find an easy way to
code Dimitris$B!G(B Powsmooth using UM$B!G(Bs ABTool DLL (I would like
to use a pure AFL method but cannot seem to find a way to iterate through
tickers in a watchlist via AFL).
<FONT face="Courier New"
size=2>
<FONT face="Courier New"
size=2>How does AB handle arrays when
enclosed in a loop? This does
not seem to work:
<FONT face="Courier New"
size=2>
<P class=MsoNormal
><FONT
face="Courier New" color=green size=1><SPAN
>/* WRITE
ONCE */<SPAN
>
<P class=MsoNormal
><FONT
face="Courier New" color=maroon size=1><SPAN
>function<FONT
face="Courier New" color=black size=1><SPAN
>
ForeignADX( symbol, period )
<P class=MsoNormal
><FONT
face="Courier New" color=black size=1><SPAN
>{
<P class=MsoNormal
><FONT
face="Courier New" color=black size=1><SPAN
><SPAN
> <FONT
face="Courier New" color=green size=1><SPAN
>/* save
original price arrays */<FONT face="Courier New" color=black
size=1><SPAN
>
<P class=MsoNormal
><FONT
face="Courier New" color=black size=1><SPAN
><SPAN
> SC = <SPAN
>C;
<P class=MsoNormal
><FONT
face="Courier New" color=black size=1><SPAN
><SPAN
> SO = <SPAN
>O;
<P class=MsoNormal
><FONT
face="Courier New" color=black size=1><SPAN
><SPAN
> SH = <SPAN
>H;
<P class=MsoNormal
><FONT
face="Courier New" color=black size=1><SPAN
><SPAN
> SL = <SPAN
>L;
<P class=MsoNormal
><FONT
face="Courier New" color=black size=1><SPAN
>
<P class=MsoNormal
><FONT
face="Courier New" color=black size=1><SPAN
><SPAN
> <SPAN
>C = <FONT
face="Courier New" color=blue size=1><SPAN
>Foreign<FONT
face="Courier New" color=black size=1><SPAN
>( symbol,
<SPAN
>"C"<FONT
face="Courier New" color=black size=1><SPAN
>
);
<P class=MsoNormal
><FONT
face="Courier New" color=black size=1><SPAN
><SPAN
> <SPAN
>H = <FONT
face="Courier New" color=blue size=1><SPAN
>Foreign<FONT
face="Courier New" color=black size=1><SPAN
>( symbol,
<SPAN
>"H"<FONT
face="Courier New" color=black size=1><SPAN
>
);
<P class=MsoNormal
><FONT
face="Courier New" color=black size=1><SPAN
><SPAN
> <SPAN
>L = <FONT
face="Courier New" color=blue size=1><SPAN
>Foreign<FONT
face="Courier New" color=black size=1><SPAN
>( symbol,
<SPAN
>"L"<FONT
face="Courier New" color=black size=1><SPAN
>
);
<P class=MsoNormal
><FONT
face="Courier New" color=black size=1><SPAN
><SPAN
> <SPAN
>O = <FONT
face="Courier New" color=blue size=1><SPAN
>Foreign<FONT
face="Courier New" color=black size=1><SPAN
>( symbol,
<SPAN
>"O"<FONT
face="Courier New" color=black size=1><SPAN
>
);
<P class=MsoNormal
><FONT
face="Courier New" color=black size=1><SPAN
>
<P class=MsoNormal
><FONT
face="Courier New" color=black size=1><SPAN
><SPAN
> Result = <FONT
face="Courier New" color=blue size=1><SPAN
>ADX<FONT
face="Courier New" color=black size=1><SPAN
>( period
); <SPAN
>//
REPLACE THIS BY ANY AFL FUNCTION<FONT face="Courier New"
color=black size=1><SPAN
>
<P class=MsoNormal
><FONT
face="Courier New" color=black size=1><SPAN
>
<P class=MsoNormal
><FONT
face="Courier New" color=black size=1><SPAN
><SPAN
> <FONT
face="Courier New" color=green size=1><SPAN
>/*
restore original arrays */<FONT face="Courier New"
color=black size=1><SPAN
>
<P class=MsoNormal
><FONT
face="Courier New" color=black size=1><SPAN
><SPAN
> <SPAN
>C = SC;
<P class=MsoNormal
><FONT
face="Courier New" color=black size=1><SPAN
><SPAN
> <SPAN
>O = SO;
<P class=MsoNormal
><FONT
face="Courier New" color=black size=1><SPAN
><SPAN
> <SPAN
>H = SH;
<P class=MsoNormal
><FONT
face="Courier New" color=black size=1><SPAN
><SPAN
> <SPAN
>L = SL;
<P class=MsoNormal
><FONT
face="Courier New" color=black size=1><SPAN
>
<P class=MsoNormal
><FONT
face="Courier New" color=maroon size=1><SPAN
>return<FONT
face="Courier New" color=black size=1><SPAN
>
Result;
<P class=MsoNormal
><FONT
face="Courier New" color=black size=1><SPAN
>}
<P class=MsoNormal
><FONT
face="Courier New" color=black size=1><SPAN
>
<P class=MsoNormal
><FONT
face="Courier New" color=black size=1><SPAN
>wl =
<SPAN
>0<FONT
face="Courier New" color=black size=1><SPAN
>;<SPAN
> <FONT
face="Courier New" color=green size=1><SPAN
>// put
your watchlist number (0..63) here; it should contain some
tickers<SPAN
>
<P class=MsoNormal
><FONT
face="Courier New" color=black size=1><SPAN
><SPAN
>
<SPAN
>// (my WL
1 contains the 100 Nasdaq100 tickers)<FONT
face="Courier New" color=black size=1><SPAN
>
<P class=MsoNormal
><FONT
face="Courier New" color=black size=1><SPAN
>
<P class=MsoNormal
><FONT
face="Courier New" color=blue size=1><SPAN
>xxABtoolInit<FONT
face="Courier New" color=black size=1><SPAN
>();
<P class=MsoNormal
><FONT
face="Courier New" color=black size=1><SPAN
>Filter<FONT
face="Courier New" color=black size=1><SPAN
> =
<SPAN
>1<FONT
face="Courier New" color=black size=1><SPAN
>;
<P class=MsoNormal
><FONT
face="Courier New" color=black size=1><SPAN
>xtickercount
= <SPAN
>xxTickerCount<FONT
face="Courier New" color=black size=1><SPAN
>(wl);
<P class=MsoNormal
><FONT
face="Courier New" color=black size=1><SPAN
>
<P class=MsoNormal
><FONT
face="Courier New" color=black size=1><SPAN
>ticker =
<SPAN
>xxTickerFirst<FONT
face="Courier New" color=black size=1><SPAN
>(wl);
<P class=MsoNormal
><FONT
face="Courier New" color=black size=1><SPAN
>MeanADX =
<SPAN
>0<FONT
face="Courier New" color=black size=1><SPAN
>;
<P class=MsoNormal
><FONT
face="Courier New" color=maroon size=1><SPAN
>while<FONT
face="Courier New" color=black size=1><SPAN
>(ticker
!= <SPAN
>""<FONT
face="Courier New" color=black size=1><SPAN
>)
<P class=MsoNormal
><FONT
face="Courier New" color=black size=1><SPAN
>{
<P class=MsoNormal
><FONT
face="Courier New" color=black size=1><SPAN
><SPAN
> currADX = ForeignADX( ticker,
<SPAN
>14<FONT
face="Courier New" color=black size=1><SPAN
>
);
<P class=MsoNormal
><FONT
face="Courier New" color=green size=1><SPAN
>//<SPAN
> ^ should hold ForeignADX
Array<SPAN
>
<P class=MsoNormal
><FONT
face="Courier New" color=black size=1><SPAN
><SPAN
> <FONT
face="Courier New" color=maroon size=1><SPAN
>for<FONT
face="Courier New" color=black size=1><SPAN
>
(i=<SPAN
>1<FONT
face="Courier New" color=black size=1><SPAN
>;i<<SPAN
>BarCount;i++)
<P class=MsoNormal
><FONT
face="Courier New" color=black size=1><SPAN
><SPAN
> {<SPAN
>
<P class=MsoNormal
><FONT
face="Courier New" color=black size=1><SPAN
><SPAN
>
MeanADX[i] = MeanADX[i] + currADX[i];
<P class=MsoNormal
><FONT
face="Courier New" color=black size=1><SPAN
><SPAN
>
}
<P class=MsoNormal
><FONT
face="Courier New" color=black size=1><SPAN
>
<P class=MsoNormal
><FONT
face="Courier New" color=black size=1><SPAN
><SPAN
> ticker = <FONT
face="Courier New" color=blue size=1><SPAN
>xxTickerNext<FONT
face="Courier New" color=black size=1><SPAN
>(wl);
<P class=MsoNormal
><FONT
face="Courier New" color=black size=1><SPAN
>}
<P class=MsoNormal
><FONT
face="Courier New" color=black size=1><SPAN
>
<P class=MsoNormal
><FONT
face="Courier New" color=blue size=1><SPAN
>xxABtoolInit<FONT
face="Courier New" color=black size=1><SPAN
>();<SPAN
> <FONT
face="Courier New" color=green size=1><SPAN
>//cleanup<FONT
face="Courier New" color=black size=1><SPAN
>
<P class=MsoNormal
><FONT
face="Courier New" color=black size=1><SPAN
>
<P class=MsoNormal
><FONT
face="Courier New" color=blue size=1><SPAN
>AddColumn<FONT
face="Courier New" color=black size=1><SPAN
>(MeanADX,<FONT
face="Courier New" color=fuchsia size=1><SPAN
>"MeanADX"<FONT
face="Courier New" color=black size=1><SPAN
>);
<P class=MsoNormal
><FONT
face="Courier New" color=black size=1><SPAN
>
<P class=MsoNormal
><FONT
face="Courier New" color=green size=1><SPAN
>
<FONT face="Courier New"
size=2>Thanks in
advance,
<FONT face="Courier New"
size=2>Peter
<FONT face="Courier New"
size=2>
<FONT face="Courier New"
size=2>-----Original Message-----From:
DIMITRIS TSOKAKIS [mailto:TSOKAKIS@xxxxxxxxx] Sent:
Monday, May 12,
2003 2:39 AMTo:
amibroker@xxxxxxxxxxxxxxxSubject: [amibroker] Re: The use of the
Powsmooth
<FONT face="Courier New"
size=2>
<FONT face="Courier New"
size=2>Peter,
<FONT face="Courier New"
size=2>thank you for the unexpected [because
of time] reply.
<FONT face="Courier New"
size=2>Sleep with the idea and talk again
"tomorrow".
<FONT face="Courier New"
size=2>It is 09.30 in
Athens now, 32
Celsius and the summer is already at
<FONT face="Courier New"
size=2>the
corner.
<FONT face="Courier New"
size=2>Dimitris
Tsokakis
<FONT face="Courier New"
size=2>--- In amibroker@xxxxxxxxxxxxxxx,
"bluesinvestor" <investor@xxxx>
<FONT face="Courier New"
size=2>wrote:
<FONT face="Courier New"
size=2>>
Dimitris,
<FONT face="Courier New"
size=2>>
<FONT face="Courier New"
size=2>> Unfortunately it is late here
and I cannot come with a simple
<FONT face="Courier New"
size=2>solution
<FONT face="Courier New"
size=2>> to 'step' through foreign
tickers to get the ADX variable.
We would
<FONT face="Courier New"
size=2>> have to list all the tickers
involved.
<FONT face="Courier New"
size=2>>
<FONT face="Courier New"
size=2>> If there is a way (which I do
not know or cannot think of at the
<FONT face="Courier New"
size=2>moment)
<FONT face="Courier New"
size=2>> then the situation would be easy
to solve.
<FONT face="Courier New"
size=2>>
<FONT face="Courier New"
size=2>> Maybe someone will have a
suggestion or solution by morning.
<FONT face="Courier New"
size=2>>
<FONT face="Courier New"
size=2>>
Regards,
<FONT face="Courier New"
size=2>>
Peter
<FONT face="Courier New"
size=2>>
<FONT face="Courier New"
size=2>> -----Original
Message-----
<FONT face="Courier New"
size=2>> From: DIMITRIS TSOKAKIS
[mailto:TSOKAKIS@xxxx]
<FONT face="Courier New"
size=2>> Sent: <st1:date
Year="2003" Day="12" Month="5">Monday, May 12, 2003 <st1:time
Minute="59" Hour="1">1:59 AM
<FONT face="Courier New"
size=2>> To:
amibroker@xxxxxxxxxxxxxxx
<FONT face="Courier New"
size=2>> Subject: [amibroker] Re: The use
of the Powsmooth
<FONT face="Courier New"
size=2>>
<FONT face="Courier New"
size=2>>
Peter,
<FONT face="Courier New"
size=2>> to materialize this idea
<FONT face="Courier New"
size=2>>
http://groups.yahoo.com/group/amibroker/message/40198
<FONT face="Courier New"
size=2>> in N100 database we need to
write 100 lines with
<FONT face="Courier New"
size=2>>
ADX0=
<FONT face="Courier New"
size=2>>
ADX1=
<FONT face="Courier New"
size=2>>
ADX2=
<FONT face="Courier New"
size=2>> ...
<FONT face="Courier New"
size=2>>
ADX99=
<FONT face="Courier New"
size=2>>
MeanADX=(ADX0+ADX1+ADX2+...+ADX99)/100;
<FONT face="Courier New"
size=2>> Since you swim better in the
iterations world, is there a more
<FONT face="Courier New"
size=2>> elegant way to do it [through
stocknum perhaps...]
<FONT face="Courier New"
size=2>> Of course, even if we take it as
is, the advantage is great,
<FONT face="Courier New"
size=2>> especially for intraday
use.
<FONT face="Courier New"
size=2>> I suppose we make a STEP
here.
<FONT face="Courier New"
size=2>> Dimitris
Tsokakis
<FONT face="Courier New"
size=2>> --- In
amibroker@xxxxxxxxxxxxxxx, "bluesinvestor" <investor@xxxx>
<FONT face="Courier New"
size=2>>
wrote:
<FONT face="Courier New"
size=2>> >
Dimitris,
<FONT face="Courier New"
size=2>> ><SPAN
>
<FONT face="Courier New"
size=2>> > Without the
_javascript_:
<FONT face="Courier New"
size=2>> ><SPAN
>
<FONT face="Courier New"
size=2>> > /*PowSmooth and an
application to Dratio*/
<FONT face="Courier New"
size=2>> >
dratio=DEMA(1000*(H-L)/(H+L),20);
<FONT face="Courier New"
size=2>> ><SPAN
>
<FONT face="Courier New"
size=2>> >
for(i=2;i<BarCount;i++)
<FONT face="Courier New"
size=2>> >
{
<FONT face="Courier New"
size=2>> ><SPAN
>
t0[i]=(dratio[i]*dratio[i-1]*dratio[i-2])^(1/3);
<FONT face="Courier New"
size=2>> ><SPAN
>
s0[i]=(dratio[i]*dratio[i-1])^(1/2);
<FONT face="Courier New"
size=2>> >
}
<FONT face="Courier New"
size=2>> >
PowSmooth=(s0+t0)/2;
<FONT face="Courier New"
size=2>> ><SPAN
>
<FONT face="Courier New"
size=2>> >
Filter=1;
<FONT face="Courier New"
size=2>> >
AddColumn(dratio,"DRATIO");
<FONT face="Courier New"
size=2>> >
AddColumn(s0,"SQRT");
<FONT face="Courier New"
size=2>> >
AddColumn(t0,"THIRD");
<FONT face="Courier New"
size=2>> >
AddColumn(Powsmooth,"PowSmooth");
<FONT face="Courier New"
size=2>> >
Plot(dratio,"dratio",1,8);
<FONT face="Courier New"
size=2>> >
Plot(PowSmooth,"PowSmooth",7,1);
<FONT face="Courier New"
size=2>> ><SPAN
>
<FONT face="Courier New"
size=2>> > RRR=Powsmooth;// Replace
this line with RRR=dratio; to see the
<FONT face="Courier New"
size=2>usual
<FONT face="Courier New"
size=2>> >
Dratioresults
<FONT face="Courier New"
size=2>> >
D1=35;
<FONT face="Courier New"
size=2>> >
F1=RRR>=D1;F2=RRR<=D1;
<FONT face="Courier New"
size=2>> >
Sell=F2;Buy=F1;Buy=ExRem(Buy,Sell);Sell=ExRem(Sell,Buy);
<FONT face="Courier New"
size=2>> >
Short=Sell;Cover=Buy;Short=ExRem(Short,Cover);Cover=ExRem
<FONT face="Courier New"
size=2>>
(Cover,Short);
<FONT face="Courier New"
size=2>> ><SPAN
>
<FONT face="Courier New"
size=2>> >
Regards,
<FONT face="Courier New"
size=2>> >
Peter
<FONT face="Courier New"
size=2>> ><SPAN
>
<FONT face="Courier New"
size=2>> > -----Original
Message-----
<FONT face="Courier New"
size=2>> > From: Dimitris Tsokakis
[mailto:TSOKAKIS@xxxx]
<FONT face="Courier New"
size=2>> > Sent:
Saturday, May 10,
2003 7:19
AM
<FONT face="Courier New"
size=2>> > To:
amibroker@xxxxxxxxxxxxxxx
<FONT face="Courier New"
size=2>> > Subject: [amibroker] The
use of the Powsmooth
<FONT face="Courier New"
size=2>> ><SPAN
>
<FONT face="Courier New"
size=2>> > The basic property of the
Powsmooth
<FONT face="Courier New"
size=2>> >
http://groups.yahoo.com/group/amibroker/message/40077
<FONT face="Courier New"
size=2>> > is to filter out fast
zigzags, passing through them, without
<FONT face="Courier New"
size=2>>
introducing
<FONT face="Courier New"
size=2>> > important
lags.
<FONT face="Courier New"
size=2>> > When we use a cross level
trading system, many times we loose
<FONT face="Courier New"
size=2>money
<FONT face="Courier New"
size=2>> > because of oscillation of
our indicator around the
<FONT face="Courier New"
size=2>> > critical cross level.
<FONT face="Courier New"
size=2>> > If our cross level is
"good", then we should expect [and we shall
<FONT face="Courier New"
size=2>> > see...] strong ask and bid
when we are close to this level.
<FONT face="Courier New"
size=2>> > The result is the well
known repeated whipsaws, which usually
<FONT face="Courier New"
size=2>>
annihilate
<FONT face="Courier New"
size=2>> > our
profits.
<FONT face="Courier New"
size=2>> > Unfortunately, the solution
is not to smooth our nervous
<FONT face="Courier New"
size=2>indicator,
<FONT face="Courier New"
size=2>> it
<FONT face="Courier New"
size=2>> > will usually loose its
charm to catch quickly the market changes.
<FONT face="Courier New"
size=2>> > In this case [traders who
use fast indicators will understand
<FONT face="Courier New"
size=2>very
<FONT face="Courier New"
size=2>>
well
<FONT face="Courier New"
size=2>> > this syndrom...] the
PowSmooth may offer great assistance.
<FONT face="Courier New"
size=2>> > Its smart curve will gently
pass between the accumulated ziggy
<FONT face="Courier New"
size=2>>
points,
<FONT face="Courier New"
size=2>> > avoid cascade entries/exits
and substantially increase our
<FONT face="Courier New"
size=2>profits.
<FONT face="Courier New"
size=2>> > See a characteristic
example in the att. gif.
<FONT face="Courier New"
size=2>> > In the first case, the
dratio gives 8 trades in two months, with
<FONT face="Courier New"
size=2>a
<FONT face="Courier New"
size=2>>
final
<FONT face="Courier New"
size=2>> > +13%, oscillating around
the critical level D=35.
<FONT face="Courier New"
size=2>> > The PowSmooth, for the same
^NDX period, gives two clear trades
<FONT face="Courier New"
size=2>and
<FONT face="Courier New"
size=2>> > maximizes the profits to
+20%.
<FONT face="Courier New"
size=2>> > [settings
buy/sell/short/cover at +1open, commission 0.5%,
stops
<FONT face="Courier New"
size=2>> >
disabled]
<FONT face="Courier New"
size=2>> > The level D=35 is critical
for the market, the D_ratio frequntly
<FONT face="Courier New"
size=2>> > oscillates up and down,
until the market takes the decision to go
<FONT face="Courier New"
size=2>>
higher
<FONT face="Courier New"
size=2>> > or lower.
<FONT face="Courier New"
size=2>> > The usual D_ratio system
gives for the whole market nice profits,
<FONT face="Courier New"
size=2>>
+340%
<FONT face="Courier New"
size=2>> > since
Jan2000.
<FONT face="Courier New"
size=2>> > The PowSmooth D_datio makes
the difference : +940% for the same
<FONT face="Courier New"
size=2>>
period
<FONT face="Courier New"
size=2>> > and
settings.
<FONT face="Courier New"
size=2>> > For ^NDX we could nearly
double the profits:
<FONT face="Courier New"
size=2>> > Usual D_ratio : +550%,
37trades/28winners/9losers
<FONT face="Courier New"
size=2>> > PowSmooth : +1165%,
27trades/23winners/4losers.
<FONT face="Courier New"
size=2>> > A +550% is not that bad, a
+1165% is much better.
<FONT face="Courier New"
size=2>> > For CSCO, the signal
generator of this transcendental system
<FONT face="Courier New"
size=2>[since
<FONT face="Courier New"
size=2>> we
<FONT face="Courier New"
size=2>> > "borrow" CSCO data for the
basic curve] the situation needs
<FONT face="Courier New"
size=2>> > no further comments : the
comparison is +370% vs +2000%.
<FONT face="Courier New"
size=2>> > If you use fast and ziggy
indicators and Cross level systems,
<FONT face="Courier New"
size=2>take a
<FONT face="Courier New"
size=2>> > look at the PowSmooth, it
may make you smile.
<FONT face="Courier New"
size=2>> > Dimitris
Tsokakis
<FONT face="Courier New"
size=2>> > I use the trancendental
CSCO D_ratio code
<FONT face="Courier New"
size=2>> > /*Powsmooth CSCO D_ratio,
written and used by D.Tsokakis, Sept
<FONT face="Courier New"
size=2>>
2002*/
<FONT face="Courier New"
size=2>> >
H=Foreign("CSCO","H");L=Foreign("CSCO","L");
<FONT face="Courier New"
size=2>> >
dratio=DEMA(1000*(H-L)/(H+L),20);
<FONT face="Courier New"
size=2>> >
EnableScript("jscript");
<FONT face="Courier New"
size=2>> >
<%
<FONT face="Courier New"
size=2>> > dratio = VBArray( AFL(
"dratio" ) ).toArray();
<FONT face="Courier New"
size=2>> > s=new Array();t=new
Array();
<FONT face="Courier New"
size=2>> >
s[0]=0;t[0]=0;
<FONT face="Courier New"
size=2>> >
for(i=1;i<dratio.length;i++)
<FONT face="Courier New"
size=2>> >
{
<FONT face="Courier New"
size=2>> >
{t[i]=Math.pow((dratio[i]*dratio[i-1]*dratio[i-2]),1/3);}
<FONT face="Courier New"
size=2>> >
{s[i]=Math.pow((dratio[i]*dratio[i-1]),1/2);}
<FONT face="Courier New"
size=2>> >
}
<FONT face="Courier New"
size=2>> > AFL.Var("s0") =s
;
<FONT face="Courier New"
size=2>> >
AFL.Var("t0")=t;
<FONT face="Courier New"
size=2>> >
%>
<FONT face="Courier New"
size=2>> >
Powsmooth=(s0+t0)/2;
<FONT face="Courier New"
size=2>> > RRR=Powsmooth;// Replace
this line with RRR=dratio; to see the
<FONT face="Courier New"
size=2>usual
<FONT face="Courier New"
size=2>> >
Dratioresults
<FONT face="Courier New"
size=2>> >
D1=35;
<FONT face="Courier New"
size=2>> >
F1=RRR>=D1;F2=RRR<=D1;
<FONT face="Courier New"
size=2>> >
Sell=F2;Buy=F1;Buy=ExRem(Buy,Sell);Sell=ExRem(Sell,Buy);
<FONT face="Courier New"
size=2>> >
Short=Sell;Cover=Buy;Short=ExRem(Short,Cover);Cover=ExRem
<FONT face="Courier New"
size=2>>
(Cover,Short);
<FONT face="Courier New"
size=2>> >
<FONT face="Courier New"
size=2>> >
<FONT face="Courier New"
size=2>> >
<FONT face="Courier New"
size=2>> >
<FONT face="Courier New"
size=2>> > Yahoo! Groups
Sponsor
<FONT face="Courier New"
size=2>> >
<FONT face="Courier New"
size=2>> ><SPAN
>
<FONT face="Courier New"
size=2>> >
<FONT face="Courier New"
size=2>>
<FONT face="Courier New"
size=2><SPAN
><http://rd.yahoo.com/M=251812.3170658.4537139.1261774/D=egroupweb/S=17
<FONT face="Courier New"
size=2>> 05
<FONT face="Courier New"
size=2>> >
632198:HM/A=1564415/R=0/*http:/www.netflix.com/Default?
<FONT face="Courier New"
size=2>>
mqso=60164784&par
<FONT face="Courier New"
size=2>> > tid=3170658>
<FONT face="Courier New"
size=2>> >
<FONT face="Courier New"
size=2>> ><SPAN
>
<FONT face="Courier New"
size=2>> >
<http://us.adserver.yahoo.com/l?
<FONT face="Courier New"
size=2>>
M=251812.3170658.4537139.1261774/D=egrou
<FONT face="Courier New"
size=2>> >
pmail/S=:HM/A=1564415/rand=998789952>
<FONT face="Courier New"
size=2>> >
<FONT face="Courier New"
size=2>> > Send BUG REPORTS to
bugs@xxxx
<FONT face="Courier New"
size=2>> > Send SUGGESTIONS to
suggest@xxxx
<FONT face="Courier New"
size=2>> >
-----------------------------------------
<FONT face="Courier New"
size=2>> > Post AmiQuote-related
messages ONLY to: amiquote@xxxxxxxxxxxxxxx
<FONT face="Courier New"
size=2>> > (Web page:
http://groups.yahoo.com/group/amiquote/messages/)
<FONT face="Courier New"
size=2>> >
--------------------------------------------
<FONT face="Courier New"
size=2>> > Check group FAQ
at:
<FONT face="Courier New"
size=2>> >
http://groups.yahoo.com/group/amibroker/files/groupfaq.html
<FONT face="Courier New"
size=2>> >
<FONT face="Courier New"
size=2>> > Your use of Yahoo! Groups
is subject to the Yahoo!
<FONT face="Courier New"
size=2>> >
<http://docs.yahoo.com/info/terms/><SPAN
> Terms of
Service.
<FONT face="Courier New"
size=2>>
<FONT face="Courier New"
size=2>>
<FONT face="Courier New"
size=2>>
<FONT face="Courier New"
size=2>> Send BUG REPORTS to
bugs@xxxx
<FONT face="Courier New"
size=2>> Send SUGGESTIONS to
suggest@xxxx
<FONT face="Courier New"
size=2>>
-----------------------------------------
<FONT face="Courier New"
size=2>> Post AmiQuote-related messages
ONLY to: amiquote@xxxxxxxxxxxxxxx
<FONT face="Courier New"
size=2>> (Web page:
http://groups.yahoo.com/group/amiquote/messages/)
<FONT face="Courier New"
size=2>>
--------------------------------------------
<FONT face="Courier New"
size=2>> Check group FAQ
at:
<FONT face="Courier New"
size=2>>
http://groups.yahoo.com/group/amibroker/files/groupfaq.html
<FONT face="Courier New"
size=2>>
<FONT face="Courier New"
size=2>> Your use of Yahoo! Groups is
subject to
<FONT face="Courier New"
size=2>>
http://docs.yahoo.com/info/terms/
<FONT face="Courier New"
size=2>
<FONT face="Courier New"
size=2>
<FONT face="Courier New"
size=2>------------------------ Yahoo!
Groups Sponsor ---------------------~-->
<FONT face="Courier New"
size=2>Rent DVDs from
home.
<FONT face="Courier New"
size=2>Over 14,500 titles. Free
Shipping
<FONT face="Courier New"
size=2>& No Late Fees. Try Netflix for
FREE!
<FONT face="Courier New"
size=2><SPAN
>http://us.click.yahoo.com/BVVfoB/hP.FAA/uetFAA/GHeqlB/TM
<FONT face="Courier New"
size=2><SPAN
>---------------------------------------------------------------------~->
<FONT face="Courier New"
size=2>
<FONT face="Courier New"
size=2>Send BUG REPORTS to
bugs@xxxxxxxxxxxxx
<FONT face="Courier New"
size=2>Send SUGGESTIONS to
suggest@xxxxxxxxxxxxx
<FONT face="Courier New"
size=2><SPAN
>-----------------------------------------
<FONT face="Courier New"
size=2>Post AmiQuote-related messages ONLY
to: amiquote@xxxxxxxxxxxxxxx
<FONT face="Courier New"
size=2>(Web page:
http://groups.yahoo.com/group/amiquote/messages/)
<FONT face="Courier New"
size=2><SPAN
>--------------------------------------------
<FONT face="Courier New"
size=2>Check group FAQ at:
http://groups.yahoo.com/group/amibroker/files/groupfaq.html
<FONT face="Courier New"
size=2>
<FONT face="Courier New"
size=2>Your use of Yahoo! Groups is subject
to http://docs.yahoo.com/info/terms/
<FONT face="Courier New"
size=2>
<FONT face="Times New Roman"
size=3><FONT
face="Courier New" size=2>Send BUG REPORTS
to bugs@xxxxxxxxxxxxx<FONT face="Courier New"
size=2><SPAN
><FONT
face="Courier New">Send SUGGESTIONS to
suggest@xxxxxxxxxxxxx<FONT
face="Courier New">-----------------------------------------<FONT
face="Courier New">Post AmiQuote-related messages ONLY to:
amiquote@xxxxxxxxxxxxxxx (Web
page: <A
href="">http://groups.yahoo.com/group/amiquote/messages/)<FONT
face="Courier New">--------------------------------------------<FONT
face="Courier New">Check group FAQ at: <A
href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html
<SPAN
>Your use of Yahoo! Groups is subject to the <A
href="">Yahoo! Terms of
Service.
<FONT face="Times New Roman"
size=3><FONT
face="Courier New" size=2>Send BUG REPORTS to
bugs@xxxxxxxxxxxxx<SPAN
><FONT
face="Courier New">Send SUGGESTIONS to
suggest@xxxxxxxxxxxxx<FONT
face="Courier New">-----------------------------------------<FONT
face="Courier New">Post AmiQuote-related messages ONLY to:
amiquote@xxxxxxxxxxxxxxx (Web
page: <A
href="">http://groups.yahoo.com/group/amiquote/messages/)<FONT
face="Courier New">--------------------------------------------<FONT
face="Courier New">Check group FAQ at: <A
href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html
<SPAN
>Your use of Yahoo! Groups is subject to the <A
href="">Yahoo! Terms of
Service.
<FONT face="Times New Roman"
size=3><BR
><BR
><FONT
face="Courier New" size=2>Send BUG REPORTS to
bugs@xxxxxxxxxxxxx<SPAN
><FONT
face="Courier New">Send SUGGESTIONS to
suggest@xxxxxxxxxxxxx<FONT
face="Courier New">-----------------------------------------<FONT
face="Courier New">Post AmiQuote-related messages ONLY to:
amiquote@xxxxxxxxxxxxxxx (Web
page: <A
href="">http://groups.yahoo.com/group/amiquote/messages/)<FONT
face="Courier New">--------------------------------------------<FONT
face="Courier New">Check group FAQ at: <A
href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html
Your
use of Yahoo! Groups is subject to the <A
href="">Yahoo! Terms of
Service.
Send
BUG REPORTS to bugs@xxxxxxxxxxxxxSend SUGGESTIONS to
suggest@xxxxxxxxxxxxx-----------------------------------------Post
AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx (Web page: <A
href="">http://groups.yahoo.com/group/amiquote/messages/)--------------------------------------------Check
group FAQ at: <A
href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html
Your use of Yahoo! Groups is subject to the <A
href="">Yahoo! Terms of Service.
Yahoo! Groups Sponsor
ADVERTISEMENT
<img
src="" width=300 height=250 border=0>
Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
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.
|