Codebase.mql4.Com-The Classic Turtle Trading Indicator MQL4 Code Base

7
The classic Turtle Trading Indicator - MQL4 Code Base codebase.mql4.com /8312 Name: The classic Turtle Trading Indicator Aut hor: flaab (2012.05.24 10:15) Rating: 10 Downloaded: 20369 Download: Description: This trend following system was designed by Dennis Gartman and Bill Eckhart , and relies on breakouts of historical highs and lows to take and close trades: it is the complete opposite to the "buy low and sell high" approach. This trend following system was taught to a group of average and normal individuals, and almost everyone turned into a profitable trader. The main rule is "Trade an N-day breakout and take profits when an M-day high or low is breached (N must me above M)". Examples: Buy a 10-day breakout and close the trade when price action reaches a 5-day low. Go short a 20-day breakout and close the trade when price action reaches a 10-day high. In this indicator, entry and exit signals are displayed as arrows and dots. Original system is: Go long on blue arrows Go short short on red arrows Exit long positions when a blue dot appears Exit short positions when a red dot appears This indicator should be used together with my other indicator: The Turtle Trading Channel, to represent the same period or the failsafe trading system. The important function about this indicator is that it actually checks if your last trade has been stopped out and gives further entry signals along the trend. So it is the perfect addition to the trading channel for a complete Turtle Trading approach. I have, however, altered a little bit the algorithm to get early entry signals and avoid random trend swings in highly volatile conditions. To do so, this indicator will only show a trend change when a bar actually closes above or below the current trendline -instead of just touching it like a normal stop-loss order would do-. The downside is that you can only detect trend changes when the last bar has already closed. Just in case, the strict version is also available. Both indicators implement trading alerts, enable or disable them at will depending on your trading setup. Images:

description

bnbvnbv

Transcript of Codebase.mql4.Com-The Classic Turtle Trading Indicator MQL4 Code Base

Page 1: Codebase.mql4.Com-The Classic Turtle Trading Indicator MQL4 Code Base

The classic Turtle Trading Indicator - MQL4 Code Basecodebase.mql4.com /8312

Name:The classic Turtle Trading Indicator

Author: flaab (2012.05.24 10:15)

Rat ing: 10

Downloaded: 20369

Download:

Description:

This trend following system was designed by Dennis Gartman and Bill Eckhart, and relies on breakouts ofhistorical highs and lows to take and close trades: it is the complete opposite to the "buy low and sell high"approach. This trend following system was taught to a group of average and normal individuals, and almosteveryone turned into a profitable trader.

The main rule is "Trade an N-day breakout and take profits when an M-day high or low is breached (N must me aboveM)". Examples:

Buy a 10-day breakout and close the trade when price action reaches a 5-day low.Go short a 20-day breakout and close the trade when price action reaches a 10-day high.

In this indicator, entry and exit signals are displayed as arrows and dots. Original system is:

Go long on blue arrowsGo short short on red arrows Exit long positions when a blue dot appearsExit short positions when a red dot appears

This indicator should be used together with my other indicator: The Turtle Trading Channel, to represent the sameperiod or the failsafe trading system. The important function about this indicator is that it actually checks if your lasttrade has been stopped out and gives further entry signals along the trend. So it is the perfect addition to thetrading channel for a complete Turtle Trading approach.

I have, however, altered a little bit the algorithm to get early entry signals and avoid random trend swings in highlyvolatile conditions. To do so, this indicator will only show a trend change when a bar actually closes above orbelow the current trendline - instead of just touching it like a normal stop- loss order would do- . The downside isthat you can only detect trend changes when the last bar has already closed. Just in case, the strict version is alsoavailable.

Both indicators implement trading alerts, enable or disable them at will depending on your trading setup.

Images:

Page 2: Codebase.mql4.Com-The Classic Turtle Trading Indicator MQL4 Code Base
Page 3: Codebase.mql4.Com-The Classic Turtle Trading Indicator MQL4 Code Base

This is what your trading setup shoud look like using the channel and the classic indicator.

Aditionally, this indicator also implements entry/exit alerts.

Page 4: Codebase.mql4.Com-The Classic Turtle Trading Indicator MQL4 Code Base

Parameters:

TradePeriod: Donchian channel period for trading signalsStopPeriod: Donchian channel period for exit signalsStrictEntry: Apply strict entry parameters like the Turtles didStrictExit: Apply strict exit parameters like the Turtles didStrictStop: Apply strict stop- loss like the turtled didGreedy: Do not exit a trade unless it is in profit or the SL is hitEvaluateStoploss: Check if we have been stopped out and show future signalsATRPeriod: ATRPeriod to set the stop- lossATRStopNumber: N.Factor to calculate the stop- lossDisplayAlerts: You know...

Recommendations:

Please, refer to The Turtle Trading Channel indicator to read the full and original trading rulesIt can be used to get entry signals of the S1 system or indicate the S2 (failsafe) system

Changelog:

2012-06-12: Updated the indicator adding several strict options for entries, exits, stops and so on.

Is the Turtle Trading System prof itable?

The performance of the Turtle Trading system has been always doubted. The following is an EURUSD (1995-2012) backtest trading all signals of this indicator -without filtering out any trade- , trading only after the current barhas closed, decreasing the exposure according to the original turtle rules, adding to positions and trailing thestop- loss using ATR*2.

Page 5: Codebase.mql4.Com-The Classic Turtle Trading Indicator MQL4 Code Base

And finally, the same system with a 5% initial risk for each trade (maybe too much, but fun to watch)

Page 6: Codebase.mql4.Com-The Classic Turtle Trading Indicator MQL4 Code Base

Just out of curiosity, why did you backtest using control points? Have you tried Every Tick?

23.06.2013 01:45 MadCow

schwarzerpeter:Hi! do you know if it is somehow possible to use these indicators with forex tester 2 or any other backtestingsoftware?

No, an indicator cannot be backtested by itself because you need a trading strategy -not just the entry points- .

But you can download a free turtle trading ea from my site.

Cheers.

26.04.2013 00:10 flaab

Cool indicator! Thank you!

03.02.2013 22:27 winden

Hi! do you know if it is somehow possible to use these indicators with forex tester 2 or any other backtestingsoftware?

29.01.2013 11:39 schwarzerpeter

Thank you. Good work !

16.01.2013 11:28 MathQuant

Page 7: Codebase.mql4.Com-The Classic Turtle Trading Indicator MQL4 Code Base

Thanks for this, much appreciated!

26.06.2012 04:02 BeakonHJ_ROCKS:

Hi Flaab,

Check last two hour chart for EurUSD, Gold, Silver Futurs " now alerts came after 1 hour completed after spain gotdowngraded !!!" just look at the charts what kind of damaged it can make after 20 bar low " if you get alerts on timeas and when it breaks 20 bar low how much profitable it would be " i think you will get my message, why i amtrying to send this message is that its upto trader take decision trade after 20 bar high or low break out !!!!!

Regards,

HJ_Rocks

Yep, alerts are only triggered after the bar has closed! I'll have to fix that in the near future in the strict version. Inthe meantime, use the strict version with CalculateBarClose == false and stay tuned :-P29.05.2012 20:46 flaab

Hi Flaab,

Check last two hour chart for EurUSD, Gold, Silver Futurs " now alerts came after 1 hour completed after spain gotdowngraded !!!" just look at the charts what kind of damaged it can make after 20 bar low " if you get alerts on timeas and when it breaks 20 bar low how much profitable it would be " i think you will get my message, why i amtrying to send this message is that its upto trader take decision trade after 20 bar high or low break out !!!!!

Regards,

HJ_Rocks

29.05.2012 18:39 HJ_ROCKSHJ_ROCKS:

Hi flaab,

Yes you are right i need to use strict version but that also shows " dot " during the price breaks stops or channlealerts only occure after time period get over !!!!! Flaab help us out with this alerts problem we need alerts as andwhen price breaks not when time period get over !!! we all know you can do this !!! last favour for all of us !!!

Regards,

HJ_Rocks

Well let me go over it tonight. I can make an alert happen at the price break. I guess. But how hard is watching adot?

Just for the record, on the long run, using the close price is more profitable because you ignore false exits.

I tested this and the difference is enormous ;- )

24.05.2012 16:11 flaab

Hi flaab,

Yes you are right i need to use strict version but that also shows " dot " during the price breaks stops or channlealerts only occure after time period get over !!!!! Flaab help us out with this alerts problem we need alerts as andwhen price breaks not when time period get over !!! we all know you can do this !!! last favour for all of us !!!

Regards,

HJ_Rocks

24.05.2012 15:53 HJ_ROCKS