Expert Advisor TrailingStopToolkit
Post on: 13 Сентябрь, 2015 No Comment
Expert Advisor TrailingStop-Toolkit Conception
It can be used for trade by expert advisers and for manual trading as well.
e-BJF-TrailingStop-Toolkit expert advisor contains 6 different TrailingStops (Standard, High/Low, ATR, Fractals, PSAR, ProfitPcnt), work days settings and work time settings.
a) Standard Trailing: simple trailing, stoploss follows by the market
b) High/Low Trailing: trailing by bars High/Low
c) ATR Trailing: trailing by ATR indicator
d) Fractals Trailing: trailing by Upper/Lower Fractals
e) PSAR Trailing: trailing by Parabolic Stop And Reverse indicator
Buy orders trailed if PSAR below the bars and moving up
Sell orders trailed if PSAR above the bars and moving down
f) ProfitPcnt Trailing: trailing with lock of some pcnt of max. profit reached
If Buy opened at 1.3000, ProfitPcnt = 40.0 and the market reaches 1.3100 then the trailing moves StopLoss to 1.3040, on 1.3200 StopLoss will be moved to 1.3080.
Every trailing has on/off option. You can activate any of them or all of them simultaneous.
You can use the expert on 4-digit and 5-digit accounts.
g) TrendLine Trailing
TrendLines make very effective day trading tools. A trendlines upward slope created by a stock creating higher highs, allows a day trader to trail a stop order directly under the trendline. allowing price to often run to new highs before the position is exited.
h) MovingAverage Trailing - stop loss will follow a moving averages.
How to test the expert advisor e-BJF-TrailingStop-Toolkit by StrategyTester and understand the behaviour of every trailing?
You can test e-BJF-Trailing Stop-Toolkit in MT4 Strategy Tester in visual mode with manual orders openning.
You can swith on tracking feature. Tracking (Visualisation) leaves traces of stoploss levels on chart.
a) Run e-BJF-TrailingStop-Toolkit expert by StrategyTester
b) Set VisualMode = true
c) Add any graph. object on the chart manual, set name = !buy. Buy order will be open.
d) Add any graph. object on the chart manual, set name = !sell. Sell order will be open.
Example Standard Trailing
Trailing StopLoss with Vizaulization
Expert Advisor TrailingStop-Toolkit Options
extern int AccDigits = 5; // Set 4 or 5
extern bool MondayOn = true;
extern bool TuesdayOn = true;
extern bool WednesdayOn = true;
extern bool ThursdayOn = true;
extern bool FridayOn = true;
extern string WorkTime1 = 0:00-24:00;
extern string WorkTime2 = 0:00-24:00;
// programming language for MT4 Reference — Standard constants — Timeframes
extern int ATRTrail.ATR_period = 10; // Period of ATR indicator
extern int ATRTrail.ATR_shift = 1; // Get ATR value from the first closed bar (shift = 1)
extern int ATRTrail.ExtraPips = 0; // Add this pips value to ATR on StopLoss calculation
— Fractals Trailing —
extern bool FrTrail.On = false; // Trailing on/off
extern int FrTrail.ProfitReq = 50; // Minimum profit to activate the trailing, pips
extern int FrTrail.Fr_timeframe = 0;
// 0 is the current TimeFrame of the chart
// For timeframes details see programming language for MT4 help of MT4:
// programming language for MT4 Reference — Standard constants — Timeframes
extern int FrTrail.ExtraPips = 0; // Add this pips value to Upper/Lower Fractal on StopLoss calculation
extern bool PSARTrail.On = false; // Trailing on/off
extern int PSARTrail.ProfitReq = 50; // Minimum profit to activate the trailing, pips
extern int PSARTrail.PSAR_timeframe = 0;
// 0 is the current TimeFrame of the chart
// For timeframes details see programming language for MT4 help of MT4:
// programming language for MT4 Reference — Standard constants — Timeframes
extern double PSARTrail.PSAR_step = 0.02;
extern double PSARTrail.PSAR_maximum = 0.2; // PSAR attributes
extern int PSARTrail.ExtraPips = 0; // Add this pips value to PSAR on StopLoss calculation
— ProfitPcnt Trailing —
extern bool PPcntTrail.On = false; // Trailing on/off
extern int PPcntTrail.ProfitReq = 50; // Minimum profit to activate the trailing, pips
extern double PPcntTrail.ProfitPcnt = 40.0; // Everytime lock 40 % of profit reached
New options:
— TrendLine Trailing —
extern bool TLineTrail.On = false; // Trailing on/off
extern string TLineTrail.ObjName = MyTrendLine; // name of TrendLine object (you need to add it manual)
MovingAverage Trailing
MATrail.On = false; // MA Trailing on/off
MATrail.ProfitReq = 50; // Minimum profit to activate the trailing, pips
MATrail.Step = 5; // Trailing step (move StopLoss every 5 pips)
MATrail.MA_timeframe = 0;// 0, 1, 5, 15, 30, 60, 240, 1440, 10080 or 43200
MATrail.MA_period = 20;// MA period
MATrail.MA_shift = 0;// MA shift, bars (omly positive values or 0 allowed)
MATrail.MA_method = MODE_EMA;// MODE_SMA, MODE_EMA, MODE_SMMA or MODE_LWMA