Dear All,
I am trying to simulate a portfolio of strategies in Amibroker. I have 4
strategies, which I run and then save their EQUITY curves by using the following code at the end of each script
SetCustomBacktestProc("");
if( Status("action") == actionPortfolio )
{
bo = GetBacktesterObject();
bo.Backtest();
AddToComposite( bo.EquityArray,
"~~~MY_EQUITY_COPY", "X",
atcFlagDeleteValues | atcFlagEnableInPortfolio );
}
I then add the 4 new tickers (from the ~~~EQUITY) to a new watch list and then I run a simple
buy-hold strategy script on them. The script I use is the following one:
SetOption( "CommissionMode", 2 );
SetOption( "CommissionAmount", 3 );
SetOption( "InitialEquity", 200000 );
SetPositionSize( 25, spsPercentOfEquity );
MaxPos = 4;
SetOption( "MaxOpenPositions", MaxPos );
SetOption( "MinShares", 1 );
SetOption( "MinPosValue", 1 );
SetOption( "accountmargin", 100 );
SetOption( "ReverseSignalForcesExit", False );
SetOption( "UsePrevBarEquityForPosSizing", False );
SetOption( "PortfolioReportMode", 2 ); //0 = tradelist, 2= summary
SetTradeDelays( 0, 0, 0, 0 );
Short = Cover = 0;
Buy = Status( "firstbarintest" );
Sell = Status( "lastbarintest" );
Buy = True; Sell= False;
My problem is that the script does not execute any buy with the new tickers created from the ~~~EQUITY. But I
have tested it extensively with other "real" tickers (like AAPL etc...) and it works perfectly. I
cannot understand why it does not work for the tickers I created from the EQUITY
curves.
Any suggestions?
Kr
Davide
I am trying to simulate a portfolio of strategies in Amibroker. I have 4
strategies, which I run and then save their EQUITY curves by using the following code at the end of each script
SetCustomBacktestProc("");
if( Status("action") == actionPortfolio )
{
bo = GetBacktesterObject();
bo.Backtest();
AddToComposite( bo.EquityArray,
"~~~MY_EQUITY_COPY", "X",
atcFlagDeleteValues | atcFlagEnableInPortfolio );
}
I then add the 4 new tickers (from the ~~~EQUITY) to a new watch list and then I run a simple
buy-hold strategy script on them. The script I use is the following one:
SetOption( "CommissionMode", 2 );
SetOption( "CommissionAmount", 3 );
SetOption( "InitialEquity", 200000 );
SetPositionSize( 25, spsPercentOfEquity );
MaxPos = 4;
SetOption( "MaxOpenPositions", MaxPos );
SetOption( "MinShares", 1 );
SetOption( "MinPosValue", 1 );
SetOption( "accountmargin", 100 );
SetOption( "ReverseSignalForcesExit", False );
SetOption( "UsePrevBarEquityForPosSizing", False );
SetOption( "PortfolioReportMode", 2 ); //0 = tradelist, 2= summary
SetTradeDelays( 0, 0, 0, 0 );
Short = Cover = 0;
Buy = Status( "firstbarintest" );
Sell = Status( "lastbarintest" );
Buy = True; Sell= False;
My problem is that the script does not execute any buy with the new tickers created from the ~~~EQUITY. But I
have tested it extensively with other "real" tickers (like AAPL etc...) and it works perfectly. I
cannot understand why it does not work for the tickers I created from the EQUITY
curves.
Any suggestions?
Kr
Davide