I have this code: def signalgenerator(df): if df is None or len(df) < 2: return ''…
Jump to turn (7)
- 1I have this code: def signalgenerator(df): if df is None or len(df) < 2: return
- 2Return this code, and give me code which will print me in [] order prices which
- 3Okay, return it , give me code which will only give me only bid and ask prices
- 4Okay, of those it need to analyze those prices and print me prices which higher
- 5And now leasten me , I need code which will count bid lowest prices which are no
- 6Time to time it giving me it : Higher Ask Prices: [228.86, 228.87, 228.88, 228.8
- 7I sued this code: #Main Signal if (((buyqty > th) > (sellqty mp + pth)): signal.
- User
I have this code:
def signal_generator(df): if df is None or len(df) < 2: return ''
codesignal = [] final_signal = [] exit = [] sell_result = 0.0 buy_result = 0.0 active_signal = None mark_price_data = client.ticker_price(symbol=symbol) mp = float(mark_price_data['price']) if 'price' in mark_price_data else 0.0 mark_price_data_change = client.ticker_24hr_price_change(symbol=symbol) mark_price_percent = float(mark_price_data_change['priceChangePercent']) if 'priceChangePercent' in mark_price_data_change else 0.0 # Retrieve depth data depth_data = client.depth(symbol=symbol) bids = depth_data['bids'] bid_prices = [float(bid[0]) for bid in bids] highest_bid_price = max(bid_prices) lowest_bid_price = min(bid_prices) b_h = highest_bid_price buy_lowest_price = lowest_bid_price b_l = buy_lowest_price asks = depth_data['asks'] ask_prices = [float(ask[0]) for ask in asks] highest_ask_price = max(ask_prices) lowest_ask_price = min(ask_prices) s_h = highest_ask_price s_l = lowest_ask_price buy_qty = round(sum(float(bid[1]) for bid in bids), 0) sell_qty = round(sum(float(ask[1]) for ask in asks), 0)