Summary: This indicator script measures the lowest price of an underlying symbol in a specified number of periods. Calculation: The lowest low in a specified number of periods of the underlying symbol. Developer: Richard Donchian Interpretation: 1. Support: When the underlying symbol is moving downwards towards the indicator script, the underlying symbol is likely to reverse direction and move upwards. 2. Support Broken: When the underlying symbol breaks support by crossing below the indicator script, the underlying symbol is likely to continue moving downwards.
' Assign the parameters to script variables. _symbolIndex = symbolIndex _periods = periods
' Get the lowest prices of the current symbol, indexed by bar index. Define low() As Number = BarLow(_symbolIndex, barIndex, length + _periods) Define min As Number ' Use for the calculated Donchian Channel Lower values, indexed by bar index. Define results(length - 1) As Number ' Calculate the Donchian Channel Lower values for the specified bar range. For i As Integer = length - 1 To 0 Step -1 min = 1000000 ' Calculate the Donchian Channel Lower value for the current bar. For j As Integer = i + _periods - 1 To i Step -1 If (low(j) < min) Then min = low(j) End If Next results(i) = min Next Return results