Closed thorjeus closed 5 years ago
Thank you, thorjeus.
You are right, the current strategy is just for demo purpose, it's not profitable.
Adding the rsi into strategy.py is easy, the important thing is how to define your strategy with rsi. for example, rsi value > 80, sell. value < 20, buy. if you check MACD() function in strategy, it will return a signal (bull, sell, nothing). Then the portfolio class is able to process the ordering based on the signal.
Please give me a suggestion on how to use rsi. it might be even used together with macd. I will add it to system later based on your opinion.
Regards
Max
Hi Dev,
I'm not quite sure in how to get it into it, my logical is simple for using rsi as strat, eventhough rsi is not the accurate one for strat.
if self.last_operation != "BUY":
if self.rsi < 30 and self.sma_fast > self.sma_slow:
self.long()
if self.last_operation != "SELL":
if self.rsi > 70:
self.short()
Just maybe, imho this api quite useful to use https://api.cryptowat.ch/markets/bitmex/btcusd-perpetual-futures/ohlc
I hope i can help you out, but currently i will be a tester :( Have to learn in coding lol
Keep up the great work dev. This programs deserve to be maintained.
Thanks & Regards.
I added your strategy, and if you add more please refer to the WIKI https://github.com/tw7613781/daxiang_trade/wiki/system-modularity
Hi Dev, I just came up with another idea in implementing rsi strat where the bot is buying at per level we set, so the idea will be like this:
Strategy:
In a table, it could be seen like this with an example of 10 contract amount
RSI Short 70< first buy, amount = 10 x 1 -> 10 contracts 80< second buy, amount = 10 x 2 -> 20 contracts 90< third buy, amount = 10 x 3 -> 30 contracts
RSI Long 50> first buy, amount = 10 x 11 -> 10 contracts 40> second buy, amount = 10 x 2 -> 20 contracts 30> third buy, amount = 10 x 3 -> 30 contracts
Closing options:
Stop loss: RSI Short: 110< RSI Long: 10>
Sorry, this is just an idea, if it become a scalping method it still profitable after all, i guess. Thank you.
Hi dev,
Congrats, finally it's on the run. Found that current strategy is not yet effective (personally to me) since the result is negative for testing in few hours.
And since i am not a coder, could you please give a hint how to integrated this rsi strat into the module i use? Tried that manually but there is error in importing related to portfolio.py (error in importing MACD)
This could be another strat to use:
def relative_strength_index(df, n): """Calculate Relative Strength Index(RSI) for given data.
Appreciate for your kindly help. Thanks & regards.