Trailing Stop Manager
- Utilidades
- Snapdragon Systems Ltd
- Versión: 1.0
- Activaciones: 5
Introduction
This is a trade manager EA. It will detect an open trade and apply a number of different user selected trailing stops to the position simultaneously, always using the tightest stop loss out of all the different methods that have been turned on. The various different choices of trail are:
- X bar trail to break-even: e.g. adjust the stop loss up towards break-even at the lowest low of the last X bars until break-even is reached.
- Risk-reward trail to break-even: e.g. move the stop loss to break-even once the market reaches a multiple of (e.g. 1.5 times) the initial risk
- X bar trail: e.g. trail the stop loss at the lowest low of the last X bars until stopped-out.
- Parabolic Stop & Reverse (PSAR) trail: trail the stop loss at the PSAR indicator reversal point
- Moving average trail: trail the stop loss at the moving average value
How to Use This EA
The EA is applied to the chart where it will remain dormant until it detects a trade for whatever symbol the EA has been applied to. At this point it will start to manage the position, working a trailing stop order for it until the position is closed out.
Inputs Overview
For each stop loss type there is a separate section. Each type has a true/false switch for turning that stop loss on. In addition the required input parameters for each stop loss are given.
For all stop types apart from the PSAR and the Risk-reward Trail to Break-even, there is a buffer or cushion input as well. This is a buffer amount to adjust the stop beyond the technical level so for e.g. the XBarTrail for a long position the stop would be adjusted below the X bar low by the cushion amount. The Cushion can be specified either in pips or in ATR multiples.
Note that for the break-even stops, there is an additional cushion, specified by the BEProfitCushionType and BEProfitCushionValue inputs, which is the amount of profit to lock in beyond break-even. So if this is set to e.g. 1 pip then the break-even stop-loss will actually lock in 1 pip of profit.
Inputs
XBar Trail to Brk Even Section
XBarTrlBE_ON: true/false to turn the X Bar trail to break-even on/off.
XBarTrlBE_NBars: the number of bars back to trail the stop
XBarTrlBE_CushionType: specify the cushion type for the XBar Trail to Break-even stop
XBarTrlBE_CushionValue: specify the cushion size for the XBar Trail to Break-even stop
Risk Reward to Brk Even Section
RRwdBE_ON: true/false to turn the risk/reward to break-even on/off
RRwdBE_Level: the risk/reward profit level (i.e.the profit multiple of the initial risk)
Brk Even Cushion Settings
BEProfitCushionType: specify the break-even profit lock in cushion type
BEProfitCushionValue: specify the break-even profit lock in amount
XBar Trail Section
XBarTrail_ON: true/false to turn on or off the X bar trail of the lowest N bars (for longs) or highest N bars (for shorts)
XBarTrail_NBars: the lookback length for the trail
XBarTrail_CushionType: the cushion type for the XBar Trail
XBarTrail_CushionValue: the cushion size to be added to the lowest low/highest high to define the stop level
PSAR Trail Section
PSarTrail_ON: true/false to turn the parabolic stop & reverse trail on or off
PSarTrail_Step: the PSAR step input
PSarTrail_Max: the PSAR max input
General Info Section
InstantSLCreation: if set to true then as soon as the EA detects a new position without a stop loss, it will create one based on the current trailing stop loss parameters
SpreadPnts: the bid/ask spread size, expressed in points, to be added to the stop loss for short positions
ATRLength: the ATR Length parameter to use for calculating the ATR cushion values
MyMagicNumber: If this is a positive number then the EA will only operate on tickets with this magic number. If it's negative then it will work on all positions for the symbol to which the EA has been applied