OPEN-SOURCE SCRIPT

FFT Strategy Bi-Directional Stop/Profit/Trailing + VMA + Aroon

This strategy uses the Fast Fourier Transform inspired from the source code of tbiktag for the Fast Fourier Transform & LazyBear for the VMA filter.

If you are not familiar with the Fast Fourier transform it is a variation of the Discrete Fourier Transform. Veritasium on youtube has a great video on it with a follow up recommendation from 3brown1blue. In short it will extract all the frequencies from a set of data. tbiktag laid the groundwork for creating the indicator which will allow you to isolate only those signals which are the most relevant and remove the noise. I recommend having tbiktag's FFT Transform indicator side by side with this to understand what my variation is doing by setting similar settings.

Using this idea, you can then optimize a strategy to the frequencies that are best. The main entry signal is when the FFT Signal crosses above or below the 0 line.

Included with this strategy is the ability to optionally bi-directionally set:


  • Stop Loss
  • Trailing Stop Loss
  • Take Profit
  • Trailing Take Profit



Entries are optionally further filtered by use of the VMA using the algorithm from LazyBear which allows you to adjust a variable moving average with 3 market trend detections. Green represents upwards momentum; Blue sideways trading and Red downwards momentum. The idea being to filter out buy or sell entries unless the market is moving in that direction, and this makes a big difference as you can see for yourself when you turn it off or on. Turning it off will change the color of the FFT signal to orange instead of the green, blue, red colors.

I have added 2 custom stop loss types as well for experimentation:

1. VMA Filter stop loss to exit the trade if the VMA detects a market trend direction change matching the rules you have set. I have set this to off by default, but it is there so you can see what affect it may have on other tickers. It can increase the profit factor but usually at a cost of net profit.

2. The Aroon Filter stop loss with different lengths for the short or long direction. For the Aroon strategy (which is a trend change detector) it is considered bullish if the upper line (green in my code) is above 70 and the lower line (red in my code) is below 30 and the opposite for the bearish case. With this in mind, I have set it to filter by default only the extreme ends (99 and 1) to increase profit factor and net profit but I encourage you to try different settings and see how it affects things. Turning this off yields much higher net profit but at the cost of the profit factor and drawdown. To disable this just uncheck the 'Use Aroon Filter Long' (or short) and it will also hide the aroon graphics and crosses on the plot.

I will be adding more features in an attempt to lower the drawdown on this strategy but I hope you enjoy what I have so far!


AroonCentered OscillatorsFFTfouriertransformMoving AveragesOscillatorsstoplosstakeprofittrailingstoptrailingtakeprofitvariablemovingaverage

오픈 소스 스크립트

진정한 TradingView 정신에 따라, 이 스크립트의 저자는 트레이더들이 이해하고 검증할 수 있도록 오픈 소스로 공개했습니다. 저자에게 박수를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 출판물에서 이 코드를 재사용하는 것은 하우스 룰에 의해 관리됩니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.

차트에 이 스크립트를 사용하시겠습니까?


-=Gentleman Goat=- Download the TradingView Input Optimizer at tradingtools.software/optimizer
Discord: discord.gg/pGHHRczpbu
또한 다음에서도:

면책사항