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

[amibroker] How to calculate time since trade entry/exits in custom backtester



PureBytes Links

Trading Reference Links

Hi - trying to calculate the time in bars (or days) since a trade
was exited in the custom backtester. So what I would like to do is:

maxBars = 30;
for(bar=0; bar<BarCount; bar++)
{
   for( trade=bo.GetFirstTrade(); trade; trade=bo.GetNextTrade() )
   {
     if (bar - trade.ExitBar < maxBars)
       {
       //doSomething with recent trades
       }
   }
}

however "ExitBar" is not a valid property of tradeObject. Only
ExitDateTime. But DateTime format seems difficult to do timespan
calculations on (unless I missed something). Any suggestions on how
to go about it?

Thanks - and Best regards

Jens Tiedemann







------------------------ Yahoo! Groups Sponsor --------------------~--> 
Get to your groups with one click. Know instantly when new email arrives
http://us.click.yahoo.com/.7bhrC/MGxNAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

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/