TradingView
RicardoSantos
3 lut 2022 12:26

JohnEhlersFourierTransform 

International Business Machines CorporationNYSE

Opis

Library "JohnEhlersFourierTransform"
Fourier Transform for Traders By John Ehlers, slightly modified to allow to inspect other than the 8-50 frequency spectrum.
reference:
mesasoftware.com/papers/FourierTransformForTraders.pdf

high_pass_filter(source) Detrended version of the data by High Pass Filtering with a 40 Period cutoff
  Parameters:
    source: float, data source.
  Returns: float.

transformed_dft(source, start_frequency, end_frequency) DFT by John Elhers.
  Parameters:
    source: float, data source.
    start_frequency: int, lower bound of the frequency window, must be a positive number >= 0, window must be less than or 30.
    end_frequency: int, upper bound of the frequency window, must be a positive number >= 0, window must be less than or 30.
  Returns: tuple with float, float array.

db_to_rgb(db, transparency) converts the frequency decibels to rgb.
  Parameters:
    db: float, decibels value.
    transparency: float, transparency value.
  Returns: color.

Informacje o Wersji

v2 removed the upper limit for the function, corrected a typo in the code, thanks to Al-M for spotting it :)

Informacje o Wersji

v3 - another typo bytes the dust.. tump tump tump oO", nicely spoted by Al-M :)

Informacje o Wersji

v4 fixed the preview chart..
Komentarze
LonesomeTheBlue
Thank you for sharing this with the community!
GiriDeepAm
Hi! getting the following error trying to implement "transformed_dft(): window(end_freq.-start_freq) must be less than number of possible plots 30..
kakola
@GiriDeepAm, Me too, even if I pass (1,30). The function's defaults are (10,40) and that works at least.
RicardoSantos
@kakola, window refers to the difference between the start, end in the parameters (end - start = window <= 30 )
RicardoSantos
@GiriDeepAm, this was designed to be a indicator so i had the limitation built in to not do more than allowed plots with mutable colors (each plot with mutable color counts as 2 for the limit of 62), i may remove the limitation in a future update, but it will stay like this for now.
Al-M
Hi Ricardo,
What would be the reason for the presence of the yellow horizontal lines corresponding to the "frequencies" 5, 10, 15, and 30 on any plot of any instrument, irrespective of the resolution (min, 4h, day, week) of the plot?
RicardoSantos
@Al-M, either permanent cycles (unlikely), the level of noise is enough to register as a permanent cycle, bug :) ..
Al-M
@RicardoSantos,
DFT power calculation should be sinx^2 + cosx^2, not sinx^2*cosx^2.
RicardoSantos
@Al-M, thanks, its fixed now :)
Więcej