Range Trading
Range trading is a strategy that focuses on identifying periods when the market is consolidating rather than trending. During consolidation, the price moves within a defined range, bouncing between a "range low" and a "range high". Traders look to trade on these price movements by buying near the range high level and selling near the range low level.
Range Break Out Strategy
Now based on these established range highs and lows, we want to trade on strong impulse break outs. The trades aren't taken right at the range highs or lows to avoid fake outs, instead they are taken once a candle closes above or below the ranges and by making sure that the candle that is breaking out meets a certain size for the break out.
How the EA Works
If were looking to trade a range break out we need to establish a range right? So in the EA we're going to specify which range of candles to consider as the range. We're going to specify the range as a certain number of candles rather than a certain time. So for example we can choose the previous 5 candles, or the previous 12 candles (as an example).
Remember that in MQL5 if the "Candle ID" is "1" it's referring to the previous candle. If it's "0" we're referring to the current candle.
So with that in mind, remember that we want to make sure that the break out has been firmly established, so we don't want to use the current candle ("0") or the previous candle ("1") as the candles that will be used for the range. Instead we will start with the previous previous candle, which would be "2". Then to finish calculating the range let it know which candle you want the range to end looking back.
Here are the EA settings:
Range_Start: this is where the range will start. You start from the most current candles and count back. You want to start with candle number "2".
Range End: this is where the range will end. Example: Candle number "12"
Risk Size: This is used to calculate the lot size to trade in percentages. As a rule of thumb never risk more than 1% of your capital. So here you would just put "1".
TP Percent: This setting is used to calculate the TP. It's calculated as a percent of the stop loss. Example, if the SL is say 30 pips, and the "TP Percent" is 100(%), then the TP is 30 pips. If it's 200(%) the TP will be 60 pips.
SL_Range_Start: The stop-loss is calculated also by a range of candles. This is where that range will start.
SL Range End: The stop-loss is calculated also by a range of candles. This is where that range will end.
Trailing_Stop: The trailing stop is also calculated as a percentage of the TP. Example, if you enter "50"(%) then when the trade is half way to its profit target the SL will start trailing.
Below is an example of how the EA would take a trade.
Please feel free to download the EA, test it, tweak it and please share your results!
Range trading is a strategy that focuses on identifying periods when the market is consolidating rather than trending. During consolidation, the price moves within a defined range, bouncing between a "range low" and a "range high". Traders look to trade on these price movements by buying near the range high level and selling near the range low level.
Range Break Out Strategy
Now based on these established range highs and lows, we want to trade on strong impulse break outs. The trades aren't taken right at the range highs or lows to avoid fake outs, instead they are taken once a candle closes above or below the ranges and by making sure that the candle that is breaking out meets a certain size for the break out.
How the EA Works
If were looking to trade a range break out we need to establish a range right? So in the EA we're going to specify which range of candles to consider as the range. We're going to specify the range as a certain number of candles rather than a certain time. So for example we can choose the previous 5 candles, or the previous 12 candles (as an example).
Remember that in MQL5 if the "Candle ID" is "1" it's referring to the previous candle. If it's "0" we're referring to the current candle.
So with that in mind, remember that we want to make sure that the break out has been firmly established, so we don't want to use the current candle ("0") or the previous candle ("1") as the candles that will be used for the range. Instead we will start with the previous previous candle, which would be "2". Then to finish calculating the range let it know which candle you want the range to end looking back.
Here are the EA settings:
Range_Start: this is where the range will start. You start from the most current candles and count back. You want to start with candle number "2".
Range End: this is where the range will end. Example: Candle number "12"
Risk Size: This is used to calculate the lot size to trade in percentages. As a rule of thumb never risk more than 1% of your capital. So here you would just put "1".
TP Percent: This setting is used to calculate the TP. It's calculated as a percent of the stop loss. Example, if the SL is say 30 pips, and the "TP Percent" is 100(%), then the TP is 30 pips. If it's 200(%) the TP will be 60 pips.
SL_Range_Start: The stop-loss is calculated also by a range of candles. This is where that range will start.
SL Range End: The stop-loss is calculated also by a range of candles. This is where that range will end.
Trailing_Stop: The trailing stop is also calculated as a percentage of the TP. Example, if you enter "50"(%) then when the trade is half way to its profit target the SL will start trailing.
Below is an example of how the EA would take a trade.
Please feel free to download the EA, test it, tweak it and please share your results!
Attached File(s)