-
Notifications
You must be signed in to change notification settings - Fork 3
/
place_order_ftx.py
48 lines (37 loc) · 1.01 KB
/
place_order_ftx.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
from cgi import print_exception
import secrets
from symtable import Symbol
import ccxt
from git import AmbiguousObjectName
from more_itertools import side_effect
import plotly.express as px
import plotly.graph_objects as go
from datetime import datetime
import numpy as np
import pandas as pd
import time
import json
import streamlit as st
ftx = ccxt.ftx()
api_key = st.text_input("API Key")
secret = st.text_input("Secret")
exchange = ccxt.ftx({
'apiKey': api_key,
'secret': secret,
'subaccount': "h"
})
symbol = 'CVX-PERP'
side = 'buy'
amount = 1
price = 4.187
type = 'limit'
symbol = st.text_input('Enter symbol', value='CUSDT/USDT')
side = st.text_input('Enter side', value='buy')
amount = st.number_input('Enter amount', value=1)
price = st.number_input('Enter price', value=0.0208575)
type = st.text_input('Enter type', value='limit')
st.write(symbol,side,amount,price,type)
yes = st.checkbox('execute')
if yes:
order = exchange.create_order(symbol, type, side, amount, price)
st.write(order)