Skip to main content

Posts

Showing posts from September, 2017

Using the Donchian Indicator to enhance your Trading

The Donchian channel is available for purchase here.



Richard Davoud Donchian was an Armenian-American commodities and futures trader, and pioneer in the field of managed futures who came up with a simple intuitive indicator called the Donchian channel. It is basically based on the lowest low value or the highest high value in a given period of time:


Calculation

As mentioned, Donchian is based on marking the lowest low line or the highest high line, so visually you see the trend of the product. Whenever the product reached a value which is higher than the last 24 values or lower than the previous ones, a new markup will start until it reverses.
Calculating it with MQL is straightforward, to find out the highest value of the product in a given period, we use the following snippet:
double HighestHigh=iClose(Symbol(),Period(),iHighest(Symbol(),Period(),MODE_CLOSE,TradePeriod,0));

Here, reading from right to left, we first find the shift of the highest value using a call to iHighest, and then, u…