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

[amibroker] hedging - is it possible to control individual exits in CB?



PureBytes Links

Trading Reference Links

Hello

In order to hedge Forex trading, I'm running two independent trading 
systems. One performs well in certain situations, the other 
under "opposite" conditions. 

However, the two systems will often provide "opposite" tradesignals 
(long/short), even in the same bar. I still want to take the two 
trades, as they have different exit criteria. 

In order to control multiple trades on the same bar independently, 
I've been trying to use "backtestRegularRawmulti" with custom 
backtester. Entering multiple trades on a bar works fine this way 
(using positionScore to indicate to the custom backtester if two 
positions in the same direction should be taken). 

However, I have a hard time figuring out a way to control the exits. 
bo.ExitTrade() seem to exit the first (last?) entered open position 
and have no parameter to indicate what position to close - so unless 
the trades come in a certain order (they don't), the wrong trades are 
being closed out. So I've been trying to use sigScaleIn/Out in 
various ways, but with no luck.

Also, I've been trying to use the applyStop(stopModeBars) as a 
trigger mechanism (but pos.barsInTrade is a readOnly property - so 
I've not been able to force an exit this way on an individual open 
position). 

Is there a way to control exits independently? Like if the trade 
object had a pos.ExitTrade() method, or by some other means? 

Regards
Jens Tiedemann




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

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 NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

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/

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