crypto-trading-bot
crypto-trading-bot copied to clipboard
added StochRSI?
Hello. What should we do to buy/sell with a new strategy? Can anyone do a favor and share the strategy that trades with the StochRSI indicator for this bot? Unfortunately, I do not have enough information to create a new strategy.
buildIndicator('stochRsi', 'stoch_rsi', '1m', { length: whatever })
let indicators = indicatorPeriod.getCurrentValues()
let stochRsi = indicators.stochRsi
if (stochRsi.stoch_k > 80) // <-- btw, bad idea
return somethingsomethingcreateSignal('short')
buildIndicator('stochRsi', 'stoch_rsi', '1m', { length: whatever }) let indicators = indicatorPeriod.getCurrentValues() let stochRsi = indicators.stochRsi if (stochRsi.stoch_k > 80) // <-- btw, bad idea return somethingsomethingcreateSignal('short')
Thank you very much for the help. But as I said, my knowledge on this subject is very limited.
When I create stochrsi.js in the strategy folder, can you help me with exactly what codes should I write in it?
About creating a structure like in macd.js.
'strategies': [
{
'strategy': 'stochrsi',
'options': {
'period': '15m'
}
},
What should I do to trade with stochrsi like in the example? can you create this file?
If stochrsi >80, let it sell. If Stochrsi < 20, let him buy.
Such strategy will lead to losses. Some of the biggest pumps happen at stochk_k 100. Likewise - time and length params are of utmost importance.
When I create stochrsi.js in the strategy folder, can you help me with exactly what codes should I write in it?
Already did.
Where do I write these values when I use this indicator with the sequence 3,3,14,33? Sorry I couldn't find this part.
buildIndicator('stochRsi', 'stoch_rsi', '1m', { length: whatever }) How do I fill in the whatever part of the code? with these periods?
Open up src/utils/indicators.js
and search for stoch_rsi
function.
I guess I couldn't explain the problem exactly :) I already examined that file first. maybe to give you an idea. my request was a sample file for stochRsi. Unfortunately, I don't have the knowledge to examine the indicator.js :)
but still thank you for your interest.
Excuse me for my English.
Unfortunately, I don't have the knowledge to examine the indicator.js :)
Well. You need to build it up. There's no way around it.
File you examined specifies available inputs for stoch_rsi
indicator.
Which is the answer to your question:
Where do I write these values when I use this indicator with the sequence 3,3,14,33? Sorry I couldn't find this part.
I am having trouble placing the necessary codes as there is no example for this strategy file. thanks again. I will handle it somehow.
Could someone please share a working stoch_rsi strategy?
And again, I beg you not to lead the way. If I could do that, I would have done it already. Please do not guide except sharing.
As in - profitable? Probably no one.
As in - profitable? Probably no one.
Everyone has to decide for himself whether it is profitable or not. My only request is for someone to share a stochRsi strategy. I failed to write a stochrsi strategy file that trades in the 80-20 range.
With fees included:
Backtesting Results - cemliks_stoch_rsi - 5m
Dashboard
Backtesting Results
Summary - 21-07-31 19:00:00 - 21-08-07 19:25:00
Initial Capital 10000 $
Final Capital 11402.27 $
Net Return on Investment 14.02 %
Sharpe Ratio -2.42
Average Return Per Trade 0.13 %
Total Number of Trades 111
Number of Winning Trades 76
Percentage of Winning Trades 68.47
const SignalResult = require('../dict/signal_result')
class CemliksStochRsi {
buildIndicator = (builder, options) => {
builder.add('stoch_rsi', 'stoch_rsi', '5m', { k: 3, d: 3, stoch_length: 14, rsi_length: 33 })
}
setup(period) {
const indicators = period.getLatestIndicators();
const candles = period.indicators.candles
const candle = candles.slice(-1)[0]
this.indicatorPeriod = period
this.close = candle.close
this.stoch_rsi = indicators.stoch_rsi
this.entry = this.indicatorPeriod.strategyContext.entry
this.profit = period.strategyContext.profit
this.backtest = period.strategyContext.backtest
this.lastSignal = period.getLastSignal()
this.signal = SignalResult.createEmptySignal()
this.signal.mergeDebug(this.debug())
}
period(indicatorPeriod) {
this.setup(indicatorPeriod)
const lastSignal = this.lastSignal,
signal = this.signal
if (lastSignal) {
if (lastSignal == 'long' && this.stoch_rsi.stoch_k > 80) signal.setSignal('close')
if (lastSignal == 'short' && this.stoch_rsi.stoch_k < 20) signal.setSignal('close')
} else {
if (this.stoch_rsi.stoch_k > 80) signal.setSignal('short')
if (this.stoch_rsi.stoch_k < 20) signal.setSignal('long')
}
return this.signal
}
debug() { return {} }
getBacktestColumns() { return [] }
getName() { return 'cemliks_stoch_rsi' }
getTickPeriod() { return '5m' }
getOptions() { return {} }
}
module.exports = CemliksStochRsi