This
is the extended information page for the AutoStops EA. This contains
all parameter information as well as descriptions on their usage.
AutoStops
Think of it as a better trailing stop-loss function.
This EA will take allow you to take better control of your trades by automatically calculating and applying stop losses based on a few simple parameters. It allows each position you open to have better risk management, setting a stop loss at a percentage of your available equity or balance (based off lot size). However, the main use of this EA is to carefully control a positions stop loss in a “trailing” manner, attempting to get the most of each trade.
The EA will run in as many different currency pair charts as you have open, and for any number of trades.
Note – This EA does NOT do anything in the strategy tester. It requires an open position before it can take over. It also does NOT open positions for you, it is still up to you as the user to make the decision where to enter the market based on your research, knowledge and even luck. This EA will simply help you exit with money in your pocket and the least amount of fuss. As with everything in the trading world, test it out in a demo account before going live.
To disable the auto trailing stop-loss (to be referred to as ATSL for the remainder of the document) functions for a particular position, simply set a take profit. The EA will ignore any position with a take profit set to anything other than 0.
Parameters
Trends
1a. Show trend and other info?
Default: true
Does what it says on the tin. Will display the current trend, and some other information if the EA is running in "auto" mode, in the top left corner of the chart. Turning this off makes no difference to the EA itself, only whether it is shown or not.
1b. Number of bars to compare?
Default: 2
Sets the number of bars backwards to compare to obtain the trend information. Set this at whatever number of bars you would like to compare based on your personal trading preferences and the time frame you like to use. Uses Dow Theory to compare the previous bar to bar n (where n is the number you set).
Risk
Management
2a. Move SL to spread if SL < spread?
Default: false
If the EA tries to set a stop loss that is inside the spread, move it to the first available place it can go. If left at false, the stop loss will simply not be created.
2b. % of 2c to Risk per trade
Default: 3.0
This will set a positions initial stop loss at a certain percentage of your available equity based on the positions lot size. The default of 3% on a $10,000 account would mean the position would be set to only lose $300.
Note – If you regularly work with large lot sizes, be very careful that your position does not get closed out straight away by a tiny fluctuation, as your stop loss might be very close to the current price. Remember, you can set a take profit to disable the ATSL function for any position.
2c. Use Equity or Balance as risk?
Default: Equity
Whether you want to the EA to risk manage based on your current balance, or your available equity.
Money
Making
3a. Points to set trailing SL
Default: 17
This is the number of points behind the current price the ATSL will trail. This works differently to trailing stop-losses as you may be used to them already. Metatrader’s in-built feature does not allow for any price fluctuations, the stop loss will only ever move in one direction. This EA will move the stop loss with the price while allowing for small fluctuations per candle and even to get over small trend bumps. If the trend changes and goes against the open position, the ATSL will sit still and wait for the trend to go in the required direction, or let the position close. See the video for a demonstration of the ATSL in action (note this does not demonstrate the flat trend creep as mentioned below).
You will need to increase this and the next option together based on the time frame you like to use. The default settings work nicely for up to 5 minute charts, but you should check the average candle length before committing to any values here. This value should be lower than 3b to ensure you get the most from each position.
3b. Points in-front of break-even
Default: 22
How many points in front of the position’s “break-even” should the ATSL come into effect? A positions break-even is calculated based on the lot size of the position as well as your commission value (more on this below). Setting this too low can result in a loss as the trend may not be fully committed yet. Too high a value on the other hand could mean that you might miss potential earnings if the price doesn’t quite reach where you expect it to.
3c. Number of bars to average
Default: 0
Recommended Value: 12
Setting this to any whole number higher than 0 will over-ride the previous two options and tell the EA to look at this number of previous bars and calculate a trimmed average. This average will be used to set the ATSL value, allowing for a tighter stop loss as the chart moves. Once this has been set, options 3A and 3B will no longer be used for calculations until this value is returned to 0.
3d. Candle feature to use for averaging
Default: High/Low
This works in conjunction with the previous and will have no effect if 3C is set to 0. Controls whether averaging uses either the High/Low or the Open/Close of the previous candles when performing calculations.
3e. Speed of trailing SL creep on flat trend
Default: Off
When making use of the ATSL, to ensure that your position does not get stuck in a flat trend with no end, this option can come to the rescue. Each choice is a speed setting in points.
To visualize how this works, imagine an open position that is in a flat trend, neither moving up nor down. Once the tool recognizes this, the position now has a set number of bars to move out of the flat trend before it is closed. If the trend does change, this “timer” is reset. The number of bars is calculated from [Value set in 3a] / [Speed of creep]. For the default settings of 3a set to 17 and speed set to 2x, this gives 8 (rounded down) bars before closing. Each bar that passes, the stop loss will creep towards the current price by 2 point. Increasing this value will change how “fast” the stop loss moves.
3f. Allow stop loss behind previous bar?
Default: True
Confusing name aside, this option controls whether the ATSL can fall back past the previous bars open value or not. This will over-ride whatever the current trailing stop loss value is, which can be beneficial on a large time-scale but a hindrance if you deal mostly with the shorter periods (10 minutes and less).
Paying
the Piper
4. Commission Value in $ (per full trade)
Default: 0
This is how much you pay per full position (opened and closed) in $. This EA does not currently allow for percentage commissions, break-even points would be impossible to calculate.
This value is used to calculate the break-even point. If this is set to 0, the EA will simply ignore that check and do its best anyway. The break-even point is used as a minimum value, once the ATSL goes beyond this value, it won’t come back below it (there may be some rounding issues, it can be a few dollars out sometimes). The EA also won’t commence an ATSL until the price is x number of points over the break-even (x being set back in option 3b or calculated from 3c if using the averaging function).
Version History
v3.1
- Updated the averaging function check distance multiplier. Decreased the multiplier making the EA a bit more responsive.
v3.0
- Updated option 3F to invert the logic internally.
v2.9
- Added Option 3F, controls whether the ATSL can fall past the previous bars open value or not.
- Updated the averaging function check distance multiplier