customindicators | Recent


· @dexterslab ·
$0.14
Dexters Tail Range(DTR)
/* A pseudocode to explain this indicator:
   
   Define the sample size (amount of candlesticks to use for calculations).
   default setting is 144 candleSticks. 
   Find and store :
           
    1.the tail range of each candlestick by:
      Repeating from the current candlestick counting backwards by the defined sample size:
      
         if Open price of candlestick is lower than  Close price 
        
        a.subtract lowest candle price from the open price the candlestick,
        b.subtract candle close price from the hishest price of the candlestick. 
         
         if Open price of candlestick is higher than  Close price 
        
        a.subtract open candle price from the highest price of the candlestick,
        b.subtract candle lowest price from the close price of the candlestick.
        
        
         using totals from step (a) and (b),calculate the arithmetic mean.
         Transform the difference into pips,
         Store each result as a value on the list of tail ranges to be averaged later.
            
   Find the average of the aforementioned list of ranges by:
      For each list
      Add all the stored ranges and divide the sum by the defined sample size.
      Display results.
 */

You can find the source code on my Github:
https://github.com/dexluke/DextersIndicators/blob/master/Dexters%20Tail%20Range(DTR).mq4
👍  , , , , ,
1 reply