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

RE: [amibroker] Backtest Sell/Cover problem



PureBytes Links

Trading Reference Links

Title: Backtest Sell/Cover problem

Nathan,

 

Can't think of an easy way. You could put your Params directly in your code and change based on selected ticker if you don't have too many.

 

If (Name() == "MSFT") scaleValue = 1;

If (Name() == "AAPL") scaleValue = 2;

Etc.

 

A file would obviously work too. You could loop for tickers using StrFind function.

 

--

Terry

-----Original Message-----
From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf Of WALTON, Nathan
Sent: Wednesday, November 02, 2005 16:51
To: amibroker@xxxxxxxxxxxxxxx
Subject: RE: [amibroker] Backtest Sell/Cover problem

 

AH!

 

Thank you so much, Terry. That's got to be it. I use Param to set the value of the scale for "Foreignscaled", however I set the default value of scale to 1. I'm not well informed on the intricacies of backtester but it would make sense for it to use the default value.

 

As a follow up then, is there an easy way to save Params for tickers individually, other than say, writing to a file, so that they can be recalled for the backtester?

 

Again, thank you so much for providing the answer.

Cheers,
Nathan

 

-----Original Message-----
From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx]On Behalf Of Terry
Sent: Thursday, 3 November 2005 9:56 AM
To: amibroker@xxxxxxxxxxxxxxx
Subject: RE: [amibroker] Backtest Sell/Cover problem

Nath,

 

Did someone answer your question? If not, try this…

 

Code looks OK. I suspect you have a different ticker selected on Chart vs. Backtest. Since there's no code for your Foreigncaled I can only assume the values never cross whatever you have selected to trade.

--

Terry

-----Original Message-----
From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf Of WALTON, Nathan
Sent: Tuesday, November 01, 2005 16:55
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] Backtest Sell/Cover problem

 

Hi

I've got an odd problem that I've been wrestling with for a few days:

I have a lovely (albeit simplistic) plot with my buy/short/cover/sell signals all prominently displayed. However, when I run a backtest on this, I get one open trade at the start and that's it. There are sell/cover indicators all over my plot (in the appropriate locations too) but they seem to be ignored. Relevant code below. "Foreignscaled" refers to a "Foreign" close.  I've tried other sell/cover conditions that use Foreign data and they seem to work ok. It must be something stupid but I can't step back and see it.

Buy = C < Foreignscaled - 0.01;
Short = C > Foreignscaled + 0.01;

Sell = C >= Foreignscaled;
Cover = C <= Foreignscaled;

Buy = ExRem(Buy, Sell);
Sell = ExRem(Sell, Buy);

Short = ExRem(Short, Cover);
Cover = ExRem(Cover, Short);

PlotShapes( IIf( Buy , shapeUpArrow , shapeNone ),
            colorGreen, 0, Graph0, -12 );
PlotShapes( IIf( Sell , shapeDownArrow, shapeNone ),
            colorPink, 0, Graph0, -12 );
PlotShapes( IIf( Cover , shapeUpArrow , shapeNone ),
            colorBlue, 0, Graph1, -12 );
PlotShapes( IIf( Short , shapeDownArrow, shapeNone ),
            colorRed, 0, Graph1, -12 );

 

Any help would be greatly appreciated.

Thanks,
Nath

 




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





SPONSORED LINKS
Investment management software Real estate investment software Investment property software
Software support Real estate investment analysis software Investment analysis software


YAHOO! GROUPS LINKS