You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I really appreciate your open-source project; it has enabled me to efficiently execute many API trades and backtests. I wanted to ask if there's a way to conduct perpetual contract trading. Currently, I noticed that it only supports spot trading."
`from keys import API_KEY, SECRET_KEY
from binance.um_futures import UMFutures as Client
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I really appreciate your open-source project; it has enabled me to efficiently execute many API trades and backtests. I wanted to ask if there's a way to conduct perpetual contract trading. Currently, I noticed that it only supports spot trading."
`from keys import API_KEY, SECRET_KEY
from binance.um_futures import UMFutures as Client
client = Client(key = API_KEY, secret = SECRET_KEY)
response = client.new_order(
symbol="ETHUSDT",
side="BUY",
# type='LIMIT',
positionSide='LONG',
type="MARKET",
quantity=0.01,
)
response_sl = client.new_order(
symbol="ETHUSDT",
side="SELL",
positionSide='SHORT',
type="STOP_MARKET",
quantity=0.01,
stopPrice=2500,
workingType='MARK_PRICE',
)
response_tp = client.new_order(
symbol="ETHUSDT",
side="SELL",
positionSide='SHORT',
type="TAKE_PROFIT_MARKET",
quantity=0.01,
stopPrice=3100,
workingType='MARK_PRICE',
)
print(1)
`
like using the code above?
Beta Was this translation helpful? Give feedback.
All reactions