I'm looking for python script which one will return Uniswap orderbook
- Status: Closed
- Præmier: $20
- Modtagne indlæg: 18


Konkurrence Instruktioner
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
}
"""
Anbefalede færdigheder
Bedste indlæg fra denne konkurrence
-
harinisbca2021 India
-
MHSmile Egypt
-
harinisbca2021 India
-
Danwealth Nigeria
-
Danwealth Nigeria
-
ZeeshanSEO83 Pakistan
-
Danwealth Nigeria
-
ikhan9985 Pakistan
-
hadisehsafari Turkey
-
hossainalif5 Bangladesh
-
MHSmile Egypt
-
Djmon007 India
-
farhankha4548 Pakistan
-
mustaphaliaichi Morocco
Offentlig Præciserings Opslagstavle
Sådan kommer du i gang med konkurrencer
-
Opret din konkurrence Hurtigt og nemt
-
Få tonsvis af indlæg Fra hele verden
-
Tildel det bedste indlæg Download filerne - Nemt!