Quickfingers Luc base scanner - version 2This is my second implementation of a Pine Script Quickfingers Luc (QFL) base scanner that I have published on Trading View. QFL base scanners seek to provide buy signals according to the QFL trading strategy. To profitably trade using this script you should be familiar with the QFL trading strategy, scaling in and out of positions, and money risk management.
Background
All the QFL base identification Pine Scripts that I have inspected to date use a simple candlestick pattern of two lower lows followed by two higher lows to identify a base. Some scripts may combine this with a volume indicator as well. In practice, I found the results of this approach to be somewhat unreliable. The candlestick pattern may identify some significant bases, may identify minor bases (that should not be traded), but at the same time miss other significant bases entirely!
My first QFL base scanner sought to use Pine Script’s built in ta.lowest and ta.highest functions to identify bases and peaks. This approach depended on the time period selected to find the lowest lows and highest highs. This approach can be problematic because significant bases may be formed outside the nominated time period, leading to the identification of minor bases within the time period. I have left the first version of my QFL base scanning script in the Trading View indicators because it uses a different approach to this script that other people may still find useful.
My second version of the QFL base scanner does not use the Pine Script ta.lowest and ta.highest functions, and therefore does not rely on nominating a time period to look back through data.
User inputs
This script steps through the price data to find the following patterns that are used to confirm bases and peaks.
Base – bounce of x% above previous base confirms that base
Peak – fall of y% below previous peak confirms that peak
Buy signal – fall of z% below the base signals a buy signal.
x%, y% and z% are user configurable through the script settings. Small percentages will provide more, but riskier, buy signals; larger percentages will provide fewer, but safer, buy signals.
The script identifies QFL bases and buy signals and marks them on the price chart. These are able to be turned on and off in the script settings. The settings also allow the user to turn on plots for peaks, lowest lows and highest highs. These are not useful for applying the QFL trading strategy, but are calculations used in finding bases and can be useful for the user to understand what the script is doing in the background.
Troubleshooting
If looking at the past script results, you may think that the script is perfectly timing entry points at the bottom of market dips. This is NOT the case. The script is actually showing buy signals when the price falls z% below the PREVIOUS base. The current base is only retrospectively marked some periods later once the reversal is confirmed – a solid line marks a confirmed base in real time; a dotted line retrospectively repaints the line to the actual base. New bases are not tradeable using this script, but a percentage fall from the previous base is – this is the QFL trading strategy.
Pine Script may flag that this script has a repainting issue. Pine Script defines repainting as, “script behavior causing historical vs realtime calculations or plots to behave differently.” In the case of this script, bases are confirmed once the price has bounced x% off the low. The script then repaints a dotted line from the base that has been identified in real time (with a solid line) back to the point in the price data where the base actually occurs. The dotted line only aids in visual identification of the base, and does not impact on the real time identification of bases. A similar repainting issue occurs for identifying peaks. I have identified the lines in the script that cause this repainting. These lines can be commented out without affecting the buy signals generated by the script, but you will also lose the visual pinpointing of historical bases and peaks.
The user may find price charts where they think that the script has not correctly identified a base or peak. Usually, careful measurement will reveal that the price chart has not confirmed a base or peak by moving x% or y% from the previous base or peak respectively.
And before you ask, yes, Trading View alerts work with this script.
Enjoy.
Quickfingers
QaSH DCA StrategyThis is a backtesting script that demonstrates the power of incorporating dollar cost averaging into your trading strategies. Catch the bottom of those lightning fast dips buy placing your limit orders ahead of time.
Four entry conditions have been included:
- ASAP mode
- Quickfinger's Luc
- Bullish pivot point
- Bearish pivot point
An EMA-based entry condition filter is included
Placement of all DCA orders is adjustable, and "take profit" % is also variable and can depend on the size of the price dip.
QaSH DCA DaytraderThis script takes advantage of the power of DCA implemented in the QaSH DCA Algorithm script, and it applies it to new entry conditions. A "Quickfingers Luc" mode has been added, which creates new entry orders whenever a level of support has been identified. If price breaks the support level and quickly drops down, the orders will already be in place to catch the dip. This method can even catch the 1-second long, 50% flash dips that occur in some exchanges.
Four entry conditions are included in this initial release : ASAP, Quickfingers Luc, Bullish Pivot point, and Bearish Pivot point
All order placements are customizable
All take profit % values are based on the average entry price
Take profit % values can change based on how big the price dip was
Entry condition filter has been added and it uses a variable timeframe EMA
Stoploss function is available
Order size can be sent in the alerts, which allows for multiple setups to be running simultaneously in one account
All alerts are sent using the new "Any alert() function call" feature, which means this indicator will only take up one alert slot to cover all entry and exit alerts
Settings advice:
- If you think price is inflated, try conservative settings that either use a stoploss and EMA filter, or no stoploss but have some of your orders placed far below the current price with increasing volume. In a bear market this will beat the buy and hold.
- If you think the market is ready for a new bull run, then try experimenting with very aggressive settings to beat the buy and hold. For example: ASAP mode with 3 layers turned on. Orders placed at 0.5%, 3%, and 5%. Volumes at 30%, 30%, and 40% respectively. No stoploss. These settings were tested on ETH and beat the buy and hold during an extreme bull market period.
QaSH DCA Algorithm 2.0This is the strategy version of the QaSH DCA Algorithm indicator. This strategy version of the script includes live trading alert functionality, so it can be considered as a replacement that makes the indicator version obsolete. With this version, features have been added and also you can take advantage of TradingView's native backtesting system for more detailed backtest results.
QaSH DCA Algorithm implements a DCA strategy that takes advantage of price volatility by buying dips to average down, and adjusting price targets as the break-even price gets lower.
How does the DCA strategy work?
When the specified entry condition has occurred, the indicator will set up several limit orders below the current price. If price goes up a specified amount, then the layers will be overwritten at the higher prices. If price goes down and fills the first layer (limit order), then the Take Profit price is plotted and will be sent in an alert. If more layers are filled, then the TP price will move down accordingly as it’s based on the average entry price (alerts on each TP update). This action of lowering the average entry and TP price mitigates your risk, and increases the likelihood of a Take Profit event happening. This script uses a simple "ASAP" mode, where each deal will start exactly 2 bars after the last trade ended. An EMA filter and stoploss function was also added for risk management.
How does this differ from other DCA bots?
1) The layer placements, order volume , and “take profit %” for each layer or “safety order” is much more customizable than what you get from other services. For example, I can choose to have my TP% change, depending on how big the price dip was. Maybe on safety order 1 I want 10% TP, but on safety order 7 might want a 2% TP.
2) The entry condition is adjustable. For example, this script has an ema filter for entries.
3) Settings optimization. You can take advantage of the replay feature and TradingView's backtest system to see how trades would have played out, and how much PnL you would have made
4) You can use this indicator on more than just crypto. You can easily set up alerts for manual trades on stocks, or you can integrate it with your stock broker API of choice and automate your trades.
5) When combining this with an automation service, you will get unmatched execution speed by running it on your dedicated machine.
6) I can offer a lifetime subscription to the indicator upon request.
What kind of market is it best used on?
QaSH DCA Algorithm is best used on assets that are volatile. That means large and frequent swings up and down. Also I recommend running this on many uncorrelated assets at the same time. Better yet, run it with a variety of different settings simultaneously on the same asset.
What settings should I use?
The default settings are decent for most markets, and provide a good balance between profit potential and downside protection, although you can use a wide variety of settings. In a strong bull market its best to either bring up your layers to catch smaller dips, or you can go big on the first few layers (maybe 4 layers, 25% on each layer for example). In a sideways or brearish market you'll want more downside protection, so you'll want the larger orders to be at lower prices, or possibly use the stoploss and EMA filter.
QaSH DCA AlgorithmQaSH DCA Algorithm implements a DCA strategy that takes advantage of price volatility by buying dips to average down, and adjusting price targets as the break-even price gets lower.
How does the DCA strategy work?
When the specified entry condition has occurred, the indicator will set up several limit orders below the current price. If price goes up a specified amount, then the layers will be overwritten at the higher prices. If price goes down and fills the first layer (limit order), then the Take Profit price is plotted and will be sent in an alert. If more layers are filled, then the TP price will move down accordingly as it’s based on the average entry price (alerts on each TP update). This action of lowering the average entry and TP price mitigates your risk, and increases the likelihood of a Take Profit event happening. More entry conditions will be added as time goes on, although complex entry conditions are not necessary for the strategy to work. All the meat of the DCA strategy is in the layer placement, order volume , and TP %.
How does this differ from other DCA bots?
1) The layer placements, order volume , and “take profit %” for each layer or “safety order” is much more customizable than what you get from other services. For example, I can choose to have my TP% change, depending on how big the price dip was. Maybe on safety order 1 I want 10% TP, but on safety order 7 might want a 2% TP.
2) Settings optimization. You can take advantage of the replay feature and see how trades would have played out, and how much PnL you would have made (strategy version is coming soon)
3) You can use this indicator on more than just crypto. You can easily set up alerts for manual trades on stocks, or you can integrate it with your stock broker API of choice and automate your trades.
4) When combining this with an automation service, you will get unmatched execution speed by running it on your dedicated machine.
5) I can offer a lifetime subscription to the indicator upon request.
What kind of market is it best used on?
QaSH DCA Algorithm is best used on cryptocurrencies and stocks, and it is best used on assets that are volatile. That means large swings up and down. Also I recommend running this on many uncorrelated assets at the same time.
What settings should I use?
The default settings are decent for most markets, and provide a good balance between profit potential and downside protection, although you can use a wide variety of settings. In a strong bull market its best to either bring up your layers to catch smaller dips, or you can go big on the first few layers (maybe 4 layers, 25% on each layer for example). In a sideways or brearish market you'll want more downside protection, so you'll want the larger orders to be at lower prices.
What should I do if price goes below my last layer?
The best solution is to keep a cash reserve on the side at all times. If price looks like it has reached a low point below your lowest layer, then manually buy more to average down further. This action will help it along and get you in the green sooner.
Disclaimer: In order to get a large position in an asset, you need to have most of your layers fill. That means you have to be comfortable with buying more as the price goes down, patiently waiting for the bounce that occurs afterward. This is the working principle of Dollar Cost Averaging, and it's a proven method for most markets.