Breakeven Line DemoPlug the breakeven line code into the bottom of your strategy to get visualization of your breakeven price. Line is green when net position is long, red when net short and invisible when strategy is risk neutral. Most useful for strategies which use pyramiding (successive entries in same direction stacked upon each other) as it can be difficult to track where prices needs to return to to allow closing in profit. Disclaimer: the strategy logic is garbage do not use it. It is only there so you can see how Breakeven Line logic is implemented.
Portföy Yönetimi
Portfolio_Tracking_TRThis is a portfolio tracker that will track individual, overall and daily profit/loss for up. You can set the size of your buys and price of your buys for accurate, up to date profit and loss data right on your chart. It works on all markets and timeframes.
Next we get into setting up your , order size and price. Each ticker lets you set which stock you bought, then set how much you purchased and then what price you purchased them at.
FEATURES
Top Section
The portfolio tracker has 2 sections. The top section shows each ticker in your portfolio individually with the following data:
- Ticker Name
- Weight of that asset compared to your total portfolio in %
- Current value of that position in TL
- Profit or loss value from purchase price in %
- Todays change in value from yesterday’s close in %
Bottom Section
The bottom section of the tracker will give you info for your portfolio as a whole. It has the following data:
- Total cost of your entire portfolio in TL
- Current value of your entire portfolio in TL
- Current profit or loss of your entire portfolio in TL
- Current profit or loss of your entire portfolio in %
- Todays change of your entire portfolio value compared to yesterday’s close in %
This indicator was compiled from FriendOfTheTrend's indicator named Portfolio Tracker For Stocks & Crypto.
LuxAlgo - Backtester (S&O)The S&O Backtester is an innovative strategy script that encompasses features + optimization methods from our Signals & Overlays™ toolkit and combines them into one easy-to-use script for backtesting the most detailed trading strategies possible.
Our Signals & Overlays™ toolkit is notorious for its signal optimization methods such as the 'Optimal Sensitivity' displayed in its dashboard which provides optimization backtesting of the Sensitivity parameter for the Confirmation & Contrarian Signals.
This strategy script allows even more detailed & precise backtests than anything available previously in the Signals & Overlays™ toolkit; including External Source inputs allowing users to use any indicator including our other paid toolkits for take profit & stop loss customization to develop strategies, along with 10+ pre-built filters directly Signals & Overlays™' features.
🔶 Features
Full Sensitivity optimization within the dashboard to find the Best Win rates or Best Profits.
Counter Trade Mode to reverse signals in undesirable market conditions (may introduce higher drawdowns)
Built-in filters for Confirmation Signals w/ Indicator Overlays from Signals & Overlays™.
Built-in Confirmation exit points are available within the settings & on by default.
External Source Input to filter signals or set custom Take Profits & Stop Losses.
Optimization Matrix dashboard option showing all possible permutations of Sensitivity.
Option to Maximize for Winrate or Best Profit.
🔶 Settings
Sensitivity signal optimizations for the Confirmation Signals algorithm
Buy & Sell conditions filters with Indicator Overlays & External Source
Take Profit exit signals option
External Source for Take Profit & Stop Loss
Sensitivity ranges
Backtest window default at 2,000 bars
External source
Dashboard locations
🔶 Usage
Backtests are not necessarily indicative of future results, although a trader may want to use a strategy script to have a deeper understanding of how their strategy responds to varying market conditions, or to use as a tool for identifying possible flaws in a strategy that could potentially be indicative of good or bad performance in the future.
A strategy script can also be useful in terms of it's ability to generate more complete & configurable alerts, giving users the option to integrate with external processes.
In the chart below we are using default settings and built-in optimization parameters to generate the highest win rate.
Results like the above will vary & finding a strategy with a high win rate does not necessarily mean it will persist into the future, however, some indications of a well-optimized strategy are:
A high number of closed trades (100+) with a consistently green equity curve
An equity curve that outperforms buy & hold
A low % max drawdown compared to the Net Profit %.
Profit factor around 1.5 or above
In the chart below we are using the Trend Catcher feature from Signals & Overlays™ as a filter for standard Confirmation Signals + exits on a higher timeframe.
By filtering bullish signals only when the Trend Catcher is bullish, as well as bearish signals for when the Trend Catcher is bearish, we have a highly profitable strategy created directly from our flagship features.
While the Signals & Overlays features being used as built-in filters can generate interesting backtests, the provided External Sources can allow for even more creativity when creating strategies. This feature allows you to use many indicators from TradingView as filters or to trigger take-profit/stop-loss events, even if they aren't from LuxAlgo.
The chart below shows the HyperWave Oscillator from our Oscillator Matrix™ being used for take-profit exit conditions, exiting a long position on a profit when crossing 80, and exiting a short position when crossing 20.
🔶 Counter Trade Mode
Our thesis has always firmly remained to use Confirmation Signals within Signals & Overlays™ as a supportive tool to find trends & use as extra confirmation within strategies.
We included the counter-trade mode as a logical way to use the Confirmation signals as direct entries for longs & shorts within more contrarian trading strategies. Many traders can relate to using a trend-following indicator and having the market not respect its conditions for entries.
This mode directly benefits a trader who is aware that market conditions are generally not-so-perfect trends all the time. Acknowledging this, allows the user to use this to their advantage by introducing countertrend following conditions as direct entries, which tend to perform very well in ranging markets.
The big downfall of using counter-trade mode is the potential for very large max-drawdowns during trending market conditions. We suggest for making a strategy to consider introducing stop-loss conditions that can efficiently minimize max-drawdowns during the process of backtesting your creations.
Sensitivity Optimization
Within the Signals & Overlays™ toolkit, we allow users to adjust the Confirmation Signals with a Sensitivity parameter.
We believe the Sensitivity paramter is the most realistic way to generate the most actionable Confirmation Signals that can navigate various market conditions, and the Confirmation Signals algorithm was designed specifically with this in mind.
This script takes this parameter and backtests it internally to generate the most profitable value to display on the dashboard located in the top right of the chart, as well as an optimization table if users enable it to visualize it's backtesting.
In the image below, we can see the optimization table showing permutations of settings within the user-selected Sensitivity range.
The suggested best setting is given at the current time for the backtesting window that's customizable within the indicator. Optimized settings for technical indicators are not indicative of future results and the best settings are highly likely / guaranteed to change over time.
Optimizing signal settings has become a popular activity amongst technical analysts, however, the real-time beneficial applications of optimizing settings are limited & best described as complicated (even with forward testing).
🔶 Strategy Properties (Important)
We strongly recommend all users to ensure they adjust the Properties within the script settings to be in line with their accounts & trading platforms of choice to ensure results from strategies built are realistic.
🔶 How to access
You can see the Author's Instructions below to learn how to get access on our website.
ILM India Sectors NSDL FII/FPI Investments FortnightlyThis indicator shows the FII/FPI fortnightly investments across various sectors for easy consumption.
This data is sourced from website
www.fpi.nsdl.co.in
This data gets published on a fortnightly basis.
This data is very difficult to interpret and not easy to consume.
This indicator makes this data very easy to consume and make good investment decisions by tagging along with Smart Money.
Since Trading View does not expose this data via QUANDL or any other means, the data is updated in the indicator itself.
Hence, indicator needs to be updated as soon as the new data is available on a fortnightly basis.
All the numbers are in INR Cr.
The date columns represent the investment value for that fortnight for the sector
AUC column represents the total Assets held by FPI in that sector
%age column represents the %age of Assets in the sector compared to Total FPI investment
Features Planned in future
- Drill down to Group-A stocks in the sector and show the performance of the stock (% Change, Volume, Delivery) fortnightly so specific stock can be identified
Send me a DM if you would like to see any additional features on this indicator
Turtle Money ManagementThe Turtle Trading approach* is a trend following system that uses volatility for position size. *(Richard Dennis & William Eckhardt )
Turtle traders use the N unit system for risk management, which has its own advantages. This indicator offers beginners a simple interface that uses the same logic. Using ATR (Average True Range) to measure volatility.
The indicator shows the suggested position size and stop-loss price. You need to activate position line to see how it behaved in the past. Information about the Turtle system shows that it works in a daily candle. Intraday candles can be misleading (for ATR) because of this indicator use daily ATR by default. I leave the choice to you.
Limits recommended by Turtle Traders
-
Single Trade % 2 Maximum risk
Single Market % 4 Maximum risk
Closely Correlated Markets % 6 Maximum risk
Loosely Correlated Markets % 10 Maximum risk
Single Direction – Long or Short % 12 Maximum risk
ATR / Volatility / Leverage [JoseMetal]============
ENGLISH
============
- Description:
This is a utility indicator, it prints a table with ATR for 3 custom timeframes, using the ATR of basis, it calculates volatility (%) and a recommended leverage depending on your risk settings.
I use this tool to determine the leverage for each asset and keep the same risk management for all of them.
- Visual:
It shows a table with ATR, volatility and leverage for 3 timeframes.
For each timeframe it also prints 2 periods, short and long, also customizable, so you can determine the range.
- Customization:
You can customize up to 3 different timeframes, ATR short and long length, as well as a multiplier.
There's a risk setting that you should tweak depending on your way to trade.
Everything else customizable (as usual in my scripts), colors, indicator settings etc.
- Usage and recommendations:
Default settings are my own, feel free to tweak them as you wish, i usually trade on 4H using 1-2% of my account balance per trade with low leverage, so you probably want to increase the risk setting, that's also extremely recommended if you trade forex and metals, because i trade crypto mainly.
Enjoy!
============
ESPAÑOL
============
- Descripción:
Este es un indicador de utilidad, muestra una tabla con ATR para 3 temporalidades personalizables, usando el ATR de base, calcula la volatilidad (%) y un apalancamiento recomendado dependiendo de tu configuración de riesgo.
Yo uso ésta herramienta para determinar el apalancamiento para cada activo y mantener la misma gestión de riesgo para todos ellos (no tiene sentido ir a 5x en BTC y 5x en ORO, por ejemplo... ésta utilidad resuelve ese problema).
- Visual:
Muestra una tabla con el ATR, la volatilidad y el apalancamiento para 3 temporalidades.
Para cada temporalidad también muestra 2 rangos de periodización, corto y largo, también personalizables, para que puedas determinar de un vistazo los rangos en los que se mueve.
- Personalización:
Puedes personalizar hasta 3 temporalidades diferentes, la longitud del ATR corto y largo, así como un multiplicador.
Hay un ajuste de riesgo que debes ajustar dependiendo de tu forma de operar.
Todo lo demás es personalizable (como es habitual en mis scripts), colores, configuración de los indicadores, etc.
- Uso y recomendaciones:
Los ajustes por defecto son los míos, siéntete libre de ajustarlos como desees, yo suelo operar en 4H utilizando el 1-2% del saldo de mi cuenta por operación con un bajo apalancamiento, por lo que probablemente quieras aumentar el ajuste de riesgo, eso también es muy recomendable si operas fórex y metales, porque yo tradeo cripto principalmente.
¡Que lo disfrutes!
Trend & atr day & calcHi!
Why for what and how in this script?
At the time of publication the script consists of three modules, it may increase in the future.
1. Bottom left corner : daytime ATR module
(idea and basis of the author's script - ???)
- The size of the daily ATR based on 14 bars;
- intraday ATR progress;
- colour indication of the progress status, for easier visual perception (green < 70%, yellow 70-90 and red over 90% of ATR)
By evaluating the progress of the daily ATR, it is possible to suggest and expedient to enter/exit/hold a trade.
2. Top right: trend module
The trend is calculated based on Bill Williams' alligator indicator
- trend status on specified timeframes for the current ticker;
- colour indication for visual perception (green - growing trend, yellow - alligator is sleeping, red - downtrend)
Do not forget that the alligator is based on moving averages with the resulting consequences.
Its purpose is to assess the state of the trend on other ticker TFs, without additional actions (switching to another screen or TF)
3. In the bottom left corner - risk and position calculator
(based on an idea of the risk calculator by @andrei.bunulu)
It helps to determine the advisability of entering the trade and also what size position to enter into the trade, within money management strategy chosen.
- The calculator works in two directions: long deal and short deal (short deal calculation is enabled by check-box in settings)
- two calculation methods:
a. based on the set stop loss % (default is 0.3%), in this mode the stop and takeout level is automatically calculated (default is 1 / 3).
b. by entering the desired price levels (entry, stop and take profit points)
To make this work correctly please do not forget to choose the type of calculation (% or price) in the settings, and the currency symbol (for visual representation in the results).
The calculator can take into account the set commissions and spreads.
When hovering over the module - tooltips are displayed.
Each module can be enabled / disabled in the settings.
The size and arrangement of the modules is made for joint use with the script - "Abnormal Bar".
/// а по-русски это так ///
Привет!
Зачем для чего и как в этом скрипте?
На момент публикации скрипт состоит из трех модулей, возможно в будущем увеличится.
1. В левом нижнем углу : модуль дневного ATR
(идея и основа скрипт автора - ???)
- размер дневной ATR на основании 14 баров;
- прогресс ATR внутри дня;
- цветовая индикация состояния прогресса, для более простого визуального восприятия (зеленый < 70%, желтый 70-90 и красный более 90% ATR)
Оценивая прогресс дневного ATR, можно предположить и целесообразности входа / выхода / удержания из сделки.
2. В правом верхнем углу: модуль тренда
Тренд рассчитывается на основе индикатора - аллигатор Билла Вильямса
- состояние тренда на указанных таймфреймах для текущего тикера;
- цветовая индикация для визуального восприятия (зеленый - растущий тренд, желтый - аллигатор спит, красный - нисходящий тренд)
Не забываем, что аллигатор построен на основе скользящих средних с вытекающими последствиями.
Назначение - оценить состояние тренда на других ТФ тикера, без дополнительных действий (переключения на другой экран или ТФ)
3. В нижнем левом углу - калькулятор рисков и позиции
(на основе идеи калькулятора аuthor: @andrei.bunulu)
Помогает определить целесообразность входа в сделку, а также каким размером позиции входить в сделку, в рамках выбранной стратегии мани менеджмента.
- калькулятор работает в два направления: длинная и короткая сделка (расчет по короткой включается в настройках чек-боксом)
- два варианта расчета:
а. на основании установленного % стоп лосса (по-умолчанию 0,3%), при этом режиме происходит автоматический расчет уровня стопа и тейка (по умолчанию 1 / 3).
b. путем ввода данных желаемых уровней цены (точки входа, стопа и тейк профита)
Для корректной работы не забываем в настройках выбирать тип расчета (% или цена), а также символ валюты (для визуального отображения в итогах).
Калькулятор может учитывать установленный размер комиссий и спреда.
При наведении на модуль - отображаются подсказки.
Каждый модуль можно включить / выключить в настройках.
Размер и расположение модулей сделано для совместного использования со скриптом - "Abnormal Bar"
NSE Sector PerformanceUse this indicator on daily timeframe
This indicator shows the performance of the top NSE Sectors for 4 time periods.
User has the flexibility to define the time periods (ex. Yearly Monthly Quarterly Weekly Daily
indicator shows the performance of the sector for those time periods along with 250d High/Low and distance from the High/Low
User input is provided to drill down into performance of the top stocks in those sectors.
Crypto and FX PSCA simple tool to calculate crypto position size and FX lot size.
How to use:
1. Use TradingView measurement tool or position tool to know how wide is your stop loss.
2. Set the equity and risk parameters.
2. For crypto, input the PERCENTAGE in stop loss;
For FX, input the PIPS.
3. Position size will be displayed in the panel.
Notes:
>Position size is in USDT for Cryptocurrencies
>Lot size for forex.
Forex contract size is your account type set by the broker:
Standard = 100,000 units = ~$10/pip
Mini = 10,000 units = ~$1/pip
Micro = 1,000 units = ~$0.10/pip
Nano = 100 units = ~$0. 01/pip
Credits:
trananhvu149
hanabil
Portfolio Tracker For Stocks & CryptoThis is a portfolio tracker that will track individual, overall and daily profit/loss for up to 12 assets. You can set the size of your buys and price of your buys for accurate, up to date profit and loss data right on your chart. It works on all markets and timeframes.
HOW TO USE
Go into the indicator settings and you will see all of the available settings. The first is the ability to turn the tracker info table on or off from the chart, so it saves your portfolio info but let’s you remove it from the chart while trading. Second is the option to move the position of the info table to suit your preference.
Next we get into setting up your portfolio tickers, order size and price. Each ticker lets you set which stock/crypto you bought, then set how much you purchased and then what price you purchased them at.
Go through and set up all of your assets and then turn off any tickers that you don’t need. Once that is all done, your portfolio will be shown on the chart with all the data.
FEATURES
Top Section
The portfolio tracker has 2 sections. The top section shows each ticker in your portfolio individually with the following data:
- Ticker Name
- Weight of that asset compared to your total portfolio in %
- Current value of that position in $
- Profit or loss value from purchase price in %
- Todays change in value from yesterday’s close in %
The $ Value, PnL % and Today % will all change colors from green to red depending if they are in profit or not.
Bottom Section
The bottom section of the tracker will give you info for your portfolio as a whole. It has the following data:
- Total cost of your entire portfolio in $
- Current value of your entire portfolio in $
- Current profit or loss of your entire portfolio in $
- Current profit or loss of your entire portfolio in %
- Todays change of your entire portfolio value compared to yesterday’s close in %
The $ Value, PnL $, PnL % and Today % will all change colors from green to red depending if they are in profit or not.
Top 40 constituents of S&P 500 IndexDisplays real-time candles of top 40 constituents of S&P 500 Index ( TVC:SPX ) for a given time frame, side-by-side. This gives an overall idea of breadth and depth of market movements in the time-frame.
Please note that, this is not a standard chart rendered bar-wise and may take time to load as it requests multiple securities. You could modify the contents, from settings, to include stocks from your portfolio or indices of different sectors.
AJ's Position Size Calculator for Forex and StocksThis position size/ stop loss and take profit calculator is designed to make entering positions more efficient. In the settings enter your account size and currency. Stop loss and profit levels can be calculated from the ATR or manually. To manually choose stop and profit price, choose manual from the SL or TP Value Type, then enter your price in the boxes below. Lot size or shares will be calculated and displayed on the table to the right of the chart. Position size calculation takes into account any currency exchange rates between your account currency and the quoted currency of the selected ticker. For forex lot sizes the exchange rate for the quoted currency relative to account currency is also built in to get an accurate position size. Enter your brokers leverage and your used margin will be displayed as well. The position size calculator is currently only configured for stocks and forex, I will try to add updates, in the future to other tickers like crypto , precious metals and crude oil CFD's. profit target and stop loss calculator should work for all symbols. I can't guarantee that the output of this calculator is correct. Use at your own risk!
Curved Stop Loss (Expo)█ Overview
Curved Stop Loss (Expo) automatically calculates the best stop-loss distance based on real-time momentum and volatility. Once the algorithm has analyzed the current market characteristics, a curved stop loss is placed on the chart. As a result, the trader can be confident that the stop loss is based on data insights. One of the key elements of a curved stop loss is that it ensures that the trade can either be stopped with a profit or only with a minor loss without compromising the profit potential. Hence, using the Curved Stop Loss makes a massive difference in the overall results.
█ Why is this tool needed?
Risk management is a key concept to grasp and use in your trading, and it's one of the most critical aspects that will determine your long-term success in this industry. The market is uncertain, and it's impossible to know what the future holds. The only way to take control of the unknown is to have a proper risk management system that ensures you don't blow your account in one trade. Therefore, all traders need to understand the importance of using a risk- and money-management tool that calculates and provides stop-loss and take-profit levels in real-time. This way, you will always know where to take your stop loss and secure profit.
█ How to use
This Curved Stop Loss helps traders set a stop loss based on current momentum and volatility. It can be used to minimize your risk and maximize your profit potential.
-----------------
Disclaimer
The information contained in my Scripts/Indicators/Ideas/Algos/Systems does not constitute financial advice or a solicitation to buy or sell any securities of any type. I will not accept liability for any loss or damage, including without limitation any loss of profit, which may arise directly or indirectly from the use of or reliance on such information.
All investments involve risk, and the past performance of a security, industry, sector, market, financial product, trading strategy, backtest, or individual's trading does not guarantee future results or returns. Investors are fully responsible for any investment decisions they make. Such decisions should be based solely on an evaluation of their financial circumstances, investment objectives, risk tolerance, and liquidity needs.
My Scripts/Indicators/Ideas/Algos/Systems are only for educational purposes!
Fed Net Liquidity Indicator (24-Oct-2022 update)This indicator is an implementation of the USD Liquidity Index originally proposed by Arthur Hayes based on the initial implementation of jlb05013, kudos to him!
I have incorporated subsequent additions (Standing Repo Facility and Central Bank Liquidity Swaps lines) and dealt with some recent changes in reporting units from TradingView.
This is a macro indicator that aims at tracking how much USD liquidity is available to chase financial assets:
- When the FED is expanding liquidity, financial asset prices tend to increase
- When the FED is contracting liquidity, financial asset prices tend to decrease
Here is the current calculation:
Net Liquidity =
(+) The Fed’s Balance Sheet (FRED:WALCL)
(-) NY Fed Total Amount of Accepted Reverse Repo Bids (FRED:RRPONTTLD)
(-) US Treasury General Account Balance Held at NY Fed (FRED:WTREGEN)
(+) NY Fed - Standing Repo Facility (FRED:RPONTSYD)
(+) NY Fed - Central Bank Liquidity Swaps (FRED:SWPT)
Adulari ATSAdulari's Automated Trading Strategy combines more then 10+ innovative indicators and is carefully designed to provide honest and accurate backtesting results. We created and optimized this strategy to provide realistic results, not insane backtesting results that are very inconsistent and unrealistic. It is made for swing trading on the 15m timeframe. It is recommended to use the BYBIT:BTCUSDT pair.
This strategy has been thoroughly backtested throughout 2 years in order to provide optimal results.
ATS was designed to provide live results close to those of backtesting. It has been ensured this strategy is not overfitted.
Our strategy works in any market & allows users to:
Automate their trades using our alert system and integrations.
View realistic backtesting results.
Filter trades in irregular price action using our trend filters.
And many new features that can be found in the changelog below.
Our strategy detect the direction of trends for any asset & on any timeframe allowing traders to increase their confidence in positions and follow trends.
This strategy is built to be very profitable when used for long time periods. Compounding will make profits very solid.
We give our users the possibility to adjust the settings of the strategy to market price variations, as well as the option to make them less sensitive to irregular price movements so that it only trades predictable price action.
Save time by automating everything!
The strategy's settings play an important role towards profitable trades, however, the constant adjustment of these is not necessary since no overfitting is in play.
We made our strategy as flexible as possible in order to allow it to adjust to internal market dynamics, thus completely removing the need for traders to adjust any settings. We offer multiple setting profiles that are optimized for a certain market, with lower or higher risk.
If you are using this script you acknowledge past performance is not necessarily indicative of future results and there are many more factors that go into a profitable trade.
Original Strategy - Backtest & Alerts [AlgoRider]█ OVERVIEW
This indicator simulates an efficient trading strategy developed by our team in a simple and effective way, the primary objective when designing it was to make its reading and use as simple as possible for TradingView users. The Backtesting feature has been designed to keep only the most essential information to obtain clear and precise results directly on the graph. The settings interface has also been designed for ergonomic and simplified use. The user is free to customize the parameters as he wishes and according to his trading profile by having the choice, for example, of using options to reduce the risk of loss, to increase the win rate, to optimize profits. Automation is made possible and facilitated thanks to preconfigured alert conditions.
█ CONCEPTS
How the strategy works :
When the price is close to its equilibrium (represented by an exponential moving average - EMA) and it starts to take an upward or downward direction the script will issue Long or Short entry orders. If the price turns and goes to the opposite direction, the script quickly cuts the position by issuing a Stop Loss order. When the price takes a real clear direction, this is where the script will be able to accumulate profits.
What makes this script unique is :
• That it is entirely developed by us, inspired by a strategy that is little known and little used in the trading world, in particular because it often involves a greater number of losing trades than winning trades.
• Its ease of reading and use. The backtesting feature was designed to clearly display the most important information in a data table directly on the chart. The user is not lost with dozens of superfluous data and can directly access the most essential information to see how the strategy has performed in the past.
• Its ease of configuration and customization. Once in the configuration window, again the user is not lost, because there is only one main parameter to modify, it is the length of the EMA, which will influence the timing of entries and exits trades. Then there are a few other non-mandatory parameters to fine-tune risk management and maximize profits. (Detailed description of the settings further down the page)
• Strategy automation made easy and fast thanks to several types of alerts which are differentiated for entries, for auto-exits and for Custom TP and SL. These alerts can be configured to send the messages by email or via Webhooks.
• The indicator has several custom options allowing its user to go further than the basic strategy. Several confirmations for entries are available as well as the possibility of adding or not a personalized TP and/or SL.
• There is no repaint, once an entry/exit symbol or drawing is displayed it doesn't change anymore. The Short, Long and auto-Exit signals appear only at the open of the candles, just after the signal was confirmed at the close of the previous candle. The custom TP and custom SL signals can appear when a candle is not yet finished, but once displayed they don't change.
█ HOW TO PROCEED
1 — Once the script is applied to your chart, it already works with its default settings. You can already see the performance of the strategy in the data table directly on the chart (in the top right corner by default).
2 — You can customize the strategy and influence the results/performance by modifying its parameters. 3 types of parameters are present and can be modified.
3 — This strategy is designed for the cryptocurrency market in priority, but you can also try it on other types of assets. It works on Futures but you can also try it on Spot market mainly for LONG trades.
4 — You can apply the script in every timeframe. We do not recommend using it below m30 because in most cases the statistics are unfavorable largely because of the fees. (This is not a financial advice but only for the use of the indicator)
█ FEATURES
Screenshot on BYBIT:EGLDUSDT Bybit Futures, H1, with default parameters, from 2022-01-01 to 2022-09-27, to show the settings window
• Settings For Backtesting
- Strategy : Choose from a drop-down list if the strategy should execute only Long trades or only Short trades or both. Default Both.
- Invest. : Choose the amount you want to invest in the simulation. Default 10000.
- Position : Choose the amount of the position (Size order) that will be used during the simulation. This will be the $ amount staked/involved for each trade entry.
Ex: If you put 20000 in position and 10000 in Invest. We consider that you use at least a leverage x2. Default 10000.
- Slipp. TP : Choose the amount in percentage of average slippage for Take Profits. This parameter makes it possible to predict a potential gap between the theoretical exit price for each TP (On the graph) and the real exit price on an exchange when implementing the strategy for real (slippage may be due to a time lag of a few seconds from execution time of the order on the exchange and/or due to the execution of a market order).
Ex: If a TP exit order of a Long trade, with entry $19000 (on BTCUSDT), is carried out in theory on the chart at $20000, in practice on the exchange the script have indeed sent an exit order at 20000 , but if the true exit price is 20050, the TP slippage is then +0.25%. Default 0.
- Slipp. SL : Choose the amount in percentage of average slippage for Stop Losses. This parameter makes it possible to predict a potential gap between the theoretical exit price for each SL (On the graph) and the real exit price on an exchange when implementing the strategy for real.
Ex: If an SL exit order of a Long trade, entry $19000 (on BTCUSDT), is carried out in theory on the chart at $18000, in practice on the exchange the script have indeed sent an exit order at 18000 $, but if the true exit price is 17950, the slippage SL is then +0.278% . Default 0.
- Fees % : Choose the percentage amount of fees applied to each trade to simulate the application of the strategy on the exchange of your choice. Applies to the entry and exit of each trade. Ex: For Binance Futures: 0.04; For Bybit futures: 0.06; For Ftx Futures: 0.075. Default 0.
- Cumulate Trades : If you check this, the Backtest will use 100% of the balance as Order Size (Position) for All or in the next X consecutive trades. Default not checked.
⚠️ Be Careful please, this option is available to show the full extent and possibilities of the algorithm when pushed to its limits thanks to the accumulation of profits (cumulative earnings), but it is a strategy that involves great risk. If a bad trade suffers a -50% loss, 50% of the account balance is lost, if the position is liquidated, the entire account balance is lost.
- All : If you check this All trades will be accumulated. Default not checked.
- Consecutive Trades : Choose the number of trades to accumulate. After X consecutive trades, the algorithm reassigns the initial order size to the current one and starts again for X consecutive trades. Minimum Value 2, Default 2.
• Settings To Optimize Performances and Risk Management
- (Main Parameter) EMA Length : Choose the length of the EMA. This value will determine the exponential moving average plot (blue line) that represents the equilibrium in this strategy. Depending on the positioning of the price around this equilibrium, the algorithm will decide to trigger Long or Short entry alerts, and exit alerts. Default 200.
- 1 - Confirm (After X Bar(s)) : If you check this, when the algorithm will detect an entry, it will wait for the number of bars you have entered to actually trigger the entry alert. Default not checked.
- Nb Bar : Enter here the number of bar you want, will be taken into account only if you check (1) Confirm (After X Bar(s)). Default 2.
- 2 - Confirm (Trend) : If you check this, when the algorithm will detect an entry, it will check that the trend is similar to the direction of the trade, if not, it will wait that the trade goes in the same direction as the trend to actually trigger the entry alert. Default not checked.
- OR/AND : This choice is taken into account only if you tick both confirmations. If you choose OR: The first of the 2 confirmations to be validated will trigger the entry alert. If you choose AND : once confirmation (1) is validated, the algorithm waits for confirmation (2) to be validated to actually trigger the entry alert. Default OR.
- Use TP / Use SL : If you check these, the algorithm will trigger personalized trade exit alerts when the price evolution has reached the amounts indicated since the trade entry. Default not Checked.
- % TP - SL : Indicate here the personalized amount in percentage that you want for your Take Profit and Stop Loss of each trade. Default 15-5.
• Settings For Appearances
- Small-size Data Table : If you check this, the data table will become smaller to free up more space on the chart to make it visually more pleasing. Default not checked.
Hide Table /
- Hide Labels / : You can check these to get a cleaner chart and focus only on what interests you in the indicator. Default not checked.
Hide Risk-Reward Areas
█ MAIN PARAMETERS TO USE
• In the default settings none of the box settings are checked. Basic strategy is made to be applied this way.
• The main parameter (the length of the EMA) is by default 200 because it is a known value that many traders rely on in many trading strategies. Moreover in this strategy it works in many cases and on different timeframes.
• To go further the user of the indicator is free to modify the parameters of the category "Leading Parameters - Risk Management" to reduce risks and to optimize profits.
• You can find below our recommendations for the EMA length value corresponding to the main timeframes.
m30 — EMA Length = 400 | 800
H1 — EMA Length = 200 | 400
H2 — EMA Length = 200 | 250
H4 — EMA Length = 100 | 200
D — EMA Length = 20 | 40
⚠️ We have chosen to recommend these settings because they will work in most cases, on most cryptoassets, but of course they will not work 100% of the time on all assets and will not always give positive results in the backtest, and they are not the most optimized parameters either. The user of the indicator is free to optimize the asset on which he wants to trade in his own way. Just as we do not give financial advice, we do not encourage to trade any asset in particular.
█ STATISTICS
The statistics presented below are an example of the results that the strategy can provide. (Reminder: These statistics are made over a past period and there is no guarantee that the same performance will reproduce in the future) .
For the demonstration we chose to apply the strategy on the Top 5 marketcap cryptos in September 2022. They are not the most favorable coins for this strategy but at least this way we don't take the most suitable assets to show wonderful and biased results. Likewise for the parameters used which are the default ones and which are not the most optimized parameters, much better results are possible. We chose Binance because it has the highest volumes and liquidity and the most historical data. We chose H1 because it is one of the most used timeframes.
BTC
Screenshot on BINANCE:BTCUSDTPERP Binance Futures, H1, with default parameters (EMA : 400), from 2022-01-01 to 2022-09-27
ETH
Screenshot on BINANCE:ETHUSDTPERP Binance Futures, H1, with default parameters (EMA : 400), from 2022-01-01 to 2022-09-27
BNB
Screenshot on BINANCE:BNBUSDTPERP Binance Futures, H1, with default parameters (EMA : 400), from 2022-01-01 to 2022-09-27
XRP
Screenshot on BINANCE:XRPUSDTPERP Binance Futures, H1, with default parameters (EMA : 200), from 2022-01-01 to 2022-09-27
ADA
Screenshot on BINANCE:ADAUSDTPERP Binance Futures, H1, with default parameters (EMA : 400), from 2022-01-01 to 2022-09-27
To show the potential of the indicator and push it to its limits, here is an example of the strategy applied for about 2 years (Up to the maximum of historical data available).
⚠️ It must be taken into account that during the period of this backtest the last Bullrun took place and it was a very favorable period for the strategy and for this altcoin (FTM), nothing ensures that it will happen again. ⚠️
FTM
Screenshot on BINANCE:FTMUSDTPERP Binance Futures, H4, with default parameters ( without cumulative earnings) and EMA : 400, start on 2020/12/03 to 2022/09/27
✅ All of the above statistics are verifiable by anyone using the indicator's backtesting system.
█ LIMITATIONS
• Despite the fact that we can see good performances when we backtest the strategy, we must take into account the fact that these are results performed in the past and that in no case does this guarantee that these same performances will be repeated again in the future.
• The automation of this strategy is made possible and is facilitated by alerts, but you must be aware of the fact that if you decide to put this strategy into practice in real life, you are solely responsible for the results that you will be able to obtain and you must be aware of the possibility at all times of partial or even total losses of your invested capital.
• Keep in mind that generating profits in trading is difficult. A strategy can perform very well at one time in the past during a period that is favorable to it, then from one day to the next it can give really bad results for several months or years.
• When backtesting a strategy, there are many factors to consider, not just trade entries to which you add a Take Profit and sometimes a Stop Loss. You must at least take into account the size of the position in relation to the capital you want to invest, the trading fees, the slippages (which can be really important depending on the exchange on which you are trading and depending on the asset you are trading), trading frequency, risk management, momentum, volumes and even more.
• This indicator has been optimized for crypto, you can try to use it on other type of assets but again, at your own risk.
The information published here on TradingView is not prohibited, doesn't constitute investment advice, and isn't created solely for qualified investors.
═════════════════════════════════════════════════════════════════════════
Important to note : our indicators with the same backtesting system are published in separate publications, because putting them together in a single script would considerably slow down the execution of the script. In addition each indicator, even when it is based on a simple technical indicator, has several options, parameters and entry/exit conditions specific to the underlying technical indicator. Finally, we want to keep the simplicity of use, configuration and understanding of our indicator by not mixing strategies that have nothing to do with each other.
MACD Strategy - Backtest [AlgoRider]█ OVERVIEW
Hello dear Tradingviewers !
We are excited to share with you this new indicator which simulates a trading strategy based solely on the well-known technical indicator MACD . We designed it for the sole educational and analytical purposes of showing novice traders and new investors that basing a trading strategy only on one such technical indicator is not necessarily a good thing to do. We do not recommend to apply this strategy for real.
Thanks to this indicator redesigned in our own way by incorporating our simple and easy-to-use Backtest functionality, you will be able to see and report on the performance and results that such a strategy has produced in the past.
The configuration window has also been designed to be easily readable and simple to use. Our goal is to make parameter customization as easy as possible.
█ HOW THE STRATEGY WORKS
• The script will simply trigger Long entries when bullish MACD crossings appear (the Macd line crosses the Signal line upwards) and Short entries when bearish MACD crossings appear (the Macd line crosses below the signal line).
• A Short signal ends a Long trade, a Long signal ends a Short trade.
• The script also allows setting up custom TP and SL.
• An option allows you to trigger early crossings, which will influence entries and exits.
• There is no repaint, once an entry/exit symbol or drawing is displayed it doesn't change anymore. The Short and Long signals appear at the open of the candles, just after the signal was confirmed at the close of the previous candle. The custom TP and custom SL signals can appear when a candle is not yet finished, but once displayed they don't change.
█ HOW TO PROCEED
1 — Once the script is applied to your chart, it already works with its default settings. You can already see the performance of the strategy in the data table directly on the chart (in the top right corner by default).
2 — You can customize the strategy and influence the results/performance by modifying its parameters. 3 types of parameters are present and can be modified.
3 — You can use this indicator in all types of markets.
4 — You can apply the script in every timeframe.
█ PARAMETERS
• Settings For Backtesting
- Strategy : Choose from a drop-down list if the strategy should execute only Long trades or only Short trades or both. Default Both.
- Invest. : Choose the amount you want to invest in the simulation. Default 10000.
- Position : Choose the amount of the position (Size order) that will be used during the simulation. This will be the $ amount staked/involved for each trade entry.
Ex: If you put 20000 in position and 10000 in Invest. We consider that you use at least a leverage x2. Default 10000.
- Slipp. TP : Choose the amount in percentage of average slippage for Take Profits. This parameter makes it possible to predict a potential gap between the theoretical exit price for each TP (On the graph) and the real exit price on an exchange when implementing the strategy for real (slippage may be due to a time lag of a few seconds from execution time of the order on the exchange and/or due to the execution of a market order).
Ex: If a TP exit order of a Long trade, with entry $19000 (on BTCUSDT ), is carried out in theory on the chart at $20000, in practice on the exchange the script have indeed sent an exit order at 20000 , but if the true exit price is 20050, the TP slippage is then +0.25%. Default 0.
- Slipp. SL : Choose the amount in percentage of average slippage for Stop Losses. This parameter makes it possible to predict a potential gap between the theoretical exit price for each SL (On the graph) and the real exit price on an exchange when implementing the strategy for real.
Ex: If an SL exit order of a Long trade, entry $19000 (on BTCUSDT ), is carried out in theory on the chart at $18000, in practice on the exchange the script have indeed sent an exit order at 18000 $, but if the true exit price is 17950, the slippage SL is then +0.278%. Default 0.
- Fees % : Choose the percentage amount of fees applied to each trade to simulate the application of the strategy on the exchange of your choice. Applies to the entry and exit of each trade. Ex: For Binance Futures: 0.04; For Bybit futures: 0.06; For Ftx Futures: 0.075. Default 0.
- Cumulate Trades : If you check this, the Backtest will use 100% of the balance as Order Size (Position) for All or in the next X consecutive trades. Default not checked.
⚠️ Be Careful please, this option is available to show the full extent and possibilities of the algorithm when pushed to its limits thanks to the accumulation of profits (cumulative earnings ), but it is a strategy that involves great risk. If a bad trade suffers a -50% loss, 50% of the account balance is lost, if the position is liquidated, the entire account balance is lost.
- All : If you check this All trades will be accumulated. Default not checked.
- Consecutive Trades : Choose the number of trades to accumulate. After X consecutive trades, the algorithm reassigns the initial order size to the current one and starts again for X consecutive trades. Minimum Value 2, Default 2.
• Settings To Optimize Performances and Risk Management
- Fast_MA : Choose the length of the Fast Moving Average. Default 12.
- Slow_MA : Choose the length of the Slow Moving Average. Default 26.
- Enable Early Crossings : If you check this, when the algorithm will detect an early crossing wethere bullish or bearish , it will trigger the Long or Short entries. Default not checked.
- Oscillator MA Type : Choose if the Macd line should be an Exponential Moving Average or a Simple Moving Average . Default Expo.
- Signal Line MA Type : Choose if the Signal line should be an Exponential Moving Average or a Simple Moving Average . Default Expo.
- Use TP / Use SL : If you check these, the algorithm will trigger personalized trade exit signals when the price evolution has reached the amounts indicated since the trade entry. Default not Checked.
- % TP - SL : Indicate here the personalized amount in percentage that you want for your Take Profit and Stop Loss of each trade. Default 15-5.
• Settings For Appearances
- Small-size Data Table : If you check this, the data table will become smaller to free up more space on the chart to make it visually more pleasing. Default not checked.
Hide Table /
- Hide Labels / : You can check these to get a cleaner chart and focus only on what interests you in the indicator. Default not checked.
Hide Risk-Reward Areas
█ LIMITATIONS
• ⚠️ We repeat it once again, this strategy is not intended to be reproduced in real conditions, we have designed it for educational and analytical purposes only.
• Even if you see good performances when you backtest the strategy, you must take into account that these results are performed in the past and that in no case does this guarantee that these same performances will be repeated again in the future.
• When you run for real a trading strategy you must be aware of the fact that you are solely responsible for the results that you will be able to obtain and you must be aware of the possibility at all times of partial or even total losses of your invested capital.
• Keep in mind that generating profits in trading is difficult. A strategy can perform very well at one time in the past during a period that is favorable to it, then from one day to the next it can give really bad results for several months or years.
• When backtesting a trading strategy, there are many factors to consider, not just trade entries to which you add a Take Profit and sometimes a Stop Loss. You must at least take into account the size of the position in relation to the capital you want to invest, the trading fees, the slippages (which can be really important depending on the exchange on which you are trading and depending on the asset you are trading), trading frequency, risk management, momentum, volumes and even more.
The information published here on TradingView is not prohibited, doesn't constitute investment advice, and isn't created solely for qualified investors.
═════════════════════════════════════════════════════════════════════════
Important to note : our indicators with the same backtesting system are published in separate publications, because putting them together in a single script would considerably slow down the execution of the script. In addition each indicator, even when it is based on a simple technical indicator, has several options, parameters and entry/exit conditions specific to the underlying technical indicator. Finally, we want to keep the simplicity of use, configuration and understanding of our indicator by not mixing strategies that have nothing to do with each other.
RSI Strategy - Backtest [AlgoRider]█ OVERVIEW
Hello dear Tradingviewers !
We share with you this new indicator which simulates a trading strategy based solely on the well-known technical indicator RSI . We designed it for the sole educational and analytical purposes of showing novice traders and new investors that basing a trading strategy only on one such technical indicator is not necessarily a good thing to do. We do not recommend to apply this strategy for real.
Thanks to this indicator redesigned in our own way by incorporating our simple and easy-to-use Backtest functionality, you will be able to see and report on the performance and results that such a strategy has produced in the past.
The configuration window has also been designed to be easily readable and simple to use. Our goal is to make parameter customization as easy as possible.
█ HOW THE STRATEGY WORKS
• The script will trigger Long entries when the price crosses upwards the Oversold zone (Default 38.2) and Short entries when the price crosses downward the Overbought zone (Default 61.8).
• A Short signal ends a Long trade, a Long signal ends a Short trade.
• The script also allows setting up custom TP and SL.
• Several options allow you to reverse entry and exit conditions of trades. You can choose to reverse entries or/and exits (Ex: when the script detects a Long Entry, it will actually trigger a Short trade).
• You can also change the entry conditions of the strategy. Instead of entering oversold/overbought zone conditions, it will trigger entries when the Rsi changes direction and reverses (Ex: when the rsi has been going down for 5 candles, and the rsi starts going up) , regardless of the area in which the RSI is located.
• There is no repaint, once an entry/exit symbol or drawing is displayed it doesn't change anymore. The Short and Long signals appear at the open of the candles, just after the signal was confirmed at the close of the previous candle. The custom TP and custom SL signals can appear when a candle is not yet finished, but once displayed they don't change.
█ HOW TO PROCEED
1 — Once the script is applied to your chart, it already works with its default settings. You can already see the performance of the strategy in the data table directly on the chart (in the top right corner by default).
2 — You can customize the strategy and influence the results/performance by modifying its parameters. 4 types of parameters are present and can be modified.
3 — You can use this indicator in all types of markets.
4 — You can apply the script in every timeframe.
█ PARAMETERS
• Settings For Backtesting
- Strategy : Choose from a drop-down list if the strategy should execute only Long trades or only Short trades or both. Default Both.
- Invest. : Choose the amount you want to invest in the simulation. Default 10000.
- Position : Choose the amount of the position (Size order) that will be used during the simulation. This will be the $ amount staked/involved for each trade entry.
Ex: If you put 20000 in position and 10000 in Invest. We consider that you use at least a leverage x2. Default 10000.
- Slipp. TP : Choose the amount in percentage of average slippage for Take Profits. This parameter makes it possible to predict a potential gap between the theoretical exit price for each TP (On the graph) and the real exit price on an exchange when implementing the strategy for real (slippage may be due to a time lag of a few seconds from execution time of the order on the exchange and/or due to the execution of a market order).
Ex: If a TP exit order of a Long trade, with entry $19000 (on BTCUSDT ), is carried out in theory on the chart at $20000, in practice on the exchange the script have indeed sent an exit order at 20000 , but if the true exit price is 20050, the TP slippage is then +0.25%. Default 0.
- Slipp. SL : Choose the amount in percentage of average slippage for Stop Losses. This parameter makes it possible to predict a potential gap between the theoretical exit price for each SL (On the graph) and the real exit price on an exchange when implementing the strategy for real.
Ex: If an SL exit order of a Long trade, entry $19000 (on BTCUSDT ), is carried out in theory on the chart at $18000, in practice on the exchange the script have indeed sent an exit order at 18000 $, but if the true exit price is 17950, the slippage SL is then +0.278%. Default 0.
- Fees % : Choose the percentage amount of fees applied to each trade to simulate the application of the strategy on the exchange of your choice. Applies to the entry and exit of each trade. Ex: For Binance Futures: 0.04; For Bybit futures: 0.06; For Ftx Futures: 0.075. Default 0.
- Cumulate Trades : If you check this, the Backtest will use 100% of the balance as Order Size (Position) for All or in the next X consecutive trades. Default not checked.
⚠️ Be Careful please, this option is available to show the full extent and possibilities of the algorithm when pushed to its limits thanks to the accumulation of profits (cumulative earnings ), but it is a strategy that involves great risk. If a bad trade suffers a -50% loss, 50% of the account balance is lost, if the position is liquidated, the entire account balance is lost.
- All : If you check this All trades will be accumulated. Default not checked.
- Consecutive Trades : Choose the number of trades to accumulate. After X consecutive trades, the algorithm reassigns the initial order size to the current one and starts again for X consecutive trades. Minimum Value 2, Default 2.
• Change Entry & Exit conditions
- Rsi Turns Up/Down : Enable this option to change conditions for trade entries. For Long entries : It will start a Long trade when RSI turns up and the RSI was falling on the last X bar(s). For Short entries : It will start a Short trade when RSI turns down and the RSI was rising on the last X bar(s). Default not checked.
- After Falling/Rising Bars(s) : Choose the number of bars/candles since which the price was falling/rising. Default 5.
- Reverse Entries : Enable this option to reverse conditions for trade entries. When a Short signal appears, it will actually start a Long trade. When a Long signal appears, it will actually start a Short trade. Default not checked.
- Reverse Exits : Enable this option to reverse conditions for trade exits. Default not checked.
- Safety Stop Loss : Enable this option to quickly cut the trade when the price turns quickly. For a Long trade : if the price returns to the oversold zone, it ends the trade. For a Short trade : if the price returns to the overbought zone, it ends the trade. Mainly useful for basic strategy (overbought/oversold conditions). Default not checked.
• Settings To Optimize Performances and Risk Management
- Len RSI : The length of RSI . Default 14.
- Overbuy : You can change the limit value of the overbought zone of the RSI . Default 61.8.
- Oversell : You can change the limit value of the oversell zone of the RSI . Default 38.2.
- Use TP / Use SL : If you check these, the algorithm will trigger personalized trade exit signals when the price evolution has reached the amounts indicated since the trade entry. Default not Checked.
- % TP - SL : Indicate here the personalized amount in percentage that you want for your Take Profit and Stop Loss of each trade. Default 15-5.
• Settings For Appearances
- Small-size Data Table : If you check this, the data table will become smaller to free up more space on the chart to make it visually more pleasing. Default not checked.
Hide Table /
- Hide Labels / : You can check these to get a cleaner chart and focus only on what interests you in the indicator. Default not checked.
Hide Risk-Reward Areas
█ LIMITATIONS
• ⚠️ We repeat it once again, this strategy is not intended to be reproduced in real conditions, we have designed it for educational and analytical purposes only.
• Even if you see good performances when you backtest the strategy, you must take into account that these results are performed in the past and that in no case does this guarantee that these same performances will be repeated again in the future.
• When you run for real a trading strategy you must be aware of the fact that you are solely responsible for the results that you will be able to obtain and you must be aware of the possibility at all times of partial or even total losses of your invested capital.
• Keep in mind that generating profits in trading is difficult. A strategy can perform very well at one time in the past during a period that is favorable to it, then from one day to the next it can give really bad results for several months or years.
• When backtesting a trading strategy, there are many factors to consider, not just trade entries to which you add a Take Profit and sometimes a Stop Loss. You must at least take into account the size of the position in relation to the capital you want to invest, the trading fees, the slippages (which can be really important depending on the exchange on which you are trading and depending on the asset you are trading), trading frequency, risk management, momentum, volumes and even more.
The information published here on TradingView is not prohibited, doesn't constitute investment advice, and isn't created solely for qualified investors.
═════════════════════════════════════════════════════════════════════════
Important to note : our indicators with the same backtesting system are published in separate publications, because putting them together in a single script would considerably slow down the execution of the script. In addition each indicator, even when it is based on a simple technical indicator, has several options, parameters and entry/exit conditions specific to the underlying technical indicator. Finally, we want to keep the simplicity of use, configuration and understanding of our indicator by not mixing strategies that have nothing to do with each other.
Position size in dollar cost average strategySTATIC DCA
Using the tradingview.com, an algorithm was generated that simulates the behavior of the DCA methodology. This algorithm simulates the purchase of 1000 USD on the 15th of each month, regardless of the bitcoin price. It is considered a static DCA, since the amount to be invested remains always fixed.
The inputs to the function are, the day number of the month in which the purchase is to be made, the start date of the simulation and the capital to be invested month by month. What the function does is to receive the value of the investment, and if the day entered in the function coincides with the current day, it will divide the invested capital by the price of the asset, obtaining a position size that accumulates in each purchase. With this data we can obtain the total invested capital, the net profit, as well as the average buying price.
DYNAMIC DCA
The dynamic DCA, bases its operation on the use of moving averages and standard deviations, in order to find the zones where the price has a lower value than the deviation under the mean. This condition can be considered as an accumulation zone.
The data were obtained in a one-week time window, using the security request method. Since purchases are made one every month, the daily time window generates many false signals, while the one-month time window generates few signals. The analysis is performed on data from 52 weeks equivalent to one year.
Subsequently we created an algorithm based on the ATR, for the selection of the position size, the fundamental characteristic of this development is that the algorithm will not invest the total of the capital destined to month to month. The amount of money to be invested will vary between 0 and 100%, in discrete values defined by the mean and standard deviation in the ATR calculation. Uninvested money will accumulate until the asset price enters the accumulation zone, where this capital will be released and used to accumulate as much of the asset as possible.
The function developed for the dynamic DCA receives the same inputs as the previous function, plus an extra condition and the variable resulting from the calculation of the position size.
---
ANALYSIS
In the analysis, we will consider ratios, such as cumulative position size, percentage net profit, invested amount and average buying price. The simulation of the results starts on 12/18/2017. For the analysis in all charts, the red line will represent the static DCA ratios, while the blue line will represent the dynamic DCA ratios.
Amount invested
At the end of this backtesting, the quantity invested is the same for each of the cases, however, the way the money enters the market is different. Money enters steadily and in the same amount in the static DCA, while in the dynamic DCA, there are months in which no purchases are made, or partial purchases are made. The remaining capital that accumulates and flows into the market, when bitcoin reaches its lowest price and enters accumulation zones.
Accumulated position size
It can be noted that the dynamic DCA strategy obtains a better result, accumulating a total of 6.62 bitcoins, 18% higher than the static DCA strategy.
Percentage net profit
The static DCA strategy in the last rally was approximately 40% lower in percentage return on invested capital than the dynamic DCA strategy.
Average buying price
In the initial part of the simulation the average buying price of bitcoin using the static DCA strategy was lower, however, as time went on, the dynamic DCA strategy obtained a better average buying price, with 15% cheaper.
---
CONCLUSIONS
The dynamic DCA strategy was more efficient in the use of investment resources.
- One of the main advantages of the dynamic DCA strategy is that it will allow us to enter the spot market even after it has passed its parabolic growth cycle. We will be able to accumulate bitcoin in the bearish regime, having our largest purchases in the accumulation zone.
- Due to these characteristics, the time in which we stay in negative returns is going to be shorter than with a DCA strategy.
- This algorithm can be tested on different assets, extrapolated to Python and by connecting via API, you can configure the automatic purchase of cryptocurrencies, which generates an accumulation of assets based on back testing, relatively superior to what several wallets and exchanges offer.
- The parameters for configuring the dynamic DCA strategy are quite basic and do not require professional knowledge, and the optimal configuration can be obtained by visualizing the results.
PortfolioThe script’s purpose is to measure one’s net worth based on manual input. It can also be used to establish other “unthought-of” ways of analyzing charts, eg. to group different assets and watch for convergence.
“How to use”
First, decide which “currency” you want to measure all your assets against. You can display the portfolio value in a cryptocurrency or something else.
Add assets:
Write a description (eg. Bitcoin).
Set the amount you have.
Link to a chart that measures against your “currency”
It’s possible to add multiple assets in different “accounts” or “groups”. The portfolio value should then display the value of all those assets combined.
How is PnL measured?
You can measure PnL for the entire portfolio and every “group” individually. You are in charge of which level to measure from. You can for instance type in your current portfolio value and reset it on a monthly basis, or perhaps set a “floor” you want to avoid reaching. PnL is displayed in “currency” and percent change measured from the levels chosen by you.
Script information
To make the indicators published by this account fit together, look good, and easily managed. We had to include some code that is also used in the (closed-source) indicators “Long Position” and “Short Position”. This code is used for distancing and placing labels. It is a volatility-based code that looks back at the previous price action and determines a chart- and timeframe-specific volatility. Not “timeframe-specific” in the sense that some timeframes have special calculations, more that values will most likely be different depending on the “calculation environment”. The main functionality of this script is not about label placements, so we do not think this is a very big deal regarding originality for our other indicators. To keep our other indicators original and to not give away key code blocks with multi-functional value , we have chosen to also have this script published as closed-source.
Furthermore, the script requests data from other symbols based on the user’s input. Thereafter, it calculates and concatenates the percentage and value from the initial inputs. To better understand the script as a whole it would probably be useful to read the “How to use” section of this publication.
[MT] Strategy Backtest Template| Initial Release | | EN |
An update of my old script, this script is designed so that it can be used as a template for all those traders who want to save time when programming their strategy and backtesting it, having functions already programmed that in normal development would take you more time to program, with this template you can simply add your favorite indicator and thus be able to take advantage of all the functions that this template has.
🔴Stop Loss and 🟢Take Profit:
No need to mention that it is a Stop Loss and a Take Profit, within these functions we find the options of: fixed percentage (%), fixed price ($), ATR, especially for Stop Loss we find the Pivot Points, in addition to this, the price range between the entry and the Stop Loss can be converted into a trailing stop loss, instead, especially for the Take Profit we have an option to choose a 1:X ratio that complements very well with the Pivot Points.
📈Heikin Ashi Based Entries:
Heikin Ashi entries are trades that are calculated based on Heikin Ashi candles but their price is executed to Japanese candles, thus avoiding false results that occur in Heikin candlestick charts, this making in certain cases better results in strategies that are executed with this option compared to Japanese candlesticks.
📊Dashboard:
A more visual and organized way to see the results and necessary data produced by our strategy, among them we can see the dates between which our operations are made regardless if you have activated some time filter, usual data such as Profit, Win Rate, Profit factor are also displayed in this panel, additionally data such as the total number of operations, how many were gains and how many losses, the average profit and loss for each operation and finally the maximum profits and losses followed, which are data that will be very useful to us when we elaborate our strategies.
Feel free to use this template to program your own strategies, if you find errors or want to request a new feature let me know in the comments or through my social networks found in my tradingview profile.
| Update 1.1 | | EN |
➕Additions: '
Time sessions filter and days of the week filter added to the time filter section.
Option to add leverage to the strategy.
5 Moving Averages, RSI, Stochastic RSI, ADX, and Parabolic Sar have been added as indicators for the strategy.
You can choose from the 6 available indicators the way to trade, entry alert or entry filter.
Added the option of ATR for Take Profit.
Ticker information and timeframe are now displayed on the dashboard.
Added display customization and color customization of indicator plots.
Added customization of display and color plots of trades displayed on chart.
📝Changes:
Now when activating the time filter it is optional to add a start or end date and time, being able to only add a start date or only an end date.
Operation plots have been changed from plot() to line creation with line.new().
Indicator plots can now be controlled from the "plots" section.
Acceptable and deniable range of profit, winrate and profit factor can now be chosen from the "plots" section to be displayed on the dashboard.
Aesthetic changes in the section separations within the settings section and within the code itself.
The function that made the indicators give inputs based on heikin ashi candles has been changed, see the code for more information.
⚙️Fixes:
Dashboard label now projects correctly on all timeframes including custom timeframes.
Removed unnecessary lines and variables to take up less code space.
All code in general has been optimized to avoid the use of variables, unnecessary lines and avoid unnecessary calculations, freeing up space to declare more variables and be able to use fewer lines of code.
| Lanzamiento Inicial | | ES |
Una actualización de mi antiguo script, este script está diseñado para que pueda ser usado como una plantilla para todos aquellos traders que quieran ahorrar tiempo al programar su estrategia y hacer un backtesting de ella, teniendo funciones ya programadas que en el desarrollo normal te tomaría más tiempo programar, con esta plantilla puedes simplemente agregar tu indicador favorito y así poder aprovechar todas las funciones que tiene esta plantilla.
🔴Stop Loss y 🟢Take Profit:
No hace falta mencionar que es un Stop Loss y un Take Profit, dentro de estas funciones encontramos las opciones de: porcentaje fijo (%), precio fijo ($), ATR, en especial para Stop Loss encontramos los Pivot Points, adicionalmente a esto, el rango de precio entre la entrada y el Stop Loss se puede convertir en un trailing stop loss, en cambio, especialmente para el Take Profit tenemos una opción para elegir un ratio 1:X que se complementa muy bien con los Pivot Points.
📈Entradas Basadas en Heikin Ashi:
Las entradas Heikin Ashi son operaciones que son calculados en base a las velas Heikin Ashi pero su precio esta ejecutado a velas japonesas, evitando así́ los falsos resultados que se producen en graficas de velas Heikin, esto haciendo que en ciertos casos se obtengan mejores resultados en las estrategias que son ejecutadas con esta opción en comparación con las velas japonesas.
📊Panel de Control:
Una manera más visual y organizada de ver los resultados y datos necesarios producidos por nuestra estrategia, entre ellos podemos ver las fechas entre las que se hacen nuestras operaciones independientemente si se tiene activado algún filtro de tiempo, datos usuales como el Profit, Win Rate, Profit factor también son mostrados en este panel, adicionalmente se agregaron datos como el número total de operaciones, cuantos fueron ganancias y cuantos perdidas, el promedio de ganancias y pérdidas por cada operación y por ultimo las máximas ganancias y pérdidas seguidas, que son datos que nos serán muy útiles al elaborar nuestras estrategias.
Siéntete libre de usar esta plantilla para programar tus propias estrategias, si encuentras errores o quieres solicitar una nueva función házmelo saber en los comentarios o a través de mis redes sociales que se encuentran en mi perfil de tradingview.
| Actualización 1.1 | | ES |
➕Añadidos:
Filtro de sesiones de tiempo y filtro de días de la semana agregados al apartado de filtro de tiempo.
Opción para agregar apalancamiento a la estrategia.
5 Moving Averages, RSI, Stochastic RSI, ADX, y Parabolic Sar se han agregado como indicadores para la estrategia.
Puedes escoger entre los 6 indicadores disponibles la forma de operar, alerta de entrada o filtro de entrada.
Añadido la opción de ATR para Take Profit.
La información del ticker y la temporalidad ahora se muestran en el dashboard.
Añadido personalización de visualización y color de los plots de indicadores.
Añadido personalización de visualización y color de los plots de operaciones mostradas en grafica.
📝Cambios:
Ahora al activar el filtro de tiempo es opcional añadir una fecha y hora de inicio o fin, pudiendo únicamente agregar una fecha de inicio o solamente una fecha de fin.
Los plots de operaciones han cambiados de plot() a creación de líneas con line.new().
Los plots de indicadores ahora se pueden controlar desde el apartado "plots".
Ahora se puede elegir el rango aceptable y negable de profit, winrate y profit factor desde el apartado "plots" para mostrarse en el dashboard.
Cambios estéticos en las separaciones de secciones dentro del apartado de configuraciones y dentro del propio código.
Se ha cambiado la función que hacía que los indicadores dieran entradas en base a velas heikin ashi, mire el código para más información.
⚙️Arreglos:
El dashboard label ahora se proyecta correctamente en todas las temporalidades incluyendo las temporalidades personalizadas.
Se han eliminado líneas y variables innecesarias para ocupar menos espacio en el código.
Se ha optimizado todo el código en general para evitar el uso de variables, líneas innecesarias y evitar los cálculos innecesarios, liberando espacio para declarar más variables y poder utilizar menos líneas de código.
Rabi Pivot High LowIt is used to buy and sell in Stock Market NSE. It can also be used to Trail the SL to gain more profit or limit the loss.
Discipline is important in following the levels. If followed the levels properly, you will never be in loss in overall trade setup.