Moving Average Crossover also trades when price crosses
-
Please see my MAcrossover by jimsterling. It is making the trades correctly when the moving averages cross but it also initiates trades when the price crosses the longer moving average which complete changes the results.
Hope you can fix this soon.
Thanks,
Jim
-
It looks like this for me: http://prntscr.com/5o6ltw I think that it's fine. One of the slow MAs is exponential, that's why there are two long MAs over there, but this is your project. Otherwise it looks correct for me.
If you are talking for those moments that does not look as a crossover AFTER the backtest ends, then this is because the current candle is used for the crossover and as you know, the current candle is unfinished. So there were some crossovers that "disappeared" before the current candle's end.
-
My mistake. Thanks for looking at this.
I have a new problem I hope you will look at. Ever since I added Variables as the moving averages it no longer generates any trades.
Many thanks,
Jim
-
Condition -> Value -> Numeric -> right-click over the input field and choose the variable from the list
Those variables you are using are also called global variables, but they are different kind of global variables

-
I see. I'm still not getting any trades. Do I need to eliminate the Global variables?