I am starting this thread because Macedonia requested an EA in another thread and this wasn't quite in line with the original thread.
http://www.forexfactory.com/showthre...98#post6742498
Also as the thread starter I will be able to add to this first post as necessary.
The basic idea of the EA is that it will enter a long trade when price breaks the high of the previous candle and a short trade when price breaks the low of the previous candle.
SL will be set at the low/high of the previous candle. When a new candle opens it will move the SL to the new low/high
I have only recently started to learn how to code and so my efforts can be a bit clumsy.
If anybody wants to try it, give it a good trial on a demo before even thinking of using it on a live account.
I hope that as many people as possible will trial it and report back with any issues. I'm not really concerned about whether it makes profit or not, just that it works as it should. If it does happen to make profit, than that will be great (but then you can really thank Macedonia as he instigated this)
My intention is to learn more about coding and improve by making new developments.
I can see that there are limitless possibilities as price above or below a certain MA could be used as a filter.
I look forward to people who try out this EA and giving feedback making suggestions. Of course some suggestions may be well beyond my capabilities, but then if you don't raise the bar a bit you'll never advance.
This is currently the latest version which is quite a bit different from the original posted in the other thread.
EDIT 16th July 2013 - new version uploaded in post #11.
http://www.forexfactory.com/showthre...62#post6822262
EDIT 24th July 2013 - new version uploaded in post #22
http://www.forexfactory.com/showthre...60#post6842260
EDIT 6th August 2013 - Macedonia's Daily Master and lower tf hedge version uploaded in post #28
Inputs are a lot different to the original.
MagicNumber - it can be any number, but it should be different for every chart that it is attached to, This allows the EA to recognise the trades that it has put on and it will ignore others. Eg, you can attach the EA to a EURJPY M5 chart and then open another EURJPY chart and have it at H1. As long as they have different Magic Numbers, They will not try to amend each others trades.
TakeProfit - this is the number in pips that you are happy to accept
ExceedBy - This is the amount in pips that price must break above or below the previous bar.
MaxSpread - if spread, in pips is larger than this, the EA will do nothing. It will not enter new trades or modify open trades.
DecimalPip - This is different to the original. This is the amount of decimal places after the decimal pointy that denotes 1 pip.
Ie Your broker's price for EURUSD may be 1.31945. There are 5 decimal places after the decimalpoint, but we know that there are only 4 places for 1 pip. So you would leave it at the default 4. Japanese pairs, there are only 2 decimal places after the decimal point, so this must be set to 2.(I thought that doing it this way would be easier, but I think that I am making a hash of it )
MinBarPips - This is the minimum size bar in pips that will be taken into account. If this is too small there may be multiple trades taken and closed when price breaks above and below it many times. I intend to make adjustments to the EA so that if the previous bar is too small, it will look back further for a range.
MaxGapPips - This is the amount in pips that you will allow price to jump above or below the entry level and still enter the trade, We get these gaps at news times,
MaxSlippage - Obviously the maximum amount of slippage in pips that you will allow when prices are moving quickly.
RiskPerTrade - is the percentage of the current equity of your account that you are willing to risk per trade.
Start1
End1
Start2
End2 - These give you the option to trade 1 or 2 sessions per day. If you just want to trade 1 session, just use start1 and End1, leave the other 2 at zero. If you want to trade 24 hours, leave them all at zero.
Input times as a decimal
Ie
2AM will be 2.00
2:30 AM will be 2.30
9:15 PM will be 21.15
Times are your Broker's time, not your local time.
CloseTrades can be true or false. If you set this at true and use the session option, it will close all trades that have been opened by the EA when the session ends.
If it is set to false, no new trades will be opened outside of session times, but current trades will still have their Stop Loss modified at the close of qualifying bars.
Please try it out on demo and if you find any settings that seem to work well for a particular pair and timeframe, please report back.
http://www.forexfactory.com/showthre...98#post6742498
Also as the thread starter I will be able to add to this first post as necessary.
The basic idea of the EA is that it will enter a long trade when price breaks the high of the previous candle and a short trade when price breaks the low of the previous candle.
SL will be set at the low/high of the previous candle. When a new candle opens it will move the SL to the new low/high
I have only recently started to learn how to code and so my efforts can be a bit clumsy.
If anybody wants to try it, give it a good trial on a demo before even thinking of using it on a live account.
I hope that as many people as possible will trial it and report back with any issues. I'm not really concerned about whether it makes profit or not, just that it works as it should. If it does happen to make profit, than that will be great (but then you can really thank Macedonia as he instigated this)
My intention is to learn more about coding and improve by making new developments.
I can see that there are limitless possibilities as price above or below a certain MA could be used as a filter.
I look forward to people who try out this EA and giving feedback making suggestions. Of course some suggestions may be well beyond my capabilities, but then if you don't raise the bar a bit you'll never advance.
This is currently the latest version which is quite a bit different from the original posted in the other thread.
EDIT 16th July 2013 - new version uploaded in post #11.
http://www.forexfactory.com/showthre...62#post6822262
EDIT 24th July 2013 - new version uploaded in post #22
http://www.forexfactory.com/showthre...60#post6842260
EDIT 6th August 2013 - Macedonia's Daily Master and lower tf hedge version uploaded in post #28
Inputs are a lot different to the original.
MagicNumber - it can be any number, but it should be different for every chart that it is attached to, This allows the EA to recognise the trades that it has put on and it will ignore others. Eg, you can attach the EA to a EURJPY M5 chart and then open another EURJPY chart and have it at H1. As long as they have different Magic Numbers, They will not try to amend each others trades.
TakeProfit - this is the number in pips that you are happy to accept
ExceedBy - This is the amount in pips that price must break above or below the previous bar.
MaxSpread - if spread, in pips is larger than this, the EA will do nothing. It will not enter new trades or modify open trades.
DecimalPip - This is different to the original. This is the amount of decimal places after the decimal pointy that denotes 1 pip.
Ie Your broker's price for EURUSD may be 1.31945. There are 5 decimal places after the decimalpoint, but we know that there are only 4 places for 1 pip. So you would leave it at the default 4. Japanese pairs, there are only 2 decimal places after the decimal point, so this must be set to 2.(I thought that doing it this way would be easier, but I think that I am making a hash of it )
MinBarPips - This is the minimum size bar in pips that will be taken into account. If this is too small there may be multiple trades taken and closed when price breaks above and below it many times. I intend to make adjustments to the EA so that if the previous bar is too small, it will look back further for a range.
MaxGapPips - This is the amount in pips that you will allow price to jump above or below the entry level and still enter the trade, We get these gaps at news times,
MaxSlippage - Obviously the maximum amount of slippage in pips that you will allow when prices are moving quickly.
RiskPerTrade - is the percentage of the current equity of your account that you are willing to risk per trade.
Start1
End1
Start2
End2 - These give you the option to trade 1 or 2 sessions per day. If you just want to trade 1 session, just use start1 and End1, leave the other 2 at zero. If you want to trade 24 hours, leave them all at zero.
Input times as a decimal
Ie
2AM will be 2.00
2:30 AM will be 2.30
9:15 PM will be 21.15
Times are your Broker's time, not your local time.
CloseTrades can be true or false. If you set this at true and use the session option, it will close all trades that have been opened by the EA when the session ends.
If it is set to false, no new trades will be opened outside of session times, but current trades will still have their Stop Loss modified at the close of qualifying bars.
Please try it out on demo and if you find any settings that seem to work well for a particular pair and timeframe, please report back.
Attached File(s)
Hi Lo Break v3.7.ex4
9 KB
|
5,079 downloads
Please Do Not PM Me With Coding Enquiries