I'm looking for python script which one will return Uniswap orderbook

  • Status: Closed
  • Prêmio: $20
  • Inscrições Recebidas: 17

Síntese do concurso

You can completed any of this two job. Job 1 or Job 2.

Job 1:

1. I’m looking for a python program which one will return Uniswap order book all coins one request. In order book should contain at 3 orders (price in USDT, order size local coin). This program should provide the updated data every 10 sec or real time update date.
2. The python dictionary should contain {side, price in USDT, Amount (local coin), total amount USDT}
3. If you need to create any account, I will provide an email and password you can create.



Reference doc:
https://app.uniswap.org/
https://uniswap-python.com/
https://pypi.org/project/uniswap-python/


Job 2:

"""
## you can copy this python code
## I need out put of my strategy.
#require package for collect historical data
pandas_ta
pandas
python-binance
"""
from pprint import pprint
import pandas as pd
import pandas_ta as ta
from binance.client import Client
client = Client('api_key', 'api_secret')

def exportData():

klines = client.get_historical_klines("LTCUSDT", Client.KLINE_INTERVAL_15MINUTE, "20 sep, 2022", "22 sep, 2023")
# print(klines)

time=[]
open= []
high = []
low=[]
close =[]
volume = []
for kandle in klines:
time.append(kandle[0])
open.append(kandle[1])
high.append(kandle[2])
low.append(kandle[3])
close.append(kandle[4])
volume.append(kandle[5])
klinesDic = {'time':time,'open':open,'high':high,'low':low,'close':close,'volume':volume}

klinesCsv = pd.DataFrame.from_dict(klinesDic)
klinesCsv= klinesCsv.set_index('time')
klinesCsv.to_csv("LTCUSDT15mYeaarly.csv")


##Make a data csv data file
#exportData()

## after export data read
data=pd.read_csv('LTCUSDT15mYeaarly.csv')
# here I converted timestamp to date time
data =data.set_index(pd.to_datetime(data['time'],unit='ms'))
# print(data.head())


################################################### add some indicators #########################

emaLen = 10
emaLen2 = 50
data["ema_"+str(emaLen)] = data['close'].ewm(span=emaLen, adjust=False).mean()
data["ema2_"+str(emaLen)] = data['close'].ewm(span=emaLen2, adjust=False).mean()
data.ta.rsi(length=14, append=True,col_names="rsi_14")

## Buy sell and close condition
long_conditon = "when ema cross over ema2"
short_condition = 'when ema cross under ema2'

long_close_conditon = "when rsi_14 > 80 or rsi_14 <30"
short_close_condition = "when rsi_14 < 20 or rsi_14 > 60"

## Now your work is execute my log short condition strategy and give the output, Below example. More: https://github.com/twopirllc/pandas-ta#custom
## If I will change the long short or close condition it will give me another output.

"""
{
total_long_trades: 15
total_short_trades: 45
total_win_trades =40
total_loss_trades =20
net_profit = 420$
profit_factor = 1.7
percentance_profitable = 66.66
}

"""

Habilidades Recomendadas

Principais inscrições deste concurso

Ver Mais Inscrições

Painel de Comentários

  • ZeeshanSEO83
    ZeeshanSEO83
    • 6 meses atrás

    Dear Abdul, Kindly check entry # 20. Thanks

    • 6 meses atrás
  • kreativesystem91
    kreativesystem91
    • 7 meses atrás

    Hello. Check my entry #10 I can do it right away

    • 7 meses atrás

Como começar com concursos

  • Publique seu concurso

    Publique seu Concurso Rápido e fácil

  • Receba muitas inscrições

    Obtenha Toneladas de Inscrições De todo o mundo

  • Premie a melhor inscrição

    Premie a melhor inscrição Baixe os arquivos, é fácil!

Poste um Concurso ou Junte-se a nós Hoje!