Fellow Squad Members,
For those who use VPS or who are not at the PC all day this EA, in addition to our Break Even EA, can lower risk significantly as it manages trailing stop on a currency pair together with break even.
By default the EA drags stop level at 20 pips distance from market price. However, you can combine trailing stop with setting break even level. First, you can wait with trailing stop until break even triggers: if you set 'Trail_before_break_even' to false no modification will take place before stop gets to BE level.
Installation and starting:
Download source code from here:
This is an expert advisor code so you need to copy it to {MetaTrader4 folder}/experts folder and then start the trading platform (or close and restart if it was open). The tool will appear on Navigator panel (open from View menu) among Expert Advisors as FPA=TrailingStop so just drag over your chart.
Enable Expert Advisors:
To use it don't forget to enable Expert Advisors in terminal's Options (menu: Tools/Options - Expert Advisors tab first checkbox). This shows a smiley face on the upper right corner next to the EA's name (otherwise there is an x).
Settings and Parameters:
You can open Inputs tab right after starting EA when Properties come up or by pressing F7 if you switch from Common tab to Inputs.
Parameter: Break_Even_Trigger_in_Pips
Possible values: decimal numbers
Function: It tells the EA how far the market price should go in positive before break even gets set (default value is 30.0 pips). You can turn off break even if you set it to zero or negative.
Parameter: Break_Even_in_Pips
Possible values: decimal numbers
Function: This is break even level itself as you might want to calculate with spread and commission so break even would be in positive a bit (default value is 1.0 pip).
Parameter: Trailing_Stop_in_Pips
Possible values: decimal numbers
Function: The distance how far the stop level should follow market price in pips (default is 20.0 pips). If 'Trail_before_break_even' is set to false it waits until break even triggers.
Parameter: Trail_before_break_even
Possible values: true or false
Function: It hangs trailing until stop moves to break even. If BE is off (you've set 'Break_Even_Trigger_in_Pips' to zero or negative) you first need to set stop level to BE or to more profitable level. (Default is false.)
Parameter: Apply_to_all_symbols
Possible values: true or false
Function: Set it to true if you want to get all your trades managed by a single chart and EA. (Default is false.)
Operation:
Stop level follows market price by a certain distance ('Trailing_Stop_in_Pips') moving always in profitable direction. This is combined with setting break even levels that is triggered by 'Break_Even_Trigger_in_Pips' and set at 'Break_Even_in_Pips'.
If you prefer to set break even first you can get the EA wait until it triggers by setting 'Trail_before_break_even' to false (this is the default anyway).
Possibly you want to use the EA for trailing all your trades on all currency pairs, then you only need to set 'Apply_to_all_symbols' to true.
You can participate:
Tell me and your fellow Squad Members how you like it.
Tell me and your fellow Squad Members how could it be better.
Tell me and your fellow Squad Members if you have any problem while installing or using it.
Who wants to enter the Laboratory:
Right click on Navigator panel/Expert Advisors/FPA=TrailingStop and select Modify. MetaEditor opens up showing the full source code I've written for you.
On the first screen you find input parameters and you can change default values if you wish.
After modifying the code press F5 or Compile button on the top. If it writes "0 error(s),..." on the bottom, you have your own new version and you can start using it after going back to MT4 terminal.
Looking forward to hearing your feedback,
Peter
For those who use VPS or who are not at the PC all day this EA, in addition to our Break Even EA, can lower risk significantly as it manages trailing stop on a currency pair together with break even.
By default the EA drags stop level at 20 pips distance from market price. However, you can combine trailing stop with setting break even level. First, you can wait with trailing stop until break even triggers: if you set 'Trail_before_break_even' to false no modification will take place before stop gets to BE level.
Installation and starting:
Download source code from here:
This is an expert advisor code so you need to copy it to {MetaTrader4 folder}/experts folder and then start the trading platform (or close and restart if it was open). The tool will appear on Navigator panel (open from View menu) among Expert Advisors as FPA=TrailingStop so just drag over your chart.
Enable Expert Advisors:
To use it don't forget to enable Expert Advisors in terminal's Options (menu: Tools/Options - Expert Advisors tab first checkbox). This shows a smiley face on the upper right corner next to the EA's name (otherwise there is an x).
| |
Settings and Parameters:
You can open Inputs tab right after starting EA when Properties come up or by pressing F7 if you switch from Common tab to Inputs.
Parameter: Break_Even_Trigger_in_Pips
Possible values: decimal numbers
Function: It tells the EA how far the market price should go in positive before break even gets set (default value is 30.0 pips). You can turn off break even if you set it to zero or negative.
Parameter: Break_Even_in_Pips
Possible values: decimal numbers
Function: This is break even level itself as you might want to calculate with spread and commission so break even would be in positive a bit (default value is 1.0 pip).
Parameter: Trailing_Stop_in_Pips
Possible values: decimal numbers
Function: The distance how far the stop level should follow market price in pips (default is 20.0 pips). If 'Trail_before_break_even' is set to false it waits until break even triggers.
Parameter: Trail_before_break_even
Possible values: true or false
Function: It hangs trailing until stop moves to break even. If BE is off (you've set 'Break_Even_Trigger_in_Pips' to zero or negative) you first need to set stop level to BE or to more profitable level. (Default is false.)
Parameter: Apply_to_all_symbols
Possible values: true or false
Function: Set it to true if you want to get all your trades managed by a single chart and EA. (Default is false.)
Operation:
Stop level follows market price by a certain distance ('Trailing_Stop_in_Pips') moving always in profitable direction. This is combined with setting break even levels that is triggered by 'Break_Even_Trigger_in_Pips' and set at 'Break_Even_in_Pips'.
If you prefer to set break even first you can get the EA wait until it triggers by setting 'Trail_before_break_even' to false (this is the default anyway).
Possibly you want to use the EA for trailing all your trades on all currency pairs, then you only need to set 'Apply_to_all_symbols' to true.
You can participate:
Tell me and your fellow Squad Members how you like it.
Tell me and your fellow Squad Members how could it be better.
Tell me and your fellow Squad Members if you have any problem while installing or using it.
Who wants to enter the Laboratory:
Right click on Navigator panel/Expert Advisors/FPA=TrailingStop and select Modify. MetaEditor opens up showing the full source code I've written for you.
On the first screen you find input parameters and you can change default values if you wish.
After modifying the code press F5 or Compile button on the top. If it writes "0 error(s),..." on the bottom, you have your own new version and you can start using it after going back to MT4 terminal.
Looking forward to hearing your feedback,
Peter
Last edited by a moderator: