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

[amibroker] Backtester doesn't show trades, but DebugView does



PureBytes Links

Trading Reference Links

I have for loop code that looks for entries and exits like this 
(obviously pseudo-code):

for( i = 1; i < BarCount; i++ )
{

//    EXITS
If cond1 then {
  If bInLong then {
    Sell[i] =1
    _TRACE("sell at " + price)
  }
}

If cond2 then {
  If bInShort then {
    Cover[i] = 1
    _TRACE("cover at " + price)
  }
}

//    ENTRIES
If cond3 then {
  If Not bInLong then {
    Buy[i] = 1
    _TRACE("buy at " + price)
  }
}

If cond4 then {
  If Not bInShort then {
    Short[i] = 1
    _TRACE("short at " + price)
  }
}

}

The problem is, when I run this in the backtester it shows a few 
trades when it should show dozens.  Much stranger though is I have 
DebugView running and the TRACE statements are writing out many 
times more trades that what I see in the backtester results window.  

Is there some basic flaw to my understanding of how looping code 
works in the backtester?  

Is my 'Buy[i] = 1' construct the wrong way to do this?  

Are there some more complex for loop examples that I could use as a 
guide?

Thanks for any insight,
Brian

  





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

<*> 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:
    http://docs.yahoo.com/info/terms/