-----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.
-----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