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

AFTER YOU REGISTER SEND US AN EMAIL TO ACTIVATE YOUR ACCOUNT - Before posting:-1- Please read the user guide -2- Try the examples -3- Search in the forum
It is currently Fri May 03, 2024 11:15 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Additional Test for Crossovers
PostPosted: Thu Sep 08, 2011 1:51 am 
Offline

Joined: Wed Jul 27, 2011 6:22 am
Posts: 14
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


Top
 Profile  
 
 Post subject: Re: Additional Test for Crossovers
PostPosted: Thu Sep 08, 2011 8:27 am 
Offline

Joined: Tue Dec 22, 2009 12:22 am
Posts: 1761
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)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by Molanis © 2009