1. Home
  2. Articles (from Patreon)
  3. QFL Pine script available – backtest and alerts compatible

QFL Pine script available – backtest and alerts compatible

Update 1 – Added bot and QFL settings used in example with MATIC

For a while now I’ve been trying to find a decent implementation of QFL that we can use for:

  • backtesting using the backtest script
  • for sending alerts from trading view to DCA bots that currently don’t support QFL
  • for creating strategies that combine multiple factors, for example: QFL + RSI + Stochastic. Having a pine script that converges all these conditions and sending a BUY signal only when all conditions are met.

Last weekend I looked into a few alternative open-source options available on trading view and decided to give them a try. One was offering multi-time frame but I decided to go based on Quick Fingers Luc’s advice on this video:

https://www.youtube.com/watch?v=J3CMHqfE2-c&ab_channel=QuickfingersLuc 

and also based on what 3Commas does, which I find pretty good already in terms of results (Bakker and Johano use this):

New QFL script 

Luckily I manage to find a decent version of QFL that is single timeframe. I had to migrate it to Pine Script 4 and add support for backtesting and alerts, deal with some repainting issues. The original script is from 2016 and it’s got almost 7k likes, but it still needed some clean up.

In the chart below you can see it in action on MATIC/USDT. 

The results are very impressive. Even though in 232 days MATIC lowest drawdown from top has been 72% and this DCA setup uses a tiny tiny max deviation of 4.4%, it’s managing to close ALL deals in profit and make a very impressive 265%. In May this token went down 72% and there are no red bags. 

During those 232 days the longest time it took to close a deal was 5.8 days.

I made the QFL pine script open source and public on Trading View. (if TV moderators decide to take it down I can update this link, sometimes they do that).

Can you add QFL to backtest simulator mode?

Yes, I’m planning now to add MFI, CCI, ULT and QFL ASAP.

For now if you want to backtest QFL you can add it to the chart and use “indicator” deal start condition mode.

Will this version perform exactly the same as the 3Commas built-in QFL one? 

The 3Commas version of QFL is closed-source so there’s no way I can guarantee that this version will open the same deals or perform similarly. 

They might be using some optimisations or internal parameters that might make it slightly different. A paper trading bot could potentially show that it’s taking similar deals though.

What are the settings used in the bot mentioned in the example?

DCA settings:

  • BO 10
  • SO 20
  • 2 SO’s
  • % dev = 2
  • vol scale = 2
  • step scale = 1.2
  • TP 6%

QFL settings:

  • TF = 2 hours
  • Vol MA = 1000
  • percentage = 4.5
  • max candle age = 0
Updated on October 27, 2021

Was this article helpful?

Related Articles

Leave a Comment