I want to study if the odds of an up or down day in a forex pairs is 50-50. I just count the total number of up and down days in X years and compare it with the total days. The results are very similar to a 50-50 chance. Now I want to see if by applying an EMA200 filter you have more probabilities of an up day if the closing price is above the EMA, and vice-versa for a closing price below the EMA. The results show that it´s more probable to obtain an up day if the closing price is above the EMA. The question is: Does the test have any bias? I am worried that the results aren't true because of a bias in the test. Because the EMA depends on the price, maybe it´s just obvious that there are most up days if the price is above the EMA.
$ema = EMA(Close,200);
foreach (NewDay) { $Totaldays++;
if (Today(Close) > Today(Open)){ $Totalup++; }
if (Today(Close) < Today(Open)){ $Totaldown++; }
if (Today(Close) == Today(Open)){ $Totaldojis++; }
if (Today(Close) > Today($ema)){ $Totalabove++;
if (Today(Close) > Today(Open)){ $Upabove++; }
if (Today(Close) < Today(Open)){ $Downabove++; }
if (Today(Close) == Today(Open)){ $Dojisabove++; }
}
if (Today(Close) < Today($ema)){ $Totalbelow++;
if (Today(Close) > Today(Open)){ $Upbelow++; }
if (Today(Close) < Today(Open)){ $Downbelow++; }
if (Today(Close) == Today(Open)){ $Dojisbelow++; }
}
}