Yes.

Best regards,
Tomasz Janeczko
amibroker.com
  ----- Original Message ----- 
  From: [email protected] 
  To: [email protected] 
  Sent: Thursday, February 12, 2009 4:43 AM
  Subject: [amibroker] TJ: Safe to assume entries signals are always before 
exit signals in CBT?


  The portfolio backtest code sample below does something special with entry 
signals but does not touch the exit signals.  Note the sig.IsEntry test in the 
for loop. This loop implementation attempts improve the execution speed by 
assuming all entry signals are at the front of the signal list and all exit 
signals are after the entry signals. The loop stops as soon as the first exit 
signal is found so no time is wasted looping over the remaining exit signals. 
Is this a valid assumption?

  Thanks,
  Steve

    for (bar = 0; bar < BarCount; bar++)
    {
      for (sig = bo.GetFirstSignal(bar); sig && sig.IsEntry; sig = 
bo.GetNextSignal(bar))
      {
          Do something with entry signal ...
      }
      bo.ProcessTradeSignals(bar);
    }  
      




  

Reply via email to