LowFinder_PyraMider_V2This strategy is a result of an exploration to experiment with other ways to detect lows / dips in the price movement, to try out alternative ways to exit and stop positions and a dive into risk management. It uses a combination of different indicators to detect and filter the potential lows and opens multiple positions to spread the risk and opportunities for unrealized losses or profits. This script combines code developed by fellow Tradingview community_members.
LowFinder
The lows in the price movement are detected by the Low finder script by RafaelZioni . It finds the potential lows based on the difference between RSI and EMA RSI. The MTF RSI formula is part of the MTFindicators library developed by Peter_O and is integrated in the Low finder code to give the option to use the RSI of higher timeframes. The sensitivity of the LowFinder is controlled by the MA length. When potential lows are detected, a Moving Average, a MTF Stochastic (based the the MTFindiicators by Peter_O) and the average price level filter out the weak lows. In the settings the minimal percentage needed for a low to be detected below the average price can be specified.
Order Sizing and Pyramiding
Pyramiding, or spreading multiple positions, is at the heart of this strategy and what makes it so powerful. The order size is calculated based on the max number of orders and portfolio percentage specified in the input settings. There are two order size modes. The ‘base’ mode uses the same base quantity for each order it opens, the ‘multiply’ mode multiplies the quantity with each order number. For example, when Long 3 is opened, the quantity is multiplied by 3. So, the more orders the bigger the consecutive order sizes. When using ‘multiply’ mode the sizes of the first orders are considerably lower to make up for the later bigger order sizes. There is an option to manually set a fixed order size but use this with caution as it bypasses all the risk calculations.
Stop Level, Take Profit, Trailing Stop
The one indicator that controls the exits is the Stop Level. When close crosses over the Stop Level, the complete position is closed and all orders are exited. The Stop Level is calculated based on the highest high given a specified candle lookback (settings). There is an option to deviate above this level with a specified percentage to tweak for better results. You can activate a Take Profit / Trailing Stop. When activated and close crosses the specified percentage, the Stop Level logic changes to a trailing stop to gain more profits. Another option is to use the percentage as a take profit, either when the stop level crosses over the take profit or close. With this option active, you can make this strategy more conservative. It is active by default.
And finally there is an option to Take Profit per open order. If hit, the separate orders close. In the current settings this option is not used as the percentage is 10%.
Stop Loss
I published an earlier version of this script a couple of weeks ago, but it got hidden by the moderators. Looking back, it makes sense because I didn’t pay any attention to risk management and save order sizing. This resulted in unrealistic results. So, in this script update I added a Stop Loss option. There are two modes. The ‘average price’ mode calculates the stop loss level based on a given percentage below the average price of the total position. The ‘equity’ mode calculates the stop loss level based on a given percentage of your equity you want to lose. By default, the ‘equity’ mode is active. By tweaking the percentage of the portfolio size and the stop loss equity mode, you can achieve a quite low risk strategy set up.
Variables in comments
To sent alerts to my exchange I use a webhook server. This works with a sending the information in the form of a comment. To be able to send messages with different quantities, a variable is added to the comment. This makes it possible to open different positions on the exchange with increasing quantities. To test this the quantities are printed in the comment and the quantities are switched off in the style settings.
This code is a result of a study and not intended for use as a worked out and full functioning strategy. Use it at your own risk. To make the code understandable for users that are not so much introduced into pine script (like me), every step in the code is commented to explain what it does. Hopefully it helps.
Enjoy!
Dipbuy
[Fedra Algotrading Strategy]English / Spanish
Algotrading strategy optimized for cryptocurrencies. Originally conceived to trade automatically through bots (that's how I use it), it also works to get signals and trade manually in any exchange.
It works in spot. It does not repaint. Works in 15M, 30M, 1H and 4H (I prefer short periods).
Features:
Buy the dip:
Attempts to buy on the dip, finding entries when the price makes abrupt dips that break the linear regression of the last periods (default 40).
Trailing Take Profit:
Once the percentage established for the take profit is reached, the strategy follows the price if it is rising until it stops rising and only then makes the sale.
Trend Detection:
Determines whether the market is in an uptrend or downtrend by crossing 2 SMAs. This affects the performance of the strategy. This works as a filter to avoid making entries in a downtrend.
Trailing Break Even:
If the market enters a downtrend with an open trade, a Trailing Break Even is triggered, (configurable, default 1.5%). The intention is to close the trade as soon as possible, but without losses. The value of 1.5% is intended to cover commission costs and a possible spread. Like the Take Profit, the Trailing Break Even follows the price as it rises until it stops doing so before closing the trade.
How to use this strategy?
In the properties of the strategy you assign the amount you will trade (default 100), the percentage of the total capital you will use in each trade (default 100%) and the value of the commissions (default 1%).
Select the pair to trade. The strategy is optimized for trading pairs with stable coins. The strategy benefits from volatility so choosing among currencies with a market cap between 50M and 10,000M gives better profits than with top 10 currencies.
In the strategy options, disable the stoploss by setting it to 100% to be able to concentrate on the Take Profit.
With an eye on the "Net Profit" of the strategy, start with the take profit at 3% (for lower percentages there is the Break Even) and increase it 1 by 1 until determining which is the best for our pair (the one that gives us a better net profit).
Once the Take Profit is established, enable the StopLoss starting from 1 and choosing the best parameter looking for the balance that makes us feel comfortable between the Net Profit and the total of closed operations.
Test this same with candles of different periods (I trade with 15M and 30M candles).
Tip:
To trade automatically using a bot, I recommend using pairs in which the strategy has a profitability higher than 80%.
To counteract possible overfitting, when the strategy has given me a 30% profit, I recalculate the optimal parameters.
If you are interested in auromatizing it to trade on Binance, Binance US, AAX, Kucoin, Liquid, Okex, Bitfinex, Bittrex, Coinbase Pro, Gemini, HitBTC, Kraken or Poloniex, I recommend using Quadency bots, they are free and the ones I use.
This will eventually be a paid script, but you can request free access for now.
I am still working on optimizations, improvements, and more features.
DCA version coming soon.
I leave some optimizations of the spares I am trading at the moment (On 15M candles):
PAIR SL TP Bars Profit Profit Rentability
OM 3 4 96 70 2703.41% 88.57%
NU 4 3 96 81 1170.38% 86.42%
ONE 4 4 192 83 756% 91.57%
FTM 8 4 192 80 900.00% 92.50%
LUNA 3 8 192 78 410.98% 83.33%
OMG 6 4 192 72 408.75% 88.89%
FRONT 2 5 96 61 406% 85.25%
SOL 5 10 96 84 381.78% 83.33%
UTK 2 4 192 59 520.00% 88.06%
NMR 2 3 96 76 279% 80.26%
STPT 1 4 96 84 272.34% 79.76%
ROSE 5 4 96 59 478.00% 88.00%
clv 4 5 192 46 216% 78.26%
XTZ 4 6 96 87 216.00% 82.76%
C98 1 6 96 36 184.46% 80.56%
ALGO 7 4 192 61 222.00% 88.52%
ATOM 6 4 96 73 160.40% 86.30%
DOT 3 6 96 75 156.54% 84%
REEF 4 4 96 67 154.90% 85.07%
AUDIO 10 5 192 62 128.48% 83.87%
DYDX 1 10 96 20 120.76% 90%
DOT 4 6 96 77 111.33% 83.12%
KEEP 7 5 96 69 110% 87%
MINA 7 6 96 23 100.29% 86.96%
OPUL 1 5 96 18 95.26% 100%
HBAR 1 3 192 76 91.82% 81.58%
VRA/USDT 7 4 96 81 89.35% 81.48%
XEC 3 14 96 27 89.24% 85.19%
*****************************************************SPANISH*****************************************
Estrategia de Algotrading optimizada para criptomonedas. Originalmente concebida para operar de manera automática mediante bots (así la utilizo yo), funciona también para obtener señales y operar manualmente en cualquier exchange.
Funciona en spot. No repinta. Funciona en 15M, 30M, 1H y 4H (Yo prefiero periodos cortos)
Características:
Buy the dip:
Intenta comprar en el dip, encontrando entradas cuando el precio hace bajadas abruptas que rompen la regresión lineal de los últimos periodos (por defecto 40)
Trailing Take Profit:
Una vez alcanzado el porcentaje establecido para el take profit, la estrategia acompaña al precio si está en ascenso hasta que deja de subir y recién ahí realiza la venta.
Detección de Trend:
Determina si el mercado tiene una tendencia alcista o bajista mediante el cruce de 2 SMAs. Esto afecta el funcionamiento de la estrategia. Esto funciona como filtro para evitar realizar entradas en una tendencia bajista.
Trailing Break Even:
Si el mercado entra en tendencia bajista con una operación abierta, se activa un Trailing Break Even, (configurable, por defecto 1.5%). La intención es cerrar la operación lo antes posible, pero sin pérdidas. El valor de 1.5% está pensado para cubrir los costos de comisiones y un posible spread. Al igual que el Take Profit, El Trailing Break Even acompaña al precio mientras sube hasta que deja de hacerlo antes de cerrar la operación.
Cómo utilizar esta estrategia?
En las propiedades de la estrategia se le asigna el monto con el que va a operar (por defecto 100), el porcentaje del total de capital que utilizará en cada operación (por defecto 100%) y el valor de las comisiones (por defecto 1%)
Seleccionar el par a operar. La estrategia está optimizada para operar en pares con stablecoins. La estrategia se beneficia con la volatilidad por lo que elegir entre las monedas con un market cap de entre 50M y 10.000M da mejores beneficios que con monedas del top 10
En las opciones de la estrategia, deshabilitar el stoploss configurándolo en 100% para poder concentrarnos en el Take Profit.
Con un ojo en el “Beneficio Neto” de la estrategia, comenzar con el take profit en 3% (para porcentajes menores está el Break Even) e ir aumentándolo de 1 en 1 hasta determinar cuál es el mejor para nuestro par (el que nos proporciona un major beneficio neto).
Establecido el Take Profit, habilitar el StopLoss partiendo de 1 y eligiendo el mejor parámetro buscando el equilibrio que nos haga sentir cómodos entre el Beneficio Neto y el total de operaciones cerradas.
Probar esto mismo con velas de diferentes periodos (Yo opero con velas de 15M y 30M)
Consejo:
Para operar de manera automática mediante un bot, recomiendo utilizar pares en los que la estrategia tenga una rentabilidad superior al 80%
Para contrarestar posible overfiting, cuando la estrategia me ha dado un 30% de profit, vuelvo a calcular los parámetros óptimos.
Si te interesa auromatizarla para operar en Binance, Binance US, AAX, Kucoin, Liquid, Okex, Bitfinex, Bittrex, Coinbase Pro, Gemini, HitBTC, Kraken o Poloniex, recomiendo usar los bots de Quadency, son gratiutos y los que yo utilizo.
Este será eventualmente un script pago, pero puedes solicitar acceso gratuito por ahora.
Sigo trabajando en optimizaciones, mejoras, y más funciones.
Próximamente versión DCA.
Dejo algunas optimizaciones de lo spares que yo estoy operando en este momento (En velas de 15M contra BUSD):
PAR SL TP Bars Operaciones Profit Rentabilidad
OM 3 4 96 70 2703.41% 88.57%
NU 4 3 96 81 1170.38% 86.42%
ONE 4 4 192 83 756% 91.57%
FTM 8 4 192 80 900.00% 92.50%
LUNA 3 8 192 78 410.98% 83.33%
OMG 6 4 192 72 408.75% 88.89%
FRONT 2 5 96 61 406% 85.25%
SOL 5 10 96 84 381.78% 83.33%
UTK 2 4 192 59 520.00% 88.06%
NMR 2 3 96 76 279% 80.26%
STPT 1 4 96 84 272.34% 79.76%
ROSE 5 4 96 59 478.00% 88.00%
clv 4 5 192 46 216% 78.26%
XTZ 4 6 96 87 216.00% 82.76%
C98 1 6 96 36 184.46% 80.56%
ALGO 7 4 192 61 222.00% 88.52%
ATOM 6 4 96 73 160.40% 86.30%
DOT 3 6 96 75 156.54% 84%
REEF 4 4 96 67 154.90% 85.07%
AUDIO 10 5 192 62 128.48% 83.87%
DYDX 1 10 96 20 120.76% 90%
DOT 4 6 96 77 111.33% 83.12%
KEEP 7 5 96 69 110% 87%
MINA 7 6 96 23 100.29% 86.96%
OPUL 1 5 96 18 95.26% 100%
HBAR 1 3 192 76 91.82% 81.58%
VRA/USDT 7 4 96 81 89.35% 81.48%
XEC 3 14 96 27 89.24% 85.19%