kandi X-RAY | ftx Summary
kandi X-RAY | ftx Summary
ftx
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- find price and size
- Place a conditional order .
- Reads the contents of the root account
- collects all payments
- Find the first order in a list of orders .
- Get funding payments .
- Pretty print a dictionary .
- Exit the market .
- Enter a market .
- Calculate difference between spot and prep .
ftx Key Features
ftx Examples and Code Snippets
Community Discussions
Trending Discussions on ftx
QUESTION
I am running a program that makes the same API call, for each row in a dataframe. Since it is taking quite a long time I decided to try to learn and implement an async version with asyincio.
I'd split the dataframe in "N" (3 in this case) smaller dataframes, and for each one of those I'd create a coroutine that would be gathered and awaited by the main routine.
Here's what I've tried:
...ANSWER
Answered 2022-Jan-12 at 13:33So, aparently I needed to execute the blocking function async get_next_funding(df) as a SYNC function inside a loop.run_in_executor() since the blocking fcn was not a async type.
Thank @gold_cy for the answer!
There's the modified code:
QUESTION
I found this script on tradingview.com when they announced "Our new alerts allow for dynamic messages." The script is supposed to trigger an alert when RSI is overbought or oversold. The problem is it does not work as intended. The alert is triggered by the RSI for which symbol you added. It appears to select at random the symbols in the symbol list at the bottom of the script. The RSI data along with the script is also Incorrect as it is sending the RSI of the symbol you originally added the study to, not the RSI of the symbol list.
Here's the alert text to show nn example of the error:
"NASDAQ:AMD, 1: RSI (50.5282994084) crossing up 70 level" alert() with multiple symbols: any (alert) function call Active NASDAQ:AMD, 1m" This doesn't make sense since the RSI of AMD did not cross over 70 at the time the alert was triggered and it shows the RSI was 50, but it wasn't even 50 at the time of the alert it was under 30.
I tried moving the "_r = rsi (close, 7)" under the "[_co, _cu]..." line, but it did not work. I also tried to convert the data to strings to see if that did anything, but it didn't work. I tried converting to Pine Script v5. Also tried different symbols and crypto. Does anyone know if this function of applying an indicator/study to multiple symbols at the same time actually works? Or, perhaps I'm missing something and it's not working because of something I'm doing wrong.
Screenshot: enter image description here
Alert Log from TradingView: |Alert ID|Ticker|Name|Description|Time| |--- |--- |--- |--- |--- | |358732201|"NASDAQ:TSLA, 1m"|alert() with multiple symbols: Any alert() function call,"|=""session"":""extended"",""symbol"":""NASDAQ:TSLA""}, 1: RSI (72.6465706327) crossing up 70 level"|2021-12-23T14:49:00.000Z| |358732201,|"NASDAQ:TSLA, 1m",|alert() with multiple symbols: Any alert() function call,|"NASDAQ:CFVI, 1: RSI (72.6465706327) crossing down 30 level",|2021-12-23T14:49:00.000Z| |358732201,|"NASDAQ:TSLA, 1m",|alert() with multiple symbols: Any alert() function call,|"NASDAQ:TSLA, 1: RSI (72.6465706327) crossing up 70 level",|2021-12-23T14:49:00.000Z| |358732201|"NASDAQ:TSLA, 1m",|alert() with multiple symbols: Any alert() function call,|"BINANCE:SOLUSDT, 1: RSI (72.6465706327) crossing down 30 level",|2021-12-23T14:49:00.000Z| |358732201,|"NASDAQ:TSLA, 1m",|alert() with multiple symbols: Any alert() function call,|"COINBASE:BTCUSD, 1: RSI (69.6339491527) crossing down 30 level",|2021-12-23T14:48:00.000Z| |358732201,|"NASDAQ:TSLA, 1m",|alert() with multiple symbols: Any alert() function call,|"NYSE:PLTR, 1: RSI (69.6339491527) crossing up 70 level",|2021-12-23T14:48:00.000Z| |358732201,|"NASDAQ:TSLA, 1m",|alert() with multiple symbols: Any alert() function call,|"COINBASE:BTCUSD, 1: RSI (46.7458265403) crossing down 30 level",|2021-12-23T14:47:00.000Z| |358732201,|"NASDAQ:TSLA, 1m",|alert() with multiple symbols: Any alert() function call,|"FTX:RAYUSD, 1: RSI (46.7458265403) crossing down 30 level",|2021-12-23T14:47:00.000Z| |358732201,|"NASDAQ:TSLA, 1m",|alert() with multiple symbols: Any alert() function call,|"BINANCE:ICPUSDT, 1: RSI (44.0606617081) crossing up 70 level",|2021-12-23T14:46:00.000Z| |358732201,|"NASDAQ:TSLA, 1m",|alert() with multiple symbols: Any alert() function call,|"COINBASE:ETHUSD, 1: RSI (44.0606617081) crossing down 30 level",|2021-12-23T14:46:00.000Z| |358732201,|"NASDAQ:TSLA, 1m",|alert() with multiple symbols: Any alert() function call,|"FTX:ATLASUSD, 1: RSI (44.0606617081) crossing down 30 level",|2021-12-23T14:46:00.000Z|
The script I'm referencing is: https://www.tradingview.com/blog/en/our-new-alerts-allow-for-dynamic-messages-22588/
...ANSWER
Answered 2021-Dec-24 at 15:45In case anyone else was having the same issue and not knowledgeable enough with Pine Script (yet) to fix it themselves (such as myself), I am posting the solution. I received a reply back from TradingView support. They have been super helpful, kind and gave the updated script. They said the blog post with the error will be updated soon.
Here is the updated Pine Script for multiple symbols:
QUESTION
from requests import Request as R
markets = R("GET", "https://ftx.com/api/markets")
print(markets.json())
...ANSWER
Answered 2022-Feb-24 at 00:41Request
is just the object that represents the request. You want requests.request
to construct and make the request.
QUESTION
I am trying to convert the X/Y coordinates from the ^FO command to the equivalent ^FT coordinates in such a way that the position of text in the label does not change for rotated text.
The solution that I am looking for was already addressed partially in a question that I previously asked [link added here] (Is it possible to find equivalent X/Y coordinates in order to print some text at the same position using both ^FO as well as ^FT command using ZPL 2)
I am able to find some equations for different rotations (as stated below for font 0) but I am unsure about the exact formula to be used for converting corresponding Y coordinate for 270 rotation or equivalently X coordinate for 180 rotation:
For 0 rotation: FOx = FTx and FOy = FTy - (0.75 * height)
For 90 rotation: FOx = FTx - (0.25 * height) and FOy = FTy
For 180 rotation: FOx = Not found yet and FOy = FTy - (height * 0.25)
For 270 rotation: FOx = FTx - (height * 0.75) and FOy = Not yet found
I guess those missing equations depend on the number of characters in the text to be printed as well as the width of the text but I am not able to find the exact equation.
Any thoughts or suggestions on the finding the same would be greatly appreciated.
...ANSWER
Answered 2022-Feb-16 at 11:16The calculation for FOx (180 rotation) would be: FOx = FTx - text length
and for FOy (270 rotation) would be: FOy = FTy - text length
Text length for non-monospaced font (font 0) is difficult to calculate since width will vary for different characters. For monospaced font, the length of text in dots would be calculated for different fonts as per Table 26 (Page #: 1413) in the ZPL Programming guide.
Another useful answer on how to calculate length is answered below: How to Calculate Zebra Font 0 text width?
QUESTION
I'm scraping website and come to the part where to put it in Dataframe. I tried to follow this answer but no expected output.
Here's my whole code
...ANSWER
Answered 2022-Feb-11 at 03:13Some how coin_name is twice as long as your other lists. Once you fix that you can do this:
QUESTION
I want to convert every row form the historical['startTime'] column to dates but it is showing an error.
What am I doing wrong?
...ANSWER
Answered 2022-Jan-27 at 17:53you are getting startTime
in string, so lets first convert that to datetime objects.
QUESTION
import requests
import pandas as pd
import pandas_ta as ta
def stochFourMonitor():
k_period = 14
d_period = 3
data = get_data('BTC-PERP',14400,1642935495,1643165895)
print(data)
data = data['result']
df = pd.DataFrame(data)
df['trailingHigh'] = df['high'].rolling(k_period).max()
df['trailingLow'] = df['low'].rolling(k_period).min()
df['%K'] = (df['close'] - df['trailingLow']) * 100 / (df['trailingHigh'] - df['trailingLow'])
df['%D'] = df['%K'].rolling(d_period).mean()
df.index.name = 'test'
df.set_index(pd.DatetimeIndex(df["startTime"]), inplace=True)
print(df)
df.drop(columns=['startTime'])
print(df)
df.ta.stoch(high='High', low='Low',close= 'Close', k=14, d=3, append=True)
#t = ta.stoch(close='close',high='high', low='low', k=14, d=3, append=True)
#df.ta.stoch(close='close',high='high', low='low', k=14, d=3, append=True)
def get_data(marketName,resolution,start_time,end_time):
data = requests.get('https://ftx.com/api/markets/' + marketName + '/candles?resolution=' + str(resolution) + '&start_time=' + str(start_time) + '&end_time=' + str(end_time)).json()
return data
...ANSWER
Answered 2022-Jan-26 at 03:37You have to few values in your dataframe. You need at least 17 values (k=14, d=3)
QUESTION
I want to change my account leverage on FTX with there rest API. Just for a test because after that I want to post an order. But I cant get both of them working and for some reason I cant figure out how to do it.
So far I am able to do a get request and the authentication for it. This is the code I use for such an get request WITH authentication. I use PHP to do it and use Javascript to fetch the php file.
...ANSWER
Answered 2022-Jan-21 at 07:10I figured out how to do it. It had to do with the $parameters
and @signature
. When doing a POST request you need to json_encode()
the parameters and then use it in the $signature
. See $specialParam
. Below code makes it possible to chance leverage.
QUESTION
I have a SQL Server Table where I have a Column that contains a unique ID. I also have another column called Level, every time a new occurrence of a unique ID enters the table the Level will increase.
...ANSWER
Answered 2022-Jan-05 at 10:25You can calculate a row_number based on the ID and the level.
Then remove the dups based on the row_number.
QUESTION
I'm trying to write a program that will read a JSON file and take the information I need from it. In my JSON file there is a parameter: 'exchangeId'
which outputs the exchange number. I would like to make sure that only those exchanges that I set, or rather their 'exchangeId'
, are recorded in my dictionary, and if coin don't have any 'exchangeId'
at the list this coin don't wanna save as JSON file. How can I do this?
My code:
...ANSWER
Answered 2021-Dec-07 at 19:55exchanges = [102,311,200,302,521,433,482,406,42,400]
for pair in json_data["marketPairs"]:
#Condition like Ronald Das Mentioned
if pair["exchangeId"] in exchanges:
pairs.append({
"exchange_name": pair["exchangeName"],
"market_url": pair["marketUrl"],
"price": pair["price"],
"last_update" : pair["lastUpdated"],
"exchange_id": pair["exchangeId"] #That ids what I'm would to have 102,311,200,302,521,433,482,406,42,400
})
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install ftx
You can use ftx like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page