| 
 Hello, 
  
It works, but there are some things that need to be 
mentioned. 
  
The fact is that scaling signals do not hold score or round 
lot size because this information is  
stored in initial buy signal that is used under normal 
circumstances.  
There is no need for scaling signals to be sorted as well 
because scaling operates 
on already open positions and AmiBroker under normal 
circumstances just matches 
scaling signals to open position list. It is similar to exit 
signals. *ALL* exit and scaling signals 
are tracked (opposite to entry signals where only top 2 * max( 
worstrankheld, maxopenpositons) entry 
signals are tracked. 
  
Since this formula abuses scaling in 
signals so they become first entry signals it is not possible 
to use user-defined scoring / ranking using this 
formula. 
  
What you have pointed out correctly is that since PosScore and 
RoundLotSize hold empty for scaling in signals 
they should not be passed to EnterTrade function. 
  
I have corrected this in the KB article. 
 Best regards, Tomasz Janeczko amibroker.com 
  ----- Original Message -----  
  
  
  Sent: Tuesday, April 25, 2006 3:01 
  PM 
  Subject: Re: [amibroker] Why portfolio 
  backtester does not consider all buy signals? 
  
  
  TJ: 
    
  The sample code didn't work. I did a trace of the 
  scaleIn signals, and found: 
  1. the scaleIn signals were not sorted by 
  PositionScore but by alphanumeric order. 
  2. actually the PosScore and RoundLotSize is 
  EMPTY for scaleIN signals. 
  3. I still had the 1e+010 shares problem when 
  using scaleIn. 
    
  (To compare, I removed the scaleIn code and 
  changed sig.IsScale() to sig.IsEntry(), the trace showed that the entry 
  signals were sorted as expected) 
    
  Thanks, 
    
  -Mark 
        
       if (sig.IsScale() AND sig.Price != -1 AND                IsNull( bo.FindOpenPos( sig.Symbol ) ) )            {             // Entry Signal  
  _TRACE("Entry " + sig.symbol + " " + NumToStr(sig.PosSize) + "/" + NumToStr(sig.PosScore) + "/" + NumToStr(sig.RoundLotSize) + "@ $" + NumToStr(sig.Price));            if( bo.EnterTrade(bar, sig.symbol, sig.IsLong(),                  sig.Price,sig.PosSize ) == 0 )             {               // if certain trade can not be entered due to insufficient funds               // or too small value (less than ”MinPositionValue”) or               // to few shares (less than ”MinShares"               // then do NOT process any further signals               bContinue = False;             } 
  
  
    ----- Original Message -----  
    
    
    Sent: Monday, April 24, 2006 8:27 
    AM 
    Subject: Re: [amibroker] Why portfolio 
    backtester does not consider all buy signals? 
    
  
    thanks a lot it looks great at the first 
    glance. So little code necessary to do it.  I am trying to build it 
    into my current system at this moment, 
      
    rgds, Ed 
      
      
    
      ----- Original Message -----  
      
      
      Sent: Monday, April 24, 2006 12:53 
      PM 
      Subject: Re: [amibroker] Why 
      portfolio backtester does not consider all buy signals? 
      
  
      "Who has studied this?" 
        
      I have studied this and these are results of hundreds of 
      my own tests of various systems I have done in the past. 
        
      But I can agree that you may have different 
      opinions/experiences and you may want to test redunant 
      signals. 
      And this is perfectly doable as I have shown using 
      either rotational trading (for some cases) and/or 
      custom backtest procedure (for all remaining cases). I 
      even wrote sample formula for you. 
      See this post: 
      
        
      (I have reposted this sample to the knowledge base know 
      for your convenience): 
      
        
      Also as suggested, I may consider adding an "easy" 
      switch in some future releases. 
       Best regards, Tomasz Janeczko amibroker.com 
      
        ----- Original Message -----  
        
        
        Sent: Monday, April 24, 2006 8:11 
        AM 
        Subject: Re: [amibroker] Why 
        portfolio backtester does not consider all buy signals? 
        
  
        
        > There are other reasons such as the fact that 
        practice shows that delayed signals are very often very poor performer 
        so it is better to skip trade instead of entering it 
        too late. 
        > This may be true to many systems. 
        But certainly not all of them. My most profitable system happens 
        to do better with later signals. It buys dips and later 
        signals are  
        > more likely to > bounce back. 
        IMO, a backtest software should be neutral to trading systems (i.e. not 
        to prefer a particular  kind of practice) 
          
        Who says delayed signals are poor performers.  
        Who has studied this?  I am certain that redundant signals can be 
        used succesfully in portfolio type systems.  So my request is again 
        to get a simple example of how to do this on a portfolio level. There 
        are examples on a single symbol level but on a portfolio level is what 
        is interesting. 
          
        rgds, Ed      
  
Please note that this group is for discussion between users only. 
 
To get support from AmiBroker please send an e-mail directly to  
SUPPORT {at} amibroker.com 
 
For other support material please check also: 
http://www.amibroker.com/support.html 
 
  
  
 
  
    
  YAHOO! GROUPS LINKS
 
 
    
 |