NATR/EMA Contest Strategy
Hello, in this blog I will explain how my strategy works. This strategy is using only 2 indicators, NATR and EMA indicator. The EMA indicator is used as a direction of the current trend, and the NATR indicator is used as a trigger to enter trade.
EUR/USD is the currency pair for this strategy.
Now let us see how EMA indicator is used in this strategy.
Above is EMA indicator with time period of 50 on 30 minutes EUR/USD pair. When the price is above the EMA line, trend is considered bullish and when the price is below EMA line, trend is considered bearish. There is also a logic to check whether EMA line is currenty heading up or down when entering trade. We will only enter trade when the EMA line is going up or down, not when the EMA line begin to change direction. There is logic in strategy source code to check for direction change.
For NATR indicator.
The red line is NATR indicator with time period of 14 and the blue line is NATR with time period 30. Green circles are when the "fast" NATR14 crossed the "slow" NATR30. Every 30 minutes this strategy will check for this crossing, and when crossing occurred we will check other condition to enter trade. So in this strategy, trade is only entered on 30 minutes boundary.
Now let see the core of this strategy
Source code image above is the core of this strategy logic. Variable natrup and natrdown are flag to check for NATR lines crossing. After that we will check for EMA direction. flipPosition is used if the last trade is a loss. I used flipping logic because on a backtesting, it give a better overall result.
The position size is fixed by predetermined amount set variable in the source code.
I feel that there is still much room for improvement in this strategy. There should be a logic to prevent this strategy from keeping flipping position when a string of losses occurred, or we can improve by lock the profit when opened position is in the green pips for certain amount.
Thank You for your time to read this.
Hello, in this blog I will explain how my strategy works. This strategy is using only 2 indicators, NATR and EMA indicator. The EMA indicator is used as a direction of the current trend, and the NATR indicator is used as a trigger to enter trade.
EUR/USD is the currency pair for this strategy.
Now let us see how EMA indicator is used in this strategy.
Above is EMA indicator with time period of 50 on 30 minutes EUR/USD pair. When the price is above the EMA line, trend is considered bullish and when the price is below EMA line, trend is considered bearish. There is also a logic to check whether EMA line is currenty heading up or down when entering trade. We will only enter trade when the EMA line is going up or down, not when the EMA line begin to change direction. There is logic in strategy source code to check for direction change.
For NATR indicator.
The red line is NATR indicator with time period of 14 and the blue line is NATR with time period 30. Green circles are when the "fast" NATR14 crossed the "slow" NATR30. Every 30 minutes this strategy will check for this crossing, and when crossing occurred we will check other condition to enter trade. So in this strategy, trade is only entered on 30 minutes boundary.
Now let see the core of this strategy
Source code image above is the core of this strategy logic. Variable natrup and natrdown are flag to check for NATR lines crossing. After that we will check for EMA direction. flipPosition is used if the last trade is a loss. I used flipping logic because on a backtesting, it give a better overall result.
The position size is fixed by predetermined amount set variable in the source code.
I feel that there is still much room for improvement in this strategy. There should be a logic to prevent this strategy from keeping flipping position when a string of losses occurred, or we can improve by lock the profit when opened position is in the green pips for certain amount.
Thank You for your time to read this.