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

RE: [amibroker] Re: Subject: Results of Scan/Exploration



PureBytes Links

Trading Reference Links




Hello DT,You first have to do a 
transformation; vertical to horizontal. You can do this by creating a barchart 
for the equities, and then analyze it just like you would any indicator. 
Especially with looping you can now do almost anything. The transformation looks 
like this:<IMG alt="" hspace=0 src="jpg00116.jpg" 
align=baseline border=0><FONT face=Arial 
color=#000000 size=2>In this case the equity for first stock from the watch list 
is plotted in the last bar. You need just two lines of code to do 
this:

  Buy<FONT 
  face="Arial Narrow"> = <FONT 
  face="Arial Narrow">Cross<FONT 
  face="Arial Narrow">( <FONT 
  face="Arial Narrow">Close<FONT 
  face="Arial Narrow">, EMA<FONT 
  size=2>( <FONT 
  face="Arial Narrow">Close<FONT 
  face="Arial Narrow">, range ) ); // First four lines a dummy trading 
  systemSell<FONT 
  size=2> = <FONT 
  face="Arial Narrow">Cross<FONT 
  face="Arial Narrow">( EMA<FONT 
  size=2>( <FONT 
  face="Arial Narrow">Close<FONT 
  face="Arial Narrow">, range ), <FONT 
  face="Arial Narrow">Close 
  );Short<FONT 
  face="Arial Narrow"> = <FONT 
  face="Arial Narrow">Sell<FONT 
  face="Arial Narrow">;Cover<FONT 
  size=2> = <FONT 
  face="Arial Narrow">Buy<FONT 
  face="Arial Narrow">;E=<FONT 
  face="Arial Narrow">LastValue<FONT 
  face="Arial Narrow">(<FONT 
  face="Arial Narrow">Equity<FONT 
  face="Arial Narrow">(1<FONT 
  size=2>));Pointer = 
  <FONT 
  color=#ff0000>BarCount<FONT 
  color=#ff0000> - <FONT 
  face="Arial Narrow">Status<FONT 
  face="Arial Narrow">(<FONT 
  face="Arial Narrow">"StockNum"<FONT 
  color=#ff0000>);<FONT 
  face="Arial Narrow">AddToComposite<FONT 
  face="Arial Narrow">(IIf<FONT 
  size=2>(Pointer==<FONT 
  face="Arial Narrow">BarIndex<FONT 
  size=2><FONT 
  face="Arial Narrow">(),E,-1e10<FONT 
  face="Arial Narrow">),<FONT 
  face="Arial Narrow">"~EquityTest"<FONT 
  face="Arial Narrow">,"C"<FONT 
  face="Arial Narrow">,1<FONT 
  face="Arial Narrow">|2<FONT 
  face="Arial Narrow">|4<FONT 
  face="Arial Narrow">|<FONT 
  face="Arial Narrow">8<FONT 
  face="Arial Narrow">); // use 
  BacktesterEquities = <FONT 
  face="Arial Narrow">Foreign<FONT 
  face="Arial Narrow">(<FONT 
  face="Arial Narrow">"~EquityTest"<FONT 
  face="Arial Narrow">,"C"<FONT 
  size=2>);<FONT 
  face="Arial Narrow">Plot<FONT 
  face="Arial Narrow">(Equities,<FONT 
  face="Arial Narrow">"Equities",<FONT 
  face="Arial Narrow">1,<FONT 
  face="Arial Narrow">2+<FONT 
  face="Arial Narrow">4);<FONT 
  face="Arial Narrow">Title 
  = "Equities for 100 N100 
  Stocks";<FONT 
  face="Arial Narrow">GraphXSpace<FONT 
  face="Arial Narrow">=10<FONT 
  size=2>;<FONT 
  face="Arial Narrow">Filter<FONT 
  face="Arial Narrow">=1<FONT 
  face="Arial Narrow" size=1>;
You can plot any kind of data this 
way and it will be permanently on disk. Nice for system calibration files (make 
those zero based).I think you can 
take it from here :-)
Best regards,<FONT 
face="Arial Narrow" size=2>Herman.
 
<FONT 
size=2> <FONT face=Arial color=#0000ff 
size=2>
-----Original Message-----From: DIMITRIS TSOKAKIS [<A 
href="">mailto:TSOKAKIS@xxxxxxxxx]Sent: April 
23, 2003 12:14 AMTo: amibroker@xxxxxxxxxxxxxxxSubject: [amibroker] Re: 
Subject: Results of Scan/ExplorationHerman,Stewart asked 
at<A href="" 
target=_blank>http://groups.yahoo.com/group/amibroker/message/38506something 
simple : how to select the top5 of an exploration. Any ideafor this request 
?[If I understood well, to run an 
explorationFilter=1;AddColumn(MACD(),"MACD"); for 100 stocks 
and see in the result list ONLY the top5 MACDs,nothing else]I do not see 
how can I do it.[I hope to avoid 
MAX(Foreign("~AAPL-MACD","C"),MAX(Foreign("~ABGX-MACD","C"),...]Any idea 
appreciated.Dimitris Tsokakis--- In amibroker@xxxxxxxxxxxxxxx, "Herman 
vandenBergen" <psytek@xxxx>wrote:> Using array subscripts you 
can put any kind of data into a array:>     Data[0] = 
YourParameter1;>     Data[1] = 
Your{arameter2;> YourParameter could also use 
subscripts...>> When you want to save the data into a 
stock-specific array you usethe Atc,> some thing like this for the 
Explorer:>> AddToComposite(Data,"~"+Name()+"-Data","X",1|2|4|16); 
// Use inExplorer,> Data here refers to the array you filed using 
subscripts. Thisarray will be> of length equal to number of bars in 
the current stock - a bit of> over-kill - but this means you can put a 
ton of data into aComposite (5> fields: OHLCV). The great thing is 
that this information remains onDisk for> re-use at any time from any 
program, use Foreign("~"+Name()+"-Data","X");> here X can be any of 
OHLCV.>> You can save system calibration data for automatic 
recall. Youcannot save> text in a Composite however you can save 
Status("StockNum"), thisis an> ordinal number pointing to your stock 
in your group (it changes asyou> change groups!!).>> 
Best regards,> Herman>>>>>   
-----Original Message----->   From: Stewart [<A 
href="">mailto:stewart@x...]>   Sent: April 
22, 2003 10:29 AM>   To: 
amibroker@xxxxxxxxxxxxxxx>   Subject: Re: [amibroker] Subject: 
Results of Scan/Exploration>>>   but using 
AddtoComposite(), is there a way to relate "a row" to aspecific> 
ticker?>     ----- Original Message 
----->     From: Dimitris 
Tsokakis>     To: 
amibroker@xxxxxxxxxxxxxxx>     Sent: Tuesday, April 
22, 2003 5:56 PM>     Subject: [amibroker] Subject: 
Results of Scan/Exploration>>>     
Suppose we run an exploration for 100 stocks>     
X=StochD();>     
Filter=1;>     
AddColumn(X,"StochD");>     for one 
day.>     The result is an 100-dimension 
vector.>     We can save only in 6 fields through 
AddToComposite() function,namely> C, O, H, L, V, 
I.>     If we place the first 6 results to each 
field, we have no placeto save> the rest 94 
results.>     It is a 100X100 diagonal matrix, as in 
the att. gif>     but, even if we could, the result 
would not be an array.>     An array has one 
numerical value per day. In this case we wouldhave a> set of 100 
numerical values per day>     and we would create an 
100-dimensional "Hyper array".>     It needs specific 
imagination to understand the use of 
thiscreature.>     
DT>>     There's no way to store the results 
of an Exploration to anarray,> 
right?>>     
Thanks,>>     
Stewart>>>>>     Send BUG 
REPORTS to bugs@xxxx>     Send SUGGESTIONS to 
suggest@xxxx>     
----------------------------------------->     Post 
AmiQuote-related messages ONLY to: 
amiquote@xxxxxxxxxxxxxxx>     (Web page: <A 
href="" 
target=_blank>http://groups.yahoo.com/group/amiquote/messages/)>     
-------------------------------------------->     
Check group FAQ at:> <A 
href="" 
target=_blank>http://groups.yahoo.com/group/amibroker/files/groupfaq.html>>     
Your use of Yahoo! Groups is subject to the Yahoo! Terms 
ofService.>>>         
Yahoo! Groups Sponsor>>>>   Send BUG 
REPORTS to bugs@xxxx>   Send SUGGESTIONS to 
suggest@xxxx>   
----------------------------------------->   Post 
AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx>   
(Web page: <A href="" 
target=_blank>http://groups.yahoo.com/group/amiquote/messages/)>   
-------------------------------------------->   Check group FAQ 
at:> <A 
href="" 
target=_blank>http://groups.yahoo.com/group/amibroker/files/groupfaq.html>>   
Your use of Yahoo! Groups is subject to the Yahoo! Terms 
ofService.------------------------ Yahoo! Groups Sponsor 
---------------------~-->Get A Free Psychic Reading! Your Online Answer 
To Life's Important Questions.<A 
href="" 
target=_blank>http://us.click.yahoo.com/Z_CBYA/vB5FAA/AG3JAA/GHeqlB/TM---------------------------------------------------------------------~->Send 
BUG REPORTS to bugs@xxxxxxxxxxxxxSend SUGGESTIONS to 
suggest@xxxxxxxxxxxxx-----------------------------------------Post 
AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx(Web page: <A 
href="" 
target=_blank>http://groups.yahoo.com/group/amiquote/messages/)--------------------------------------------Check 
group FAQ at: <A 
href="" 
target=_blank>http://groups.yahoo.com/group/amibroker/files/groupfaq.htmlYour 
use of Yahoo! Groups is subject to <A href="" 
target=_blank>http://docs.yahoo.com/info/terms/






Yahoo! Groups Sponsor












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.


Attachment: Description: ""