7
$\begingroup$

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++; } 
    }

}

$\endgroup$
  • $\begingroup$ Hi tn240, welcome to Quant.SE! I find it hard to figure out what the exact experimental set-up is you have, other might too. Can you maybe provide some pseudocode of your algorithm so it is easier to understand what you're doing? $\endgroup$ – Bob Jansen Aug 27 '15 at 6:11
  • $\begingroup$ Please add this to the question, comments are not meant for this. $\endgroup$ – Bob Jansen Aug 29 '15 at 11:53
  • $\begingroup$ FX runs 24/7 depending on when you choose to start/end your days, your result will be completely different! $\endgroup$ – pyCthon Feb 25 '16 at 20:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.