Hi. I’m getting what should be an impossible pair of results from the signal tester. I’m testing two versions of the same signal. The first version I call the “No SPXBull” version with the following script:
The second “SPXBull” signal’s script is the same as the first one except that it adds code to filter on the basis of the S&P 500 50-day SMA being above its 200-day SMA:
Here’s the strange result. The first “No SPXBull” signal is yielding 21,535 results. The second “SPSBull” signal is yielding 88,896 results, 4X the number of results without the SPX Bull filter. This is, of course, logically impossible. I’ve run both tests twice to double check the outcomes. I’ve uploaded here a worksheet with the graphic and exported results for the two signals. Illogical Signals Results.csv (4.7 KB)
Is there something I’m not considering here? Something I’m doing wrong? Thanks very much!
I think it’s an issue when using weekly signals on daily data. A good way to check your formula is to put it into a Show Bar to highlight every signal.
Using the V4 formula - which includes the weekly JDKRS function - it will signal for every day of the week on a daily chart because the weekly condition is true:
You could use the NOREPEAT function to only take the first signal, but the other issue with using weekly signals on daily data is that the signal is being taken on the Monday based on the RRG quadrant value of the following Friday - which in real life would not have happened yet, therefore skewing the results.
As such, you need to wait for the end of the previous week to get the confirmed RRG quadrant before taking the signal on the Monday. You can do that by changing the offsets in V2 and V3:
D1 = GETDATA(CODE=SPX, BARS=200:WI);
MA1 = MA(D1, BARS=50);
MA2 = MA(D1, BARS=200);
SPXBull = MA1 > MA2;
V1 = JDKRS(Week(PERIODAMOUNT=1)).Quadrant;
//Wait for the weekly data to be confirmed;
V2 = V1[1] == 3;
V3 = V1[2] == 2;
V4 = V2 and V3;
//Only take the 1st daily signal of the following week;
NOREPEAT(V4 and SPXBull, BARS=5)