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

[amibroker] Using Custom backtester to enter list of trades (by time), ExitTrade issues



PureBytes Links

Trading Reference Links

I've been looking into setting up the custom backtester so I can
import lists of (historical) trades and use Amibroker to calculate the
statistics. I've got most of the basics figured out, except I don't
know how to specify a position size in ExitTrade()! [Is this even
possible? Or should I use a different approach]

For example, how do I handle situations like:
Buy 2 @ 927.2
Sell 1 @ 929
Sell 1 @ 929.4

If I use:
bo.EnterTrade(...2 trades)
when I do
bo.ExitTrade()
This exits the entire position!

It's easy enough the other way, where I buy 1 buy 1 sell 2, because
EnterTrade() has a PositionSize field, but Exittrade() doesn't. I'd
appreciate any input or suggestions on how to solve this problem.

Reference:
http://www.amibroker.com/guide/a_custombacktest.html
Specifically:
long ExitTrade( long Bar, string Symbol, float Price, [optional]
variant ExitType )



------------------------------------

**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to 
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> 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/