External Indicator Analysis Overlay | Buy/Sell | HTF Heikin-AshiThis chart overlay offers multiple candlestick display options. The Regular (Japanese) and the Heikin-Ashi candles are well known. The Mari-Ashi (or Renko) option is something special as it should be timeframe independent, so that sideways action should be represented in one candle. That is difficult to realize as an overlay on the normal candlestick structure, but perhaps the chosen implementation is useful nonetheless. The Velocity option is experimental and is designed to show if the price has accelerated too much in a trend direction. In this case, the highs and lows do not reflect the actual highs and lows, but indicate the overshooting velocity. The opening of the candle also depends on the inherent velocity, but the close of the candle is always the actual close. Anyway, it doesn't look very useful, but the option is there.
All options can be applied to higher timeframes. A usable setting is obtained by disabling only the body of the TradingView candles in regular mode and enabling this overlay.
A large part of this overlay consists of buy/sell indication settings. For activation it is necessary to select an external source. For example the “Relative Bi-Directional Volatility Range”, specifically the Trend Shift Signal (TSS). This signal switches from 0 to 1, if the trend becomes bullish or from 0 to -1, if the trend becomes bearish. It will be automatically detected without specifying the Indication Type. Alternatively, the Volatility Moving Average (VMA) would meet the requirements for the Indication Type “Buy = positive | Sell = negative”. The Moving Average Convergence Divergence (MACD) also fulfills these conditions. Another example is to use any Moving Average with the Indication Type “Buy = rising | Sell = falling”. In the chart above the Hull Moving Average (HMA) is used. In addition, it is possible to reverse the signal, so that positive signals become negative and vice versa. The signals will be labeled as Buy or Sell on the chart.
The user can analyze whether the provided signals are good or bad indications for going long or short or simply for rebalancing a portfolio. Therefore, it is possible to set a starting point for the analysis and choose a weighting for the investments from 0% to 100% of the portfolio. To avoid sleepless nights, a very reliable (and conservative) setting seems to be Rebalancing with 50% (very similar to the well-known 60/40 portfolio). The calculation results are shown in a table.
As a small addition there is the possibility to label the peaks by setting the distance between the highs/lows. This will make the quality of the buy and sell signals even more clear.
External
Click Signal IndicatorThis is a Signal Indicator that emits signals based on mouse clicks when the indicator is added to the chart, or later on in the "Settings/Inputs" tab by changing/selecting the open time of the desired bar of each one of the signals.
It is designed to be used as an External Input for the "Template Trailing Strategy" to verify the correctness of the features the aforementioned script offers, and to provide an easy way to play around with this framework.
Last but not least this script offers a way to debug and report problems when this is necessary. Moreover, this script is a simple example you can copy-paste and create your own custom signal indicator that can be "plugged into"
the "Template Trailing Strategy" taking advantage of all the fancy stuff the TTS framework can provide!
To connect this signal indicator to the TTS you have to change the "Deal Conditions Mode" to '🔨External' and the 'External Input 🛈➡' to 'CSI:🔌Signal' in the TTS "Settings/Inputs" tab. For more information check the "Template Trailing Strategy - Part 02" video tutorial.
Signal ViewerThe "Signal Viewer" script is a debugging tool that can be used for the signal of a Signal Indicator script like the "Two MA Signal Indicator" or the "Template Signal Indicator". This script will visualize the signal based on the convention that was defined in the settings. Also, alerts will be produced based on this convention. It's useful to be used before you connect the signal indicator script to a template strategy like the "Template Trailing Strategy" script. You can cross-validate the correctness of the signal that the indicators emit and make sure it is aligned with the expected behavior after the decomposition of the signal using the convention described in the settings. Please make sure that the connection in the "Signal Viewer" script matches the convention used by the template strategy script.
Template Signal IndicatorThis script is an example on how to create a custom indicator that produce start/end long/short deal signals based on configurable conditions from internal and external indicators.
This indicator can be used as an external indicator to other strategies like "Template Trailing Strategy" that will execute the deals and enter the desired positions based on the signals produced by this script.
Combining this script with the aforementioned strategy (or any other compatible) has the advantage that you can backrest the results of your custom deal conditions. Also additional functionality that is provided by the strategy can be utilized (e.g. Take Profit Targets, Trailing Stop Loss etc.).
In this particular example I combined the RSI and Stoch RSI indicators (internal) with the "Trend Explorer" indicator (external) so it produces buy and sell signals based on the logic I defined in the input tab of this indicator. To combine "indicators on indicators" you need Pro+ TV subscription.
The convention I use to communicate the signals is the following (2 -> enter long, 1 -> exit long, -2 -> enter short, -1 ->exit short). However, this convention is also configurable in the consumer/strategy script "Template Trailing Strategy" so make sure that both script "speak the same language" before procced.
external_input_utilsLibrary "external_input_utils"
Collection of external input utilities for conversion and other hacky functions
str_to_src(value) str_to_src - Convert the string value to the coresponding source series. It can be used to limit the "input.source" choices provided to the end user.
The most interesting part is that it can be used to overcome the "one input.source call limitation" for external inputs to your script
Parameters:
value : - The string equivalent to the source to be converted
Returns: series of the coresponding source
eval_cond(input, operator, value, defval) eval_cond - Evaluate the condition given an operator
Parameters:
input : - The input to be compared with. It can be an external input or a regular one
operator : - The string operator that describe the coparison operation
value : - The value to compare with the input. This can be a serries or a constant
defval : - The boolean value to return when 'noop' is selected
Returns: series of bool the result of the operation evaluation
Signal_Data_2021_09_09__2021_11_18Library "Signal_Data_2021_09_09__2021_11_18"
Functions to support my timing signals system
import_start_time(harmonic) get the start time for each harmonic signal
Parameters:
harmonic : is an integer identifying the harmonic
Returns: the starting timestamp of the harmonic data
import_signal(index, harmonic) access point for pre-processed data imported here by copy paste
Parameters:
index : is the current data index, use 0 to initialize
harmonic : is the data set to index, use 0 to initialize
Returns: the data from the indicated harmonic array starting at index, and the starting timestamp of that data
Volume ExternalShows the volume of a specified exchange and pair. They should be entered in the format EXCHANGE:PAIR, e.g. BINANCE:ETHUSDT.
You can add multiple indicators of this to do volume analysis of multiple pairs on the same chart.