
Godwill5050
@t_Godwill5050
What symbols does the trader recommend buying?
Purchase History
پیام های تریدر
Filter
Signal Type

import ccxt import pandas as pd # Set up exchange and symbol exchange = ccxt.binance() symbol = 'EUR/USD' # Set up MA parameters short_term_ma_period = 50 long_term_ma_period = 200 # Define the bot's logic def ma_crossover_bot(data): # Calculate short-term and long-term MA short_term_ma = data ['close'].rolling(window=short_term_ma_period).mean() long_term_ma = data ['close'].rolling(window=long_term_ma_period).mean() # Check for buy signal if short_term_ma.iloc [-1] > long_term_ma.iloc [-1] and short_term_ma.iloc [-2] < long_term_ma.iloc [-2]: return 'Buy' # Check for sell signal elif short_term_ma.iloc [-1] < long_term_ma.iloc [-1] and short_term_ma.iloc [-2] > long_term_ma.iloc [-2]: return 'Sell' # No signal, do nothing else: return 'Do Nothing' # Set up the bot to run on each new candle def run_bot(): data = exchange.fetch_ohlcv(symbol, timeframe='1m') df = pd.DataFrame(data, columns= ['time', 'open', 'high', 'low', 'close', 'volume']) signal = ma_crossover_bot(df) if signal == 'Buy': exchange.place_order(symbol, 'buy', 0.1) elif signal == 'Sell': exchange.place_order(symbol, 'sell', 0.1) # Run the bot run_bot() ```
Disclaimer
Any content and materials included in Sahmeto's website and official communication channels are a compilation of personal opinions and analyses and are not binding. They do not constitute any recommendation for buying, selling, entering or exiting the stock market and cryptocurrency market. Also, all news and analyses included in the website and channels are merely republished information from official and unofficial domestic and foreign sources, and it is obvious that users of the said content are responsible for following up and ensuring the authenticity and accuracy of the materials. Therefore, while disclaiming responsibility, it is declared that the responsibility for any decision-making, action, and potential profit and loss in the capital market and cryptocurrency market lies with the trader.