Experimenting with the code given above in this thread, I changed the
output to include the signal type, and altered the signal setup like
so (these are the altered lines only):
// experiment - produces 4 signals per symbol (types 1,2,3,4)
// Short signal (type3) has PosScore negative of Long signal (type1)
Buy=1; Sell=0; Short = 1; Cover = 0;
SetBacktestMode( backtestRegularRawMulti );
Line = sig.Symbol + "," + sig.Type + "," + sig.PosScore + "\n";
The output produced was like this:
Date : 1/9/2007
AA,3,-67.0314
AA,1,67.0314
...
AA,2,{EMPTY}
AA,4,{EMPTY}
etc. for other dates and symbols.
In the interest of understanding the custom backtest processing
better, I have several questions.
1. Sig.PosScore is reported with opposite sign for Buy and Short
signals, but there is only one formula in the code for PositionScore.
What is the explanation for this behavior, and is it documented
anywhere?
2. Since Sell and Cover are set to 0, why are Sell and Cover signal
lines present?
3. Why does sig.PosScore come up empty for Sell and Cover signals?
Thanks to anyone who's got the experience with this to provide
comments ...