| stevehopwoodforex.com https://www.stevehopwoodforex.com/phpBB3/ Print view |
|
| Empty4 4 - Trade when the EMA 10 touches the EMA 20? https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=2171 |
Page 1 of 1 |
| Author: | mrmagic [ Tue May 21, 2013 2:16 pm ] |
| Post subject: | Empty4 4 - Trade when the EMA 10 touches the EMA 20? |
Hello guys, I am not a noob in programming, however, I am new Empty4. I want to create a simple ea. I want to trade when the EMA 10 touches the EMA 20. Please give some code on how to program this touch in the Empty4 language. Thx in advance!!! |
|
| Author: | gaheitman [ Wed May 22, 2013 9:36 am ] |
| Post subject: | Re: Empty4 4 - Trade when the EMA 10 touches the EMA 20? |
First of all, you need to think through how to translate what you see into what is happening mathematically. It's easy to look at a chart and see that two MAs are touching. Sometimes it happens during the current bar, but often it happens in the space between bars. The MAs can also touch and then move apart again so that there is no visual record of them touching when viewing history. Since the mathematical value of two MAs will seldom be equal, you are really looking for a cross of the MAs. In order to capture the cross on the current bar as well as the cross that happened between the current bar and the last bar, you need to look and see if the order of the two MAs has changed between the close of the previous bar and the "close" of the current bar. (The MA of the "close" of the current bar is actually the current value of the MA.) So, to get the MAs of the previous bar, you would use code similar to: Code: Select all Code: Select all Code: Select all If you want to ignore crosses that happen between the bars, you will need to capture the Cur10 and Cur20 values immediately at the open of the new bar, save them to a different variable and do the comparisons to them. George |
|
| Author: | mrmagic [ Tue Jun 04, 2013 5:43 am ] |
| Post subject: | Re: Empty4 4 - Trade when the EMA 10 touches the EMA 20? |
thx you very much for your answer!!! |
|
| Author: | jimmyjjohn [ Wed Sep 04, 2013 7:05 am ] |
| Post subject: | Re: Empty4 4 - Trade when the EMA 10 touches the EMA 20? |
Legend Brokers the world’s leading Forex news and views portal, has become a one-stop solution provider for Forex traders and brokers as well as Bitcoins news. It provides all the required tools to individuals to become a professional Forex trader. Also, it helps Forex brokers provide high-end user-friendly trading experience to traders with an array of resources e.g. financial news by the minute, fundamental analysis, technical analysis, Forex tools and others. Thanks in advanced! |
|
| All times are UTC | Page 1 of 1 |
|
Powered by phpBB® Forum Software © phpBB Limited |
|