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

RE: [amibroker] NO WAY [Was]: New Variable Class



PureBytes Links

Trading Reference Links










Tomasz: thank you very much for the “hints”. 
This looks like way more than “hints”, but I shall dive in and see
what I can do with it.

 

Many thanks for now.  I will report back.

 

Ken

 

-----Original Message-----
From: Tomasz Janeczko
[mailto:amibroker@xxxxxx] 
Sent: Friday, November 07, 2003 9:00
AM
To: amibroker@xxxxxxxxxxxxxxx
Subject: Re: [amibroker] NO WAY
[Was]: New Variable Class

 



Ken,





 





As for hints: you would do the following:





1. iterate through watch list and store scores (in case of osaka plugin
osTabSetNumber)





2. find top ranked symbols (this can be done even entriely in AFL as
Dimitris has shown,





or using Osaka plugin sort capability - osTabSort function)





3. create average from top ranked symbols. 





 





Below is the code that uses Osaka plugin 1.4. 





 





<span
>osInitialize<font
size=1 color=black face="Courier New">();

<span
> 

<span
>List = <font
size=1 color=blue face="Courier New">GetCategorySymbols<font size=1
color=black face="Courier New">(categoryGroup, <font
size=1 color=fuchsia face="Courier New">254<font size=1
color=black face="Courier New"> ); <span
>// <-- change
wl number here

<span
>table=<font
size=1 color=blue face="Courier New">osTabCreate<font size=1 color=black
face="Courier New">();

<span
> 

<span
>// setup columns

<span
>osTabAddColumn<font
size=1 color=black face="Courier New">( <font size=1 color=fuchsia
face="Courier New">"Ticker"<font size=1 color=black
face="Courier New">, <span
>2<font
size=1 color=black face="Courier New">, table, <font size=1 color=fuchsia
face="Courier New">25<span
> );

<span
>for<font
size=1 color=black face="Courier New">( j = <font size=1 color=fuchsia
face="Courier New">0<span
>; j < <span
>BarCount; j++ )

<span
>{

<span
>  <font
size=1 color=blue face="Courier New">osTabAddColumn<font size=1 color=black
face="Courier New">( <span
>"Score"<font
size=1 color=black face="Courier New">+j, <font size=1 color=fuchsia
face="Courier New">1<span
>, table );

<span
>  <font
size=1 color=blue face="Courier New">osTabAddColumn<font size=1 color=black
face="Courier New">( <span
>"Close"<font
size=1 color=black face="Courier New">+j, <font size=1 color=fuchsia
face="Courier New">1<span
>, table );

<span
>}

<span
> 

<span
>// CALCULATING
SCORES and saving them to the table

<span
>for<font
size=1 color=black face="Courier New">(i=<font size=1 color=fuchsia
face="Courier New">0<span
>; ( ticker = <font
size=1 color=blue face="Courier New">StrExtract<font size=1 color=black
face="Courier New">( List, i ) ) != <font size=1 color=fuchsia
face="Courier New">""<font size=1 color=black
face="Courier New">; i++)

<span
>{

<span
> <font
size=1 color=blue face="Courier New">SetForeign<font size=1 color=black
face="Courier New">(ticker);

<span
>  

<span
>  <font
size=1 color=blue face="Courier New">osTabSetString<font size=1 color=black
face="Courier New">( ticker, i, <font size=1 color=fuchsia
face="Courier New">0<span
>, table );

<span
>  

<span
> score = <font
size=1 color=fuchsia face="Courier New">50<font size=1
color=black face="Courier New">- <span
>RSI<font
size=1 color=black face="Courier New">(); <font size=1 color=green
face="Courier New">// YOUR SCORE CALCULATION HERE !!!!

<span
> 

<span
> <font
size=1 color=maroon face="Courier New">for<font size=1
color=black face="Courier New">( j = <span
>0<font
size=1 color=black face="Courier New">; j < BarCount;
j++)

<span
> {

<span
>   <font
size=1 color=blue face="Courier New">osTabSetNumber<font size=1 color=black
face="Courier New">( <span
>abs<font
size=1 color=black face="Courier New">( <font size=1 color=blue
face="Courier New">Nz<span
>( score[ j ] ) ),
i, <span
>2<font
size=1 color=black face="Courier New"> * j + <font size=1 color=fuchsia
face="Courier New">1<span
>, table );

<span
>   <font
size=1 color=blue face="Courier New">osTabSetNumber<font size=1 color=black
face="Courier New">( Close[ j ], i, <font
size=1 color=fuchsia face="Courier New">2<font size=1
color=black face="Courier New"> * j + <span
>2<font
size=1 color=black face="Courier New">, table ); <font size=1 color=green
face="Courier New">// for calculation of average

<span
> }

<span
>}

<span
> 

<span
>// you can export
for debugging

<span
>//osTabExport(
"test.csv", ",", table );

<span
> 

<span
> 

<span
>// SORTING SCORES
AND finding top ranks:

<span
>average = <font
size=1 color=fuchsia face="Courier New">0<font size=1
color=black face="Courier New">; <span
>// init avarage

<span
> 

<span
>for<font
size=1 color=black face="Courier New">( j = <font size=1 color=fuchsia
face="Courier New">0<span
>; j < <span
>BarCount; j++)

<span
>{

<span
>   <font
size=1 color=blue face="Courier New">osTabSort<font size=1 color=black
face="Courier New">( table, <font size=1 color=fuchsia
face="Courier New">2<span
> * j + <font
size=1 color=fuchsia face="Courier New">1<font size=1
color=black face="Courier New">, False );

<span
>    average[ j ]
= <span
>0<font
size=1 color=black face="Courier New">;

<span
>    topnum = <font
size=1 color=fuchsia face="Courier New">10<font size=1
color=black face="Courier New">; <span
>// change this
iterate throgh other number than top-10  

<span
>    <font
size=1 color=maroon face="Courier New">for<font size=1
color=black face="Courier New">( k = <span
>0<font
size=1 color=black face="Courier New">; k < topnum ; k++ ) <font size=1
color=green face="Courier New">// 

<span
>    {

<span
>              fc
= <span
>osTabGet<font
size=1 color=black face="Courier New">( k, <font size=1 color=fuchsia
face="Courier New">2<span
> * j + <font
size=1 color=fuchsia face="Courier New">2<font size=1
color=black face="Courier New">, table ); 

<span
>       average[ j
] = average[ j ] + fc;

<span
>    }

<span
>    

<span
>    average[ j ]
= average[ j ]/topnum; <span
>// calculate
average from top N symbols at given bar

<span
>    

<span
>}

<span
> 

<span
>osTabDelete<font
size=1 color=black face="Courier New">( table );

<span
> 

<span
>Filter<font
size=1 color=black face="Courier New">=<font size=1 color=fuchsia
face="Courier New">1<span
>;

<span
>AddColumn<font
size=1 color=black face="Courier New">(average, <font size=1 color=fuchsia
face="Courier New">"AVG top10 (each bar different)"<font
size=1 color=black face="Courier New"> ); 

Plot<font size=1
color=black face="Courier New">( average, <font size=1 color=fuchsia
face="Courier New">"AVG top10 (each bar different)"<font
size=1 color=black face="Courier New">, colorRed
); 





 





Best regards,
Tomasz Janeczko
amibroker.com





----- Original Message ----- 



From: "Ken Close" <<a
href="">closeks@xxxxxxxx<font
size=2>>





To: <<font
size=2>amibroker@xxxxxxxxxxxxxxx<font
size=2>>





Sent: Friday, November 07, 2003 1:50 PM





Subject: RE: [amibroker] NO WAY [Was]: New Variable Class







 



Tomasz:

Of course.  As usual you are correct.  I knew it.  I am trying
to
provoke/seek some more help (not do it for me but point me in the right
direction with some hints/help).


Ken

-----Original Message-----
From: Tomasz Janeczko [mailto:amibroker@xxxxxx] 
Sent: Friday, November 07, 2003 7:39 AM
To: <span
>amibroker@xxxxxxxxxxxxxxx
Subject: Re: [amibroker] NO WAY
[Was]: New Variable Class

Ken,

There is a huge difference between:
A. "not possible"
B. "not possible by someone with my level of exprerience"

Your problem falls under B.

Telling that something is not possible in AFL is almost equivalent
to saying that it is not possible to write it at all (in any language).

Best regards,
Tomasz Janeczko
amibroker.com
----- Original Message ----- 
From: "Ken Close" <<font
size=2>closeks@xxxxxxxx<font
size=2>>
To: <<span
>amibroker@xxxxxxxxxxxxxxx<font
size=2>>
Sent: Friday, November 07, 2003 1:02 PM
Subject: [amibroker] NO WAY [Was]: New Variable Class


DT:

You said:

"I like your expression "no way" !!
I donīt like the same expression, when we talk AFL."

I offer my opinion in a long message in the AB-Beta message list that I
have a trading approach that AFL can not (NOT) handle.  Maybe using
complex script and intricate internal handling of tables, but not AFL.
And not by someone with my level of experience.

I do not know if you use the new Portfolio Backtester, nor if you have
time or interest in my plight/problem.

But for now and as several others have advised me about my trading
system, "NO WAY" for AFL.

Comment??

Ken

-----Original Message-----
From: DIMITRIS TSOKAKIS [mailto:TSOKAKIS@xxxxxxxxx]
Sent: Friday, November 07, 2003 4:21 AM
To: <span
>amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] Re: New Variable
Class

Stephane,
We have AddToComposite()
[we should be happy...]
We are not programmers [at least me]
[we should be also happy...]
I like your expression "no way" !!
I donīt like the same expression, when we talk AFL.
I shall see it again [the weekend, not now...]
As for the group of composites, they may be constructed all together
with a loop.
Dimitris Tsokakis
--- In <span
>amibroker@xxxxxxxxxxxxxxx<font
size=2>, "Stephane Carrasset"
<<span
>nenapacwanfr@x<span
>...> wrote:
> Dimitri,
>
> yes you're right,
> no way to optimize directly in a composite...
> we must create separatly each composite for each numeric value.
>
> stephane
>




Send BUG REPORTS to <font
size=2>bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to <a
href="">suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: <a
href="">amiquote@xxxxxxxxxxxxxxx
(Web page: <a
href=""><span
>http://groups.yahoo.com/group/amiquote/messages/<font
size=2>)
--------------------------------------------
Check group FAQ at:
<a
href=""><font
size=2>http://groups.yahoo.com/group/amibroker/files/groupfaq.html

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





Send BUG REPORTS to <a
href="">bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to <a
href="">suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: <a
href="">amiquote@xxxxxxxxxxxxxxx<span
> 
(Web page: <a
href=""><span
>http://groups.yahoo.com/group/amiquote/messages/<font
size=2>)
--------------------------------------------
Check group FAQ at:
<a
href=""><font
size=2>http://groups.yahoo.com/group/amibroker/files/groupfaq.html<font
size=2> 

Your use of Yahoo! Groups is subject to
<span
>http://docs.yahoo.com/info/terms/<font
size=2> 




------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark
Printer at MyInks.com. Free s/h on orders $50 or more to the US & Canada.
<span
>http://www.c1tracking.com/l.asp?cid=5511
<font
size=2>http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/GHeqlB/TM
---------------------------------------------------------------------~->

Send BUG REPORTS to <font
size=2>bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to <a
href="">suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: <a
href="">amiquote@xxxxxxxxxxxxxxx<span
> 
(Web page: <a
href=""><span
>http://groups.yahoo.com/group/amiquote/messages/<font
size=2>)
--------------------------------------------
Check group FAQ at: <a
href=""><font
size=2>http://groups.yahoo.com/group/amibroker/files/groupfaq.html<font
size=2> 

Your use of Yahoo! Groups is subject to <a
href="">http://docs.yahoo.com/info/terms/<span
> 



Send BUG
REPORTS to bugs@xxxxxxxxxxxxx<span
>
Send 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 Yahoo!
Terms of Service. 










Yahoo! Groups Sponsor


  ADVERTISEMENT 









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.