Skip to content
Home » Posts » Documentation » Quickfingers Luc’s Base Breaking Indicator & Strategy v2.5

Quickfingers Luc’s Base Breaking Indicator & Strategy v2.5

Table of Contents

Overview

This TradingView (TV) indicator attempts to implement Quickfingers Luc’s (QFL) Base Breaking trading methodology.  The indicator will monitor the chart price action and identify bases as they form and provide alert notifications for when bases and/or layers are cracked and respected.

Previous Documentation

The following is the original PDF documentation of the indicator. In the future, the PDF contents will be migrated to this posting as its final destination. In addition, the QFL Overview video is also available.

YouTube Video Overview

Indicator Anatomy

Figure 1 – Indicator Anatomy

Indicator Settings

GENERAL INFO

Figure 2 – General Info Section

Version

The version input is for displaying the published version of the indicator. It is intended to be for informational use only.

Link to TradingView Script

This field contains the URL link to the TradingView script homepage. The expectation is that you would copy the value and paste it into your browser’s address bar to navigate to the webpage.

Link To Documentation

This field contains the URL link to the script’s documentation webpage. The expectation is that you would copy the value and paste it into your browser’s address bar to navigate to the webpage.

BASE CONFIRMATION SETTINGS

Figure 3 – Base Confirmation Settings Section

Number Of Bars To Use For Price Drop Calculation

Defines the number of bars to use as a lookback period when performing the price drop calculation. See the How Are Bases Identified section for details on how this is used. The minimum value is 1 and the maximum is 48.

Number Of Bars To Use For Price Bounce Calculation

Defines the number of bars to use as a lookback period when performing the price bounce calculation. See the How Are Bases Identified section for details on how this is used. The minimum value is 1 and the maximum is 48.

Minimum Price Drop (%)

Defines the minimum price drop that must be exceeded in order to accept a pivot low price as a valid base price. See the How Are Bases Identified section for details on how this is used. The minimum value is 0 and the maximum is 100. A value of 0 will disable the use of the price drop filtering.

Minimum Price Bounce (%)

Defines the minimum price bounce that must be exceeded in order to accept a pivot low price as a valid base price. See the How Are Bases Identified section for details on how this is used. The minimum value is 0 and the maximum is 100. A value of 0 will disable the use of the price drop filtering.

Volume Must Be This Many Times Above Its MA

Defines the volume factor to use when validating the volume level at the pivot low point of the bullish fractal. The minimum value is 0 and the maximum is 10. A value of 0 will disable the use of volume filtering.

Volume MA Length

Defines the length of the moving average for the volume values. The minimum value is 1.

Minimum Percent Change of Price For New Bases (%)

Defines the minimum percent change of price that must be exceeded in order to accept new bases from the current base price. It is only applied to base pivot points that are below of the current active base price. The minimum value is 0 and the maximum is 100. A value of 0 will disable the use of the base filtering.

Anchor Base Line On The Bar’s

Defines where to place the base line on the pivot low bar of the bullish fractal. There are only two possible values:

  • Open/Close – The base price will be set to the lowest value of either the Open or Close price of the pivot low bar of the bullish fractal.
  • Low – The base price will be set to the Low price of the pivot low bar of the bullish fractal.

LAYER SETTINGS

Figure 4 – Layer Settings Section

Layer Trading Type

Defines the method of trading for the layers. There are only two possible values:

  • DCA – The indicator will recalculate the average buying price and set the Break-even, Stop-loss, and Take Profit prices accordingly.
  • Grid – As price action crosses the DCA layers, the indicator will price sell limit orders to the layer above it. Once the sell order is filled, it will then proceed to create buy limit orders to buy back in. The entire set of trading will conclude when the price action fills the sell limit order at the base price.

Layer Unit Type

Defines the unit type for each of the subsequent 9 layer inputs below. There are only two possible values:

  • Percentage – Each of the layer input values are to be treated as percentage values.
  • Fixed Amount – Each of the layer input values are to be treated as fixed amounts of the quote price.

Layer 1-9

Defines either the percentage or fixed amount to offset relative to the base price. The minimum value for the Layer 1 input is 0.00000001 (Satoshi), whereas the remaining inputs is 0 and the maximum is unlimited. A value of 0 will disable the use of the layer.

TRADE SETTINGS

Figure 5 – Trade Settings Section (Part 1)
Figure 6 – Trade Settings Section (Part2)

Trade Start Date/Time

Defines the starting date and time to begin actively locating bases for trading. Nothing will be plotted to the chart before this timestamp.

When the input is used to specify a date/time that is within the chart’s time range, it will display a label and colored column to visualize the starting point…

Figure 7 – Trade Start Date/Time Label

Trade Stop Date/Time

Defines the stopping date and time to end actively locating bases for trading. Nothing will be plotted to the chart after this timestamp.

When the input is used to specify a date/time that is within the chart’s time range, it will display a label and colored column to visualize the ending point…

Figure 8 – Trade Stop Date/Time Label

Initial Capital (Indicator Only)

This field is only present for the Indicator version because the Strategy version has the Initial Capital field defined in the Properties tab.

The capital used by the script when back-testing and forward testing on real-time data.

Entry Order Size

Defines the entry order size for the first layer when entering into a position.

Unit

Defines the unit of the Entry Order Size value, which has three possible values:

  • Contracts (Base Currency) – Sets the unit to be a fixed number of contracts for the order size.
  • Fixed Amount (Quote Currency) – Sets the unit to be a fixed amount of the quote currency.
  • % Of Initial Capital– Sets the unit to be a percentage of the Initial Capital (located in the Properties tab for the Strategy version).

Compounding (% of Initial Capital Only)

When checked, the strategy will use the Initial Capital plus the accumulated Net Profit (also known as Equity). This option is only applicable when using % Of Initial Capital for the Entry Order Size Unit input.

Maximum Number Of Cracks Allowed Per Base

Defines the maximum number of times that a base can be reused. A crack is defined as a the Layer 1 order being filled. If the trading concludes above the base price, it will be reused, otherwise it will not be reused since it cannot setup the DCA layers anymore. The minimum value is 0 and the maximum is 10. A value of 0 will disable the use of this setting.

Maximum Number Of Bars To Remain In Trade

Defined the maximum number of bars that will elapse before the trade will forcefully close. The bar count begins when the Layer 1 order is filled. The minimum value is 0 and the maximum is unlimited. A value of 0 will disable the use of this setting.

Verify Price For Limit Orders (ticks)

Defines how the limit order is to be considered “filled”. The indicator only considers limit orders filled when prices move a certain number of ticks past the limit price. The minimum value is 0 and the maximum is 1. A value of 0 will disable the use of this setting.

The strategy version will have this same input in the Properties tab, thus make sure these two inputs have the same value.

Exchange Entry Commission (%)

Defines the commission percentage the exchange will charge for entries. This value will be used to properly offset the Break-even price, which is used to calculate the Take Profit and Stop-loss prices. The minimum value is 0 and the maximum is 5. A value of 0 will disable the use of this setting.

Exchange Exit Commission (%)

Defines the commission percentage the exchange will charge for exits. This value will be used to properly offset the Break-even price, which is used to calculate the Take Profit and Stop-loss prices. The minimum value is 0 and the maximum is 5. A value of 0 will disable the use of this setting.

Stop Loss Percentage (-%)

Defines the stop-loss percentage offset relative the break-even price. This value must be a negative value. Therefore, the minimum value is -100 and the maximum is 0. A value of 0 will disable the use of this setting.

Take Profit Percentage (+%)

Defines the take profit percentage offset relative the break-even price. This value must be a positive value. Therefore, the minimum value is 0 and the maximum is 100. A value of 0 will disable the use of this setting which is needed for the “Grid” option in the Layer Trading Type input.

Adjust Take Profit At Layer 1-9 Cross (%)

Defines the new take profit percentage value to use instead of the value that is defined in the Take Profit Percentage input. This value can be a positive or negative value. Using a negative value will act as a pseudo stop-loss to exit at a loss. A value of 0 will disable the use of this setting

Position Size Multiplier (PSM)

Defines the multiplier to use when adjusting the volume size for each subsequent layer after Layer 1. The minimum value is 0.1 and the maximum is unlimited.

Adjust PSM At Layer 2-9 Cross (%)

Defines the new multiplier value to use instead of the value that is defined in the Position Size Multiplier (PSM) input. The minimum value is 0.1 and the maximum is unlimited.

Enable Trade Eligibility Condition

Use this input to link to a specific data point on an existing indicator on the chart. The value is then used for the ‘Chart/Indicator Data Point‘ value in the ‘Eligible When‘ and ‘The Value‘ inputs.

When checked, the following inputs will be used to evaluate if a base pivot low point is eligible to be plotted and used for setting up a new trade deal.

Chart/Indicator Data Point

Use this input to link to a specific data point on an existing indicator on the chart or any OHLC data point. The value is then used for the ‘Eligible When‘ or ‘The Value‘ inputs in defining the eligibility condition.

Eligible When

Defines what data point in the indicator or chart is to be used in the comparison condition.

Is

Defines the operator to use when comparing the data points in the indicator or chart.

The Value Of

Defines the data point in the indicator or chart to use in the comparison condition.

Custom Value 1 & Custom Value 2

When the ‘The Value Of‘ input is set to ‘Custom Value(s)‘, this input will define the values to use. If the ‘Is‘ input is set to ‘Between‘ or ‘Not Between‘ then ‘Custom Value 2‘ is required.

ANY ALERT() FUNCTION CALL SETTINGS

This section is for the Indicator version only.

NOTE: See the Using Alerts in TradingView section for details on how to choose among the two alerts notification framework that TradingView offers.

Figure 9 – Any Alert() Function Call Settings Section (Part 1)
Figure 10 – Any Alert() Function Call Settings Section (Part 2)
Figure 11 – Any Alert() Function Call Settings Section (Part 3)

Warning: This indicator uses the “barstate.isconfirmed” variable therefore it will cause a repaint warning when creating alerts.

This is simply a warning message. The check-box has no function influence to the performance of the script.

TradingView has published documentation stating that the use of the barstate variables in any script will provoke a Warning message to display when creating an alert

Figure 12 – Warning from TradingView when creating an alert

Placeholder 1-3 Name & Value

Defines up to three custom placeholder names and values (constant) that can be used in each of the alert messages. This can be useful for defining special parameters that are constant in nature and would be helpful to not repeat in all the message text boxes, but simply define once and use in all the messages.

Figure 13 – Example of using Placeholder Names and Values with Alert Messages

About Custom Placeholders for Alert Messages

Each of the following inputs support custom placeholders that will be replaced with their real-time values before the message notification is sent out from TradingView. The supported placeholders are:

PlaceholderDescription
{{exchange}}It will be replaced with the exchange name inherited from the chart using the syminfo.prefix variable value from the Pine Script language.
{{ticker}}It will be replaced with the exchange name inherited from the chart using the syminfo.ticker variable value from the Pine Script language.
{{base_currency}}It will be replaced with the base currency inherited from the chart, e.g. “BTC”, if the chart symbol is BTCUSD.
{{quote_currency}}It will be replaced with the base currency inherited from the chart, e.g. “USD”, if the chart symbol is BTCUSD.
{{event_name}}It will be replaced with the name of the event that triggered the alert, e.g. “Base Created”.
{{base_price}}It will be replaced with the base price value.
{{next_base_price}}It will be replaced with the next base price value.
{{base_respected_price}}It will be replaced with either the take profit or stop loss price value.
{{break_even_price}}It will be replaced with the break even price value.
{{take_profit_price}}It will be replaced with the take profit price value.
{{stop_loss_price}}It will be replaced with the stop loss price value.
{{layer_1_price}} thru {{layer_9_price}}It will be replaced with the layer price value for the given layer number.
{{layer_1_quote_volume}} thru {{layer_9_quote_volume}}It will be replaced with the quote volume that was used for the layer entry.
{{layer_1_base_quantity}} thru {{layer_9_base_quantity}}It will be replaced with the base quantity that was used for the layer entry.

Base Created Message

When checked, the “Base Created” event will using the give message value for the alert notification message.

The default value is: {{event_name}} at {{base_price}}

Base Cracked Message

When checked, the “Base Cracked” event will using the give message value for the alert notification message.

The default value is: {{event_name}} at {{base_price}}

Layer 1-9 Cracked Message

When checked, the “Layer Cracked” event will using the give message value for the alert notification message.

The default value is: {{event_name}} at {{layer_#_price}}

Layer 1-9 Respected Message

When checked, the “Layer Respected” event will using the give message value for the alert notification message.

The default value is: {{event_name}} at {{layer_#_price}}

Take Profit Crossed Message

When checked, the “Take Profit Crossed” event will using the give message value for the alert notification message.

The default value is: {{event_name}} at {{take_profit_price}}

Stop Loss Crossed Message

When checked, the “Stop Loss” Crossed event will using the give message value for the alert notification message.

The default value is: {{event_name}} at {{stop_loss_price}}

CHART SETTINGS

Figure 14 – Chart Settings Section

Override Minimum Tick Precision

Defines the exchange’s price precision of the quote currency. The Break-even, Take Profit, Stop-loss and DCA layer prices will be adjusted according to the supplied precision value. There are 10 possible options:

  • 0.1 (tenth)
  • 0.01 (hundredth)
  • 0.001 (thousandth)
  • 0.0001 (ten thousandth)
  • 0.00001 (hundred thousandth)
  • 0.000001 (millionth)
  • 0.0000001 (ten millionth)
  • 0.00000001 (hundred millionth)
  • Custom – Using this option will require the Custom Tick Precision input to be used.
  • None – Using this option will simply default the precision to be the same as the syminfo.mintick value.

Custom Tick Precision

Defines the custom precision to use for price levels on the indicator. Some exchanges require a precision of 0.05 cents in USD, thus you would enter 0.05 into this field. The minimum value is 0 and the maximum is 5. A value of 0 will disable the use of this setting.

Method To Adjust Prices To Minimum Tick Precision

Defines the method to use when adjusting price precision. There are two possible values:

  • Truncate – This option will cause the indicator to simply remove all values after the precision position.
  • Round – This option will round the last signification position using the number value of the digit after the position. For example. if the precision is 0.01, then the value 1.015 will round to 1.02.

Show Layer Lines

Defines whether or not to display the layer lines and even when to display them. There are three possible options:

  • Never – Completely disables the lines from displaying
  • Always – Any time a base line is formed, the layer lines will also paint.
  • Only When In Trade – The layer lines will paint when the Layer 1 limit order is filled.

Show Breakeven Line

When checked, the Breakeven price line will paint.

Show Layer Crossing Shapes

When checked, the triangle shapes will appear when price action crosses a DCA layer price.

Show Statistics Table

When checked, the QFL Statistics table will appear displaying statistical data related to the performance of the indicator on the chart.

Bars In Trade Section

Determines the visibility of the BARS IN TRADE section of the QFL Statistics table.

Drop/Bounce Section

Determines the visibility of the PRICE DROP % and PRICE BOUNCE % sections of the QFL Statistics table.

Layers Cracked Section

Determines the visibility of the LAYERS CRACKED section of the QFL Statistics table.

Table Position

Changes the position of the table on the chart using the combination of values in the two drop-downs that are provided:

  • Top, middle, Bottom
  • Left, Center, Right

Text Size

Defines the text size of the content in the table. Available options are: tinysmallnormallarge, and huge.

Stat Label Font Weight

Changes the font weight for the labels of each of the data points in the table. Available options are: Bold and Normal.

Color Theme

Changes the colors of the table.

Using the QFL Statistics Table

Both the Indicator and Strategy versions will display the Statistics table that summarizes statistical data points using the price action history of trades. This section will describe each section of the data points to help you understand the performance of the indicator.

Table Anatomy

Figure 15 – QFL Statistics Table

Overview Section

Bases Created

Displays a count value of all the bases that were plotted on the chart, including the Next Base plot series.

Bases Cracked (Layer 1 Cracked)

Displays a count value of the bases that were cracked by price action crossing the first layer.

Bases Respected

Displays a count value of the bases that were respected by price action either crossing the take profit price or stop loss price.

Win Rate

Displays the result of the following equation: [No. Of Bases Cracked] / [No. Of Respected] X 100

Bars In Trade Section

Mean (Duration)

Displays the average number of bars in a trade session. In addition, the value will display the number of years, months, weeks, days, hours, minutes, and seconds in parentheses.

Median (Duration)

Displays the middle value of all the collected number of bars in a trade session. In addition, the value will display the number of years, months, weeks, days, hours, minutes, and seconds in parentheses.

Mode (Duration)

Displays the most frequent value of all the collected number of bars in a trade session. In addition, the value will display the number of years, months, weeks, days, hours, minutes, and seconds in parentheses.

Min (Duration)

Displays the minimum value of all the collected number of bars in a trade session. In addition, the value will display the number of years, months, weeks, days, hours, minutes, and seconds in parentheses.

Max (Duration)

Displays the maximum value of all the collected number of bars in a trade session. In addition, the value will display the number of years, months, weeks, days, hours, minutes, and seconds in parentheses.

Std. Dev. (Duration)

Displays the standard deviation value of all the collected number of bars in a trade session. In addition, the value will display the number of years, months, weeks, days, hours, minutes, and seconds in parentheses.

Total (Duration)

Displays the sum value of all the collected number of bars in a trade session. In addition, the value will display the number of years, months, weeks, days, hours, minutes, and seconds in parentheses.

Price Drop % Section

Mean / Median / Mode

Displays the mean (average), median (middle value), mode (most frequent value) of all the price drop percentages that were found for each base that was detected (including the Next Bases).

Count / Min / Max

Displays the count, minimum, and maximum values of all the price drop percentages that were found for each base that was detected (including the Next Bases).

Std. Dev.

Displays the standard deviation value of all the price drop percentages that were found for each base that was detected (including the Next Bases).

Price Bounce % Section

Mean / Median / Mode

Displays the mean (average), median (middle value), mode (most frequent value) of all the price bounce percentages that were found for each base that was detected (including the Next Bases).

Count / Min / Max

Displays the count, minimum, and maximum values of all the price bounce percentages that were found for each base that was detected (including the Next Bases).

Std. Dev.

Displays the standard deviation value of all the price bounce percentages that were found for each base that was detected (including the Next Bases).

Layers Cracked Section

Mean / Median / Mode

Displays the mean (average), median (middle value), mode (most frequent value) of all the layers that were cracked in each trade session.

Count / Min / Max

Displays the count, minimum, and maximum values of all the layers that were cracked in each trade session.

Std. Dev.

Displays the standard deviation value of all the layers that were cracked in each trade session.

Total Layers Cracked

Displays the sum of all the layers cracked in all the trade sessions.

No. of Layer 1-9 Cracks

Displays a count value of all the layers that were cracked by level index number. It will also show the ratio and percentage of the number of layers cracked to the sum of all layers cracked. These values will only update as soon as a trade session is completed.

Using Alerts In TradingView

The indicator version of the script makes use of TradingView™’s two different alert types to support 3Commas. They are:

  • Alert Condition
  • Any Alert() Function Call

This section will cover creating alerts for these two types and discuss the pros and cons of each.

Alert Condition

This alert type is the traditional method of creating an alert using an indicator. The dialog looks like this…

Figure 9 – Create Alert using Custom Alert Conditions

The Condition drop-down will contain numerous alert conditions that the indicator defines. They are as follows:

ConditionDescription
Any Layer CrackedOccurs when the price action crosses any of the enabled layers.
Base CrackedOccurs when the price action crosses the existing base price for the first time.
Base CreatedOccurs when the indicator detects a new base price.
Base RespectedOccurs when the trading session is completed by either the stop loss or take profit price being crossed.
Layer 1-9 CrackedOccurs when the price action crossed the layer number.
Layer 1-9 RespectedOccurs when the price action crosses the layer above the given layer number. This will require that the Layer Trading Type be set to “Grid”.
Stop Loss CrossedOccurs when the price action crosses the stop loss price line for the first time.
Take Profit CrossedOccurs when the price action crosses the take profit price line for the first time.

Choosing any of the above conditions will set up the alert to display the Message text area where you can enter any value you would like to have delivered in the notification. The value will supports the standard placeholder that TradingView supports ({{close}}, {{time}}, etc.), but it will not support the custom placeholders that the indicator provides for the Any Alert() Function Call feature.

If you want to receive any of these alert conditions from the indicator, you will need to create an alert for each one using this alert type. If you would like to use only one alert for of these alert conditions, then use the Any alert() function call type as described in the next section.

Any Alert() Function Call

This alert type is the new method of creating an alert with an indicator that implements the alert() function. The dialog looks like this…

Figure 10 – Create Alert using “Any alert() function call” Condition

This new alert method is capable of handling all the signals that make use of the alert() function in the script. As a result, one single alert can handle any and all of the alert events that the indicator may generate. In order to control which events are sent to the alert() function method, you will need to check the checkbox next to the alert message in the indicator settings, like this…

Figure 11 – Base Create Message Checked Example

In this screenshot, only the Base Created message will be sent to the alert() function call. As a result, using this alert type is only advantageous if you want to reduce the number of alerts created for the indicator and handle multiple events. Otherwise, using the traditional alert condition type is sufficient.

Another advantage to using this type of alert is to make use of the custom placeholders the indicator provides, which are:

{{exchange}}, {{ticker}}, {{base_currency}}, {{quote_currency}}, {{event_name}}, {{base_price}}, {{next_base_price}}, {{break_even_price}}, {{take_profit_price}}, {{stop_loss_price}}, {{layer_1_price}} thru {{layer_9_price}}

Helpful Tips

Once you create an alert, TradingView™ will take a snapshot of the indicator’s code and your settings and save it with the alert so that they can successfully run it on their servers and send notifications via Email, SMS, mobile app, or Webhook URLs. As a result, there is no need to do anything special to the indicators to maintain the alerts. But, do keep in mind that changing the indicator settings after creating the alert will NOT update the alert. You will have to delete the alert and recreate it, if you want the new settings to be effective.

In addition, indicator settings are stored with the chart, so as you experiment with settings and want to save a specific set of settings, you can save the chart and copy it into a new name for future reference.

Strategy Alerts

DO NOT USE STRATEGY ALERTS WITH AUTOMATION!

Important Note

Please read the Important Note section on TradingView’s Stategy Alerts page 🡵. Specifically, this statement:

Strategies are more susceptible to repainting than indicators because the broker emulator makes assumptions about price movement to simulate orders on historical bars.

Creating Strategy Alerts

The strategy version of the script will only support the order fill events as normal, but the custom placeholders that are supported in the indicator version are NOT supported here. An order fill event is any event generated by the broker emulator which causes a simulated order to be executed.

The following placeholders are supported by TradingView™ for these alerts in the Message text area:

  • {{strategy.position_size}} — returns the value of the same keyword in Pine, i.e., the size of the current position.
  • {{strategy.order.action}} — returns the string “buy” or “sell” for the executed order.
  • {{strategy.order.contracts}} — returns the number of contracts of the executed order.
  • {{strategy.order.price}} —returns the price at which the order was executed.
  • {{strategy.order.id}} —returns the ID of the executed order (the string used as the first parameter in one of the function calls generating orders: strategy.entry, strategy.exit or strategy.order).
  • {{strategy.order.comment}} — returns the comment of the executed order (the string used in the comment parameter in one of the function calls generating orders: strategy.entry, strategy.exit or strategy.order). If no comment is specified, then the value of strategy.order.id will be used.
  • {{strategy.order.alert_message}} — returns the value of the alert_message parameter which can be used in the strategy’s Pine code when calling one of the functions used to place orders: strategy.entry, strategy.exit or strategy.order. This feature is only supported in Pine v4.
  • {{strategy.market_position}} — returns the current position of the strategy in string form: “long”, “flat”, or “short”.
  • {{strategy.market_position_size}} — returns the size of the current position as an absolute value, i.e. a non-negative number.
  • {{strategy.prev_market_position}} — returns the previous position of the strategy in string form: “long”, “flat”, or “short”.
  • {{strategy.prev_market_position_size}} — returns the size of the previous position as an absolute value, i.e. a non-negative number.

Source: https://www.tradingview.com/support/solutions/43000481368-strategy-alerts/ 🡵

Send me an email when this page has been updated

Leave a Reply

Your email address will not be published.