
Indicators are very powerful in MT4 expert advisor (EA) to predict trends and useful if it is set in a correct way. One of the popular indicator often used in programming EA using the Editor is SMA.
Using SMA have a few configuration. In order to provide the date to superimpose this indicator onto a currency chart, it will requires 3 inputs.
1) Periods - this will tell the indicator to take the number of historical bars (depending on your chart time frame) to calculate the average value.
2) OHLC - Open, High, Low or Close. You have to choose one to be the value to calculate. Different OHLC will yield different trends from this indicator
3) Methods - Usually is simple method to calculate which weights the number of periods equally when getting the average. Some uses exponential which will put more weight-age on recent history bars then older historical bars.
Attached a SMA (24 periods, Close, Simple) on a EURCHF chart on 1 Hour time fame. The SMA is in red colour and you can clearly see a downward trend from 16 Dec to 22 Dec. The red line is above the currency bar 90% of the time.
In order to use this SMA, you can program it to compare with the current currency EURCHF value. If consecutive 6 hours (6 bars) the currency close value is lower then SMA value. And the SMA value between SMA previous value is >20 pips (gradient over 6 hours). This will show that it is a srong down trend and a sell order can be executed.
Likewise between 23 Dec to 27 Dec, SMA (red line) is lower then the OHLC currency bar. This will show that there is a strong uptrend and for consecutive 6 hours, SMA value is lower and gradient over 6 hours is more then 20 pips, a Buy order can be issued.
For the Take profit setting would be 60 pips as the gradient is >20pips over 6 hours and assuming the trend will last for another 12 hours or more. And the stoploss would be 60 pips as well, but be careful as you can see the retraction on 21 Dec is as high as 80 pips which could stoploss the trade before you can hit take profit. So for the stoploss you may want to set it at 100pips and set a higher profit take at 160pips or 200 pips as you can see the trend is strong from 20 Dec to 21 Dec.
No comments:
Post a Comment