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

[amibroker] Re: TopXXX Volume



PureBytes Links

Trading Reference Links




<FONT face=Arial 
color=#0000ff size=2>Thanks very much h!
<FONT face=Arial 
color=#0000ff size=2> 
<FONT face=Arial 
color=#0000ff size=2>I'll look this over today and see what I can do with 
it.
<FONT face=Arial 
color=#0000ff size=2> 
<FONT face=Arial 
color=#0000ff size=2>BTW - I've heard nothing from TJ on the import problem I'm 
having with the script I wrote - perhaps he'll respond better to you. I haven't 
had much luck with emails to him lately.
<FONT face=Arial 
color=#0000ff size=2> 
<FONT face=Arial 
color=#0000ff size=2>I'll forward the email I sent to him to 
you.
<FONT face=Arial 
color=#0000ff size=2> 
<FONT face=Arial 
color=#0000ff size=2>d

  
  
  From: Herman van den Bergen 
  [mailto:psytek@xxxxxxxx] Sent: Wednesday, April 14, 2004 8:26 
  AMTo: amibroker@xxxxxxxxxxxxxxxSubject: RE: [amibroker] 
  Coding challenge - Subtotals
  
  <FONT face=Arial 
  color=#0000ff>The trade list has all the information you need, Right? 
  Have another look at the tradelist and see the wealth of (afl inaccessible) 
  info it contains. 
   
  <SPAN 
  class=562014210-14042004>I trade 
  portfolios too, and i want to see how individual stocks perform. The only 
  place to get the stats is from the tradelist, there is no other way 
  - especially when trading portfolios.
  <FONT face=Arial 
  color=#0000ff> 
  <FONT face=Arial 
  color=#0000ff>In your case you would sort the tradelist by 
  ticker and then extract the stats for each ticker for more processing. I 
  am getting  tired of explaining the benefits of having access to a 
  tradelist from afl, it appears so obvious to me. I garantee that this function 
  will be available eventually, it just has to be in order to do any serious 
  system analysis.
  <FONT face=Arial 
  color=#0000ff> 
  <FONT face=Arial 
  color=#0000ff>Below<FONT 
  face=Arial color=#0000ff size=2> is a simple String-based function that 
  extracts trade information from the Tradelist, if you click on a bar that 
  had a trade it will display the chart for the stock traded on that day else 
  the pane is blank. If there were more trades on that day you can look at the 
  different trades by using Param(). You can also use Param() to 
  extract other isolated stats that will display in the Title. This is just 
  a test program and illustrates SINGLE stats, to diplays stats over time you 
  need to place it in a loop <FONT 
  face=Arial color=#0000ff size=2>but it will be extremely SLOW!!! I suggest you 
  test it using a short trade list :-) 
  <FONT face=Arial color=#0000ff 
  size=2><FONT face=Arial 
  color=#0000ff size=2> 
  <FONT face=Arial color=#0000ff 
  size=2>After exporting your TradelList to <FONT 
  face="Courier New">"C:\\Program 
  Files\\AmiBroker\\Trades\\TradeList.csv"<FONT 
  color=#000000>; 
  <FONT face=Arial 
  color=#0000ff size=2>Copy the code below to the IB and Apply. Then click 
  on any bar that has a new trade, since the code only responds when you hit the 
  first bar of a trade you may have to click a few time to find them, or look 
  for a date in your tradelist. Just remember that this is experimental and 
  unfinished code.
  <FONT face=Arial color=#0000ff 
  size=2> 
  Let 
  me know if you think this could be the basis for further 
  work.
  <FONT face=Arial color=#0000ff 
  size=2>herman
  
  
  
  // 
  ReadTradeListFunction_N(path="C:\\Program 
  Files\\AmiBroker\\Trades\\TradeList.csv");global 
  Header;
   
  <FONT face=Arial color=#0000ff 
  size=2>function EODgetStat( CurrentDate , TradeNum, FieldNum 
  ) { FieldData = ""; if( fh = fopen( Path, "r") 
  ) {  i=0;j=0;    while( ! feof( fh 
  ))     {   if(i++==0) Header = fgets( fh 
  );        S1 = fgets( fh 
  );   DateIn = StrExtract(S1,2);   if( 
  CurrentDate == 
  DateIn)   {    j++;    if( 
  j == TradeNum 
  )    {     FieldData= 
  StrExtract(S1,FieldNum);    }   }  } } else  {  
      printf("ERROR: file can not be found (does not 
  exist)");  } fclose( fh ); return 
  FieldData;}
   
  <FONT face=Arial color=#0000ff 
  size=2>Newday  = IIf(DateNum() != Ref(DateNum(),-1),1,0);DayNum 
   = Cum(NewDay);n    = 
  SelectedValue(BarIndex());DN   = DateTime();DNs 
    = StrLeft(WriteVal(DN[n],formatDateTime),8);FieldNum = 
  Param("FieldNum",8,0,20,1);TradeNum = 
  Param("tradeNum",1,1,10,1);
   
  <FONT face=Arial color=#0000ff 
  size=2>FieldData = EODgetStat( DNs, TradeNum, FieldNum);Ticker = 
  EODgetStat( DNs, TradeNum, 0);if(Ticker == "") Q = Null; else Q=1; 
  SetForeign(Ticker);Plot(Q*C,"",1,64);
   
  <FONT face=Arial color=#0000ff 
  size=2>if(Q) Title = DNs+"   "+Ticker+"  "+StrExtract(Header, 
  FieldNum)+ "  "+ EODgetStat( DNs, TradeNum, FieldNum); else 
  Title="";
   
  
  
  
  <FONT face=Arial color=#0000ff 
  size=2> 
   


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








Yahoo! Groups Links
To visit your group on the web, go to:http://groups.yahoo.com/group/amibroker/ 
To unsubscribe from this group, send an email to:amibroker-unsubscribe@xxxxxxxxxxxxxxx 
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.