mcducksproject / mcducksbroker Goto Github PK
View Code? Open in Web Editor NEWWhat if mcDuck had a crypto broker?
License: GNU General Public License v3.0
What if mcDuck had a crypto broker?
License: GNU General Public License v3.0
Using only the Klinger Oscilator for an strategy isn't trustworthy.
We have to try to improve the buy/sell signals with another indicator.
In this case we will be using two klinger oscilators, one with 1d candles and another with 4h candles.
BUY: 4h klinger oscilator crosses from below AND 1d ko crossed before from below.
SELL: 4h klinger oscilator crosses from above AND 1d ko crossed before from above.
Info:
https://www.investopedia.com/terms/k/klingeroscillator.asp
this references #21
La idea es tener 2 validaciones para que el bot compre, con el siguiente orden:
Una vez suceda se termina de validar con:
La tendencia tiene que ser alcista. Una manera de calcularlo, es obtener el valor del Stoch de la vela de 4hs anterior y restarle el valor de la vela de 4hs actual.
Si el valor es positivo, significa que la tendencia del Stoch es bajista, por lo que no se tiene que activar la orden de compra.
En cambio, si el resultado es negativo, significa que la tendencia es alcista, por lo que ahí si validaría la compra
Agrego un gráfico diario a modo de ejemplo
El 24/11/20 klinger cruzó en el diario, pero el stoch se muestra bajista, por lo que el bot en ese momento no tendría que comprar
Como vemos, el precio en ese punto lateralizó o incluso bajo. Por lo que la fue invalidada correctamente.
En cambio el 16/12/20 ambas tendencias fueron alcistas, por lo que el bot tendría que comprar.
A partir de ese punto, hubo una suba en el precio, por lo que la señal se valido correctamente.
Roi recomendado 2%
Paso código del indicador:
RSI / STOCH RSI OVERLAY (14, 3, 3, 14, 14, close)
study(title="RSI / STOCH RSI OVERLAY", shorttitle="STOCH V RSI")
src = close, len = input(14, minval=1, title="Length")
up = rma(max(change(src), 0), len)
down = rma(-min(change(src), 0), len)
rsi = down == 0 ? 100 : up == 0 ? 0 : 100 - (100 / (1 + up / down))
plot(rsi, color=green, linewidth=3)
band1 = hline(70, linestyle=solid)
band0 = hline(30, linestyle=solid)
fill(band1, band0, color=purple, transp=80)
smoothK = input(3, minval=1)
smoothD = input(3, minval=1)
lengthRSI = input(14, minval=1)
lengthStoch = input(14, minval=1)
src1 = input(close, title="RSI Source")
rsi1 = rsi(src, lengthRSI)
k = sma(stoch(rsi1, rsi1, rsi1, lengthStoch), smoothK)
d = sma(k, smoothD)
plot(k, color=white)
plot(d, color=orange)
h0 = hline(80)
h1 = hline(20)
fill(h0, h1, color=black, transp=100)
Add section of helpful commands to the wiki.
Download data
freqtrade download-data -t 4h 1h --days 100 --data-format-ohlcv hdf5 -c user_data/config.base.json -c user_data/config.currencyUSDT.json
Backtesting
freqtrade backtesting -i 1h --strategy-list M11hStrategy M11hStrategyOpt M21hStrategy M21hStrategyOpt M31hStrategy M31hStrategyOpt M44hStrategy
freqtrade backtesting -i 1h --strategy Solipsis5 --data-format-ohlcv hdf5 -c user_data/config.base.json -c user_data/config.strategySolipsis.json -c user_data/config.currencyBTC.json --timerange 20210502-20210509
freqtrade backtesting -i 1h --strategy StrategyM3 --data-format-ohlcv hdf5 -c user_data/config.base.json -c user_data/config.strategyM3.json -c user_data/config.currencyBTCKraken.json
Hyperopt
freqtrade hyperopt --hyperopt-loss SharpeHyperOptLossDaily --spaces roi stoploss trailing --strategy M11hStrategy
freqtrade hyperopt --hyperopt HyperoptM3 --strategy StrategyM3 --hyperopt-loss OnlyProfitHyperOptLoss -c user_data/config.base.json -c user_data/config.strategyM3.json -c user_data/config.currencyBTCKraken.json
Si BTC se encuentra en canales bajistas, aprovechar soportes y resistencias (en 4hs o 1 día o la combinación) para comprar paxg/btc en la resistencia y vender en el soporte. Se puede ganar 10% o más en BTC en cada compra y venta. Para conseguir los soportes se puede usar fibonacci o buscar algún indicador en TV donde lo haga automatico (Puntos pivote se que hay y se podria usar)
Exchange : Binance
Generate documentation for the usage of this indicator on our own strategies.
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © itsale-a
//@version=5
strategy("Doble RSI Scalper - Pelu", overlay=true)
//indicator("Doble RSI Scalper - Pelu", overlay=true)
// RSI same timeframe
overb = input.int(42, "Overbought same TF")
overs = input.int(52, "Oversold same TF")
len = input.int(14, minval=1, title="Length")
src = input(close, "Source")
up = ta.rma(math.max(ta.change(src), 0), len)
down = ta.rma(-math.min(ta.change(src), 0), len)
rsi1 = down == 0 ? 100 : up == 0 ? 0 : 100 - (100 / (1 + up / down))
// RSI higher timeframe
len2 = input.int(14, minval=1, title="2d RSI len")
src2 = input(close, "2d RSI source")
resolution = input.timeframe(title="Select 2nd RSI Timeframe", defval="720")
overb2 = input.int(42, "Overbought higher TF")
overs2 = input.int(52, "Oversold higher TF")
up2 = ta.rma(math.max(ta.change(src2), 0), len2)
down2 = ta.rma(-math.min(ta.change(src2), 0), len2)
rsi2_f = down2 == 0 ? 100 : up2 == 0 ? 0 : 100 - (100 / (1 + up2 / down2))
rsi2 = request.security(syminfo.tickerid, resolution, ta.rsi(src2, len2), lookahead=barmerge.lookahead_on)
// Prueba ema
//ema = ta.ema(close,14)
//plot(ema)
long_rsi = rsi1 > overs
long_rsi_ht = rsi2 > overb2
longCondition = (long_rsi and long_rsi_ht)
// TPS y SL
tp = input.float(140, "Take profit (%)") / 100
sl = input.float(140, "Stop Loss (%)") / 100
longStop = strategy.position_avg_price * (1 - sl)
longTake = strategy.position_avg_price * (1 + tp)
plot(longStop, color=color.red, style=plot.style_linebr , linewidth=2)
plot(longTake, color=color.green, style=plot.style_linebr, linewidth=2)
strategy.entry("Longaniza",strategy.long, when=longCondition)
//plotshape(longCondition, title = "Buy", text = 'Buy', style = shape.labelup, location = location.belowbar, color= color.green, textcolor = color.white, transp = 0, size = size.tiny)
//alertcondition(longCondition, "Doble RSI - BUY", "Doble RSI - BUY")
if strategy.position_avg_price > 0
strategy.exit("Close longaniza!", stop=longStop, limit=longTake, when=longCondition)`
La idea es usar el indicador CPT ADX para detectar la tendencia general de BTC/USDT en 4hs y activar o desactivar posibles compras (en conjunto con el resto de los indicadores de la estrategia elegida) Se usaría como la 1er confirmación.
El indicador nos muestra "valles" de color rojo o verde, dependiendo de la fuerza de la tendencia. Rojo si tiene fuerza bajista y verde y si tiene fuerza alcista.
a) Para que el bot active la compra, se tiene que dar alguna de las siguientes situaciones:
1- En un valle rojo, esto es que hay 2 o más columnas rojas consecutivas, la última columna es al menos 3,8 más chica que la anterior, por ej:
Esto demuestra debilidad bajista y un posible cambio de tendencia, por lo que en ese momento debería activarse el bot para posibles compras.
2- En un valle rojo, aparece una columna verde.
Por lo tanto, si luego de 2 columnas rojas o más, aparece una verde, se debería activar la compra.
3- En un valle verde, esto es que hay 2 o más columnas en verde, la última columna es al menos 5,4 más grande que la anterior, por ej
En esta caso, el 30/05 se activó la zona de compra ya que se cumple la condición 1 de la activación. El 1/06 se desactiva la zona de compra ya que apareció una columna roja en un valle verde (seria la condición 2 de la desactivación) pero luego el 2/06 se vuelve a activar la zona de compra ya que se cumple la condición 3 de compra.
b) Por otro lado, para que el bot desactive la zona de compra, se tiene que dar alguna de las siguientes situaciones:
1- En un valle rojo, esto es que hay 2 o más columnas rojas consecutivas, la última columna es al menos 3,8 más grande que la anterior, por ej:
2- En un valle verde, aparece una columna roja.
3- En un valle verde, esto es que hay 2 o más columnas en verde, la última columna es al menos 5,4 más chica que la anterior, por ej
Habría que probar los valores, ver como resultan, y en todo caso replantearlos.
https://www.paguertrading.com/pools/
El precio va a tender a llegar a donde se encuentran la mayor cantidad de liquidaciones.
Esto sirve más que nada para abrir posiciones en futuros, aunque también se podría usar para spot.
The buy/sell signals are only generated in the open/close of candles.
The strategy should be able to generate signals the moment the cross is made.
Read the last 30 days of wallet information (using daily stats).
Calculate daily exchange data (typical price) against BTC, for each crypto found.
Generate area graph with the information.
Custom indicators (klinger oscilator so far) should be in it's own file inside strategies/indicators
Probar usar el klinger solo diario, y ponerle un take profit de 5% (idealmente ir probando distintos %) que el take profit solo lo haga en señales de buy, y no tomar las señales de sell.
Estuve estudiando solo el grafico diario y en marzo / abril / mayo cada vez que cruzaba, el precio subió al menos un 5% a veces más, y creo que 1 sola vez fue una especie de falso positivo, (subió menos de 5%)
Originally posted by @tito3333 in #1 (comment)
if the last 3 candles are red and the actual one is green, it must be wider than the widest of the last 3 red candles. if it is, buy.
Maybe implement CI/CD in order to prepare packages for testing, in order to not have to download the whole repository.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.