CRYPTO Live Trading Bot with Python [Stoch, RSI, MACD]
E conheça também sobre o Melhor Bot Para Opções Binárias 2022
Que tal um robo gratuito para IQ Option? Sistema Para IQ Option Grátis
In this video we are building a Python cryptobot using the Binance API.
We will apply technical indicators such as the Stochastic Slow, RSI and MACD and implement a Target profit and Stop Loss mechanism.
We will trade Cardano (ADA) but feel free to pick other currencies (BTC, ETH, …)
Please subscribe if you find this content valuable!
Get the Notebook/Source code by becoming a Tier-2 Channel member:
This video is a prerequisite and contains explanations:
Check out my other videos on constructing crypto bots in this playlist – I also covered setting up the Binance API and handling connection timeouts or any other type of error:
If you want to support me you can register for Binance with this link, but don’t feel forced to:
Disclaimer: This video is not an investment advice and is for educational and entertainment purposes only! Cryptocurrency and automated trading is bearing a high amount of risk which might result in a total loss of your invested capital.
00:00 – 01:42 Introduction / Strategy recap / Disclaimer
01:42 – 02:26 Libraries
02:26 – 03:30 Pulling price data from Binance
03:30 – 05:44 Calculate technical indicators (Stoch,RSI,MACD)
05:44 – 12:15 Trigger/Buying Logic/ Lags “trade off”
12:15 – 15:34 Actual strategy: Buying condition
15:34 – 19:36 Actual strategy: Selling condition
19:36 – 21:09 Whole strategy / activating the Bot
21:09 – 24:03 Example Trades
#Python #Tradingbot #Crypto #Binance
Vídeo
You're a real master in Python coding… great content. I would like you to teach a beginenr, like me, how to test a Python script bot on a tradingview account (will be a trial one…)
"AttributeError: 'DataFrame' object has no attribute 'Buy'"
How can i fix this? Please help me brothers and sisters.
Thanks you! I have learned more with your videos than any other in the pas year… These videos are incredibly useful to me (I guess to others also)… Many thanks
Dataframe dont show BUY and TRIGGER columns and gives eror as —————————————————————————
AttributeError Traceback (most recent call last)
Input In [75], in <cell line: 1>()
—-> 1 inst.decide()
Input In [71], in Signals.decide(self)
17 def decide(self):
—> 18 self.df['trigger'] = np.where(self.gettrigger(), 1 , 0)
19 self.df['Buy'] = np.where((self.df.trigger) &
20 (self.df['%K'].between(20,80)) & (self.df['%D'].between(20,80))
21 &(self.df.rsi > 50) & (self.df.macd > 0), 1, 0)
Input In [71], in Signals.gettrigger(self)
9 def gettrigger(self):
—> 10 df = pd.Dataframe()
11 for i in range(self.lags + 1):
12 mask = (self.df['%K'].shift(i) < 20) & (self.df['%D'].shift(i) <20)
File ~anaconda3libsite-packagespandas__init__.py:261, in __getattr__(name)
257 from pandas.core.arrays.sparse import SparseArray as _SparseArray
259 return _SparseArray
–> 261 raise AttributeError(f"module 'pandas' has no attribute '{name}'")
AttributeError: module 'pandas' has no attribute 'Dataframe'
AttributeError Traceback (most recent call last)
Input In [76], in <cell line: 1>()
—-> 1 df[df.Buy==1]
File ~anaconda3libsite-packagespandascoregeneric.py:5575, in NDFrame.__getattr__(self, name)
5568 if (
5569 name not in self._internal_names_set
5570 and name not in self._metadata
5571 and name not in self._accessors
5572 and self._info_axis._can_hold_identifiers_and_holds_name(name)
5573 ):
5574 return self[name]
-> 5575 return object.__getattribute__(self, name)
AttributeError: 'DataFrame' object has no attribute 'Buy'
Many thanks again… Wonderful info
mask = (self.df['%K'].shift(i) < 20) & (self.df['%D'].shift(i) < 20) throws an error, which I can't find a solution for: TypeError: '<' not supported between instances of 'method' and 'int'. Any hint would be appreciated. (using python3) Thanks for the great content.
I may have missed this but where do you execute or run the script ?
One thing… I think buying with a market order is super risky because you are not considering the price you are about to pay for an order. There is often a $5 spread between the top of the buy/sell orders, so you can move pretty far away from being in profit relative to what your indicators are deciding is a good entry. Also, on $20k BTC, you are asking for a $100 profit, but in a general bear market, you will almost alway hit your stop loss before you hit your profit target.
What's the platform your coding on?
Wow! Fantastic video. Thank you Algovibes.
One question; how could you apply Heikin Ashi into the df before calculating %K, %D, rsi?
Sorry for stupid question but i need help. What's mean the lags? It's the time frame? Can you clarify about in more detail? Thanks for your time.
Trying out this code I keep getting: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead.
dfx = dfx.append(mask, ignore_index=True). How would you adjust the script for this?
Cool
When the buy conditions are met, it gives me an error message 😔
binance.exceptions.BinanceAPIException: APIError(code=-1013): Filter failure: MIN_NOTIONAL
I don't know how to use Jupiter notebook…. Can you teach the same thing in pycharm
Hallo, I’m having this error only if I deploy it in the Cloud, not when I run it on my Mac: binance.exceptions.BinanceAPIException: APIError(code=-1003): Too much request weight used; current limit is 1200 request weight per 1 MINUTE. Please use the websocket for live updates to avoid polling the API.
Do you lose sometimes from your algo
hi.
you are amazing.
could you please write a code for kucoin with websocket and RSI STOCH and MACD?
i could not implement kucoin websocket to dataframe.
i am very new in python
thanks bro
I didn't understand the 'lags' concept. Have you explained it in any other video?
Hi mate, how could I change the quantiy? Instead of buying tokens, I want to use investment, I’d say 10 USDT.
thank you for the video sir! I have a few questions if you don't mind 🙂 Suppose I am trading at 15minute timeframe,
1. should I set "inst = Signals(df, 15)" to 15?
2. should I set "getminutedata(pair, '1m')" to 15 also?
thanks again!
@Algovibes Where do you share your source codes ? Great material! Tnx for sharing.
hey i deployed the same bot but to Kucoin platform and the code exceeded API request rate 🙁 any fix for that?
Great video and very nicely explained. I implemented your logic to derive the stats (on 1 min timeframe) and it shows perfectly. But for the latest 15-20 min, it shows all values as NaN. I am not able to figure out why? Any help, please.