OPEN-SOURCE SCRIPT

Directionforce Index

580
Directionforce Index is an oscillator panel that brings sixteen standard indicators and five freely connectable moving averages together in a single script. It is built for traders who want the classic oscillators available side by side instead of loading each one separately, and who would rather keep their remaining indicator slots free for something else. The principle is a single controller: one selection decides which oscillator the panel displays, while every moving average carries its own connection that determines what it is calculated on. The oscillators follow the established standard formulas — among them Average True Range, Relative Strength Index, Stochastic, Money Flow Index and Ultimate Oscillator — and the averages offer the common smoothing methods. The averages are not bound to the panel: one can just as well run on the chart's own price, and the panel itself can show a second security instead of an oscillator, which makes the script usable in both areas at once.

Controller

Switch Oscillator: selects which of the sixteen oscillators, or the comparison symbol, the panel displays.

Moving Average (present five times, MA 1–MA 5, each instance identically structured)

MA 1–5: switches the average on or off.
Length: number of bars the average is calculated over.
Smoothing Type: SMA, EMA, WMA, VWMA, HMA or RMA.
Connect: what the average is calculated on — the main chart or any one of the oscillators.
Source: the price used, and only available while Connect is set to Main Chart.
Style: Line, Stepline or Circles.
Width: thickness of the drawn line.
Color: color of the line.
ekran görüntüsü

Comparison Symbol

Symbol Option: which of the five stored symbols is active.
Symbol 1–5: five freely assignable securities.
Bull / Bear: two colors for rising and falling candles of that security.
ekran görüntüsü

Oscillator settings

Each oscillator has its own settings group carrying the parameters it is normally defined by. Most offer a length and a source; where an oscillator conventionally needs more, those inputs are present as well — a smoothing method for Average True Range, a divisor for Ease of Movement, separate lengths for Stochastic RSI, True Strength Index and Ultimate Oscillator.
ekran görüntüsü

Oscillator Graphic

Oscillator Color: color of the displayed oscillator.
Show Middleline: switches the middle line on or off.
Background Color: color of the area between the two bands.
ekran görüntüsü

The panel shows one oscillator at a time, drawn as a single line in the selected color. Where an oscillator is conventionally read against fixed levels, the corresponding bands are drawn as dashed lines with a shaded area between them, and a middle line is added where one is meaningful — the bands sit at the values established for each oscillator, so they change together with the selection. Oscillators without such levels are drawn without bands.

A moving average appears in the panel only while the oscillator it is connected to is the one currently displayed. Averages connected to Main Chart are independent of this and are always drawn on the main chart itself, on the price rather than on an oscillator. This means the same script can occupy the panel and the main chart at the same time, and switching the oscillator changes what is visible in the panel while the main chart stays as it is.

When Comparison Symbol is selected, the panel shows the candles of the chosen security instead of an oscillator, with a price line marking where it currently trades. The name of whatever is displayed appears in the top right corner of the panel.

Two points worth knowing. The volume-based selections — Ease of Movement, Elder Force Index, Money Flow Index, On Balance Volume, Volume itself, and VWMA as a smoothing method — require a symbol that carries volume data; on symbols without it they stay empty or rest on the zero line. And each average is technically plotted twice, once for the main chart and once for the panel, so both entries remain listed in the data window while only the applicable one carries values.

ekran görüntüsü

A note from the author: I do not use this indicator for any particular purpose myself. It began as an idea I wanted to see through — partly to develop my programming skills further, partly out of curiosity about how far Pine Script would carry a design like this. It turned out to be the most demanding script I had written up to that point. I hope it proves useful to others, whatever they end up doing with it.

This indicator is intended solely for market analysis and does not constitute investment advice or a guarantee of success. Use it at your own discretion and risk; past results are not indicative of future performance.

Feragatname

Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, alım satım veya diğer türden tavsiye veya öneriler anlamına gelmez ve teşkil etmez. Kullanım Koşulları bölümünde daha fazlasını okuyun.