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.

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.

Entry Order Size & Unit (Strategy Only)

Defines the entry order size for the first layer when entering into a position. The unit of the input value is determined by the adjacent drop-down, which has two possible values:

  • Contracts – Sets the unit to be a fixed number of contracts for the order size.
  • % Of Equity – Sets the unit to be a percentage of the equity, which is considered to be the Initial Capital (located in the Properties tab) plus the accumulated Net Profit at the time of entry.

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 7 – Any Alert() Function Call Section

Each of the 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.
{{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.

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}}

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 8 – 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 Label

When checked, the QFL Statistics label will appear displaying statistical data related to the performance of the indicator on the chart. In addition, the label background color, text color, and text size can be defined.

Bars Offset (Max. 500)

Defines the number of bars to offset the label from the current, real-time bar.

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. Required fields are marked *