Category : trading

It is a strange phenomenon. The code works normally on Windows (PC), but an error message occurs in Google Cloud as well as AWS, Azure Given the following code: import ccxt import pandas as pd from pandas import DataFrame import numpy as np import multiprocessing as mp # binance keys API_KEY = ” SECRET_KEY = ..

Read more

It is a strange phenomenon. The code works normally on Windows (PC), but an error message occurs in Google Cloud as well as AWS, Azure Given the following code: import ccxt import pandas as pd from pandas import DataFrame import numpy as np import multiprocessing as mp # binance keys API_KEY = ” SECRET_KEY = ..

Read more

i use that code to read messages from telegram # Create the client and connect client = tlg_connect(API_ID, API_HASH, PHONE_NUM) client.start() entity = client.get_input_entity(CHAT_LINK) @client.on(events.NewMessage(chats = [entity.channel_id])) async def my_event_handler(event): print(event.text) client.run_until_disconnected() But i need another function that watch another variable value all the time, like that def managePosition(): while True: if getvalue(BSC)>1: ClosePositon() managePosition() ..

Read more

i use that code to read messages from telegram # Create the client and connect client = tlg_connect(API_ID, API_HASH, PHONE_NUM) client.start() entity = client.get_input_entity(CHAT_LINK) @client.on(events.NewMessage(chats = [entity.channel_id])) async def my_event_handler(event): print(event.text) client.run_until_disconnected() But i need another function that watch another variable value all the time, like that def managePosition(): while True: if getvalue(BSC)>1: ClosePositon() managePosition() ..

Read more

def on_message(ws, message): global in_position global closes json_message = json.loads(message) candle = json_message[‘k’] is_candle_closed = candle[‘x’] close = candle[‘c’] high = candle[‘h’] low = candle[‘l’] volume = candle[‘V’] if is_candle_closed: print("Candle closed at {}".format(close)) highs.append(float(high)) lows.append(float(low)) closes.append(float(close)) volumes.append(float(volume)) print(‘:’) if len(closes) > MFI_PERIOD: np_closes = numpy.array(closes) mfi = talib.MFI(highs, lows, np_closes, volumes, MFI_PERIOD) last_mfi = ..

Read more