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

[amibroker] Re: Hedge Bet Control



PureBytes Links

Trading Reference Links

By default, the backtester will only ever allow you to have a single 
position open for a symbol at any one time.

I've never tried to do what you are describing. But, if it is 
possible, you may need to change the backtest mode to 
backtestRegularRawMulti using SetBacktestMode.

http://www.amibroker.com/guide/afl/afl_view.php?id=350

This might then require you to write custom backtest code to clean 
out the signals you didn't want. Read the guide in the Files section 
of this group posted by gp_sydney for how to work with the custom 
backtester.

Mike

--- In amibroker@xxxxxxxxxxxxxxx, "ozzyapeman" <zoopfree@xxx> wrote:
>
> I know that hedge betting is generally a fool's bet. But there may 
be
> some rare instances when I want both a Long position and a Short
> position open at the same time (still experimenting with that 
concept).
> 
> Anyway, I can't get the backtester to have two such trades open
> simultaneously and hope someone can be of help. According to my
> understanding the below code placed at the begining of the formula
> (especially the bolded lines) are correct for hedging. And in the
> backtester General Settings I should set Positions to "Long and 
Short",
> and uncheck the box for "Reverse entry signal forces exit". I have 
done
> that, but still the backtester does not allow a Long or Short to be 
open
> when the reverse is already open.
> 
> Any help much appreciated.
> 
> SetBarsRequired(10000, 10000);
> SetFormulaName("1-0 Initial Attempt");
> SetOption("CommissionAmount", 4.00);
> SetOption("CommissionMode", 2);
> SetOption("InitialEquity", 100000);
> SetOption("MaxOpenPositions", 2);
> SetOption("PriceBoundChecking", 1);
> SetOption("UsePrevBarEquityForPosSizing", 1);
> SetTradeDelays( 1, 1, 1, 1 );
> SetPositionSize(1,spsShares);
> SetOption( "ReverseSignalForcesExit", 0 );
>



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

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/