The 'TurtleTrader.mq5' expert advisor is a trend-following trading system that uses Donchian channels to identify breakout points. The expert advisor trades on the daily timeframe and uses a maximum deposit share at risk of 1% per trade.

The inputs for the expert advisor include the Donchian channel periods for exit breakout, system-1 breakout, and system-2 breakout. The expert advisor also allows the user to set the maximum risk per trade, maximum amount of 'Units' per symbol, adding interval (times ATR), stop loss (times ATR), take profit (times ATR), allowable trade slippage, and SAR system parameters.

The expert advisor first calculates the average true range (ATR) based on the past n bars. It then calculates the volatility-adjusted trade value (Unit) based on the max. deposit share at risk and the ATR. The expert advisor then checks for a breakout in either the system-1 or system-2 Donchian channel. If there is a breakout, the expert advisor opens a position with a stop loss and take profit based on the ATR and the user inputs.

If there is an open position, the expert advisor checks if the total volume opened is less than the maximum allowed. If it is, the expert advisor adds to the position after every 0.5 * ATR price move. The expert advisor also checks for a backward breakout of the exit Donchian channel and exits all positions if there is a breakout in the opposite direction.

The expert advisor also allows the user to use a SAR system to trail the stop loss. The SAR system uses the SAR step and cap parameters to adjust the stop loss based on the price movement.

The expert advisor also draws arrows on the chart to show the Donchian channel levels and the entry and exit points. The expert advisor removes all objects from the chart on deinitialization.

TurtleTrader.mq5: A Trend-Following Expert Advisor with Donchian Channels

原文地址: https://www.cveoy.top/t/topic/ne4I 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录