simple TradingView indicator

Job ID: 34204166

Budget: $30 – $250 USD

I would like an indicator coded for me in Pine Script for Trading View.

COMPARISON OF TREND DURATION
1. Input MA length (default = 20). (the type of MA is selected from a drop down with many MA types)
2. Input extreme high threshold (default = 90%), input extreme low threshold (default = 10%)
3. Input max number of candles to look back (default = 1000)

4. In pane 1: In a pane at the bottom of the chart, plot a count of the number of candles occurring between current candle and the most recent candle to have crossed the MA (I'll call this count: the Trend Duration)

5. In pane 2: In a different pane, plot the trend duration as a % compared to the duration score of all candles looking back the max number of candles (eg. Looking back 1000 candles).
Draw lines to mark the extreme high and extreme low thresholds.
Place a green dot below the oscillator plot when the oscillator is above the extreme level and the price closes above a MA
Place a red dot below the oscillator plot when the oscillator is above the extreme level and the price closes below a MA
Related categories: Pine Script Trading