molanis.com/forum - Tools for MetaTrader : The place to ask about the best expert advisor builder, expert advisor downloads, and expert advisor programming
http://www.molanis.com/forum/

Additional Test for Crossovers
http://www.molanis.com/forum/viewtopic.php?f=13&t=493
Page 1 of 1

Author:  geoffinaus [ Thu Sep 08, 2011 1:51 am ]
Post subject:  Additional Test for Crossovers

When you have an EA for eg a simple moving average crossover that says you Buy or Sell on the close of the bar, but when you look at the chart you see that the current price has moved a long way from the crossover point and you would not have bought or sold. You would have waited for a retracement back close to the crossover price or just let the trade go and wait for another

How can I create an EA for the above

Author:  molanisfx [ Thu Sep 08, 2011 8:27 am ]
Post subject:  Re: Additional Test for Crossovers

Look at the Examples. I re tested them after the upgrade on the weekend. There are many ways to define a crossover Read this: viewtopic.php?f=2&t=131&start=0&hilit=crossover
You could compare the values in the current bar with the previous bar, or the previous bar with one bar before the previous bar, or have a mix. You need to define what is better for you to decrease false and too many signals. We stated in the example:
Quote:
Please note that MA Crossovers can be defined in several ways. We use the definition from the MT5 article which reduces flickering.

The definition in the article does not include the current bar, so signals appear delayed one bar.
You can change all shift 1 for shift 0 and shift 2 for shift 1 and get different results.
In the expert advisor example page for mt5 http://www.molanis.com/products/expert- ... visors-mt5, there are some charts that show the difference between trading the current and the previous bar.
Note that examples 1 to 4 are not crossovers. A real crossover compare 2 bars. Example 5 is the only crossover but it does not use the current bar, it compares the previous bar with the bar before the previous bar. It uses shift 2 for bar before the previous bar and shift 1 previous bar.
Finally in reality you do not trade with the close, because the only way to know a tick is the close price is receiving the next tick or open price of the next bar. When you trade bars, you trade the first tick of the new bar (or open price)

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/