I am trying to download historical price data of BTC/USD perpetual futures using binance's api for coin futures, specifically, I'd like to use this endpoint. However, I cannot find what 'symbol' I have to specify for BTC/USD. I've tried multiple variations to no avail (such as BTCUSD, BTCUSD_perpetual, etc. I constantly get the error: "Invalid symbol."
If anyone is interested, I found out that you can get a list of all symbols using: GET /dapi/v1/exchangeInfo. The BTC/USD perpetual futures one is: BTCUSD_PERP.
The solution above is for coin futures, so in case anyone needs it for the other futures like BTCUSDTPERP, what worked for me was changing to the futures function: client.futures_create_order(symbol=symbol, side=side, type=order_type, quantity=quantity) and using "BTCUSDT".
More info here https://python-binance.readthedocs.io/en/latest/binance.html
Related
So I created a new ASA (AKA: Algorand Standard Asset) and set the total amount of that asset to be maximum.
Here's a quick snippet of how I did it:
const UINT64_MAX: bigint = BigInt('18446744073709551615');
Now, When I check how many tokens asset creator has with Algorand's Daemon API
curl http://localhost:8980/v2/accounts/3IELQKOD...3C5IB3BP4V4A/assets
I get it exactly right as: 18446744073709551615
But when i check it with the indexer in the sdk its something different.
It shows total assets as "18446744073709552000" to be exact which is not true.
What am i doing wrong here or this is error in library?
you need to set your client to support big int or mixed.
as JS Only supports 2^^53
You can easily set it by setting IntDecoding method for all JSON requests created by client here.
I am trying to learn ML models for predicting stock prices and initially, I tried using DataReader
import pandas_datareader as web
df = web.DataReader('AAPL', data_source='yahoo', start='2016-01-01', end='2021-08-01')
But I get a RemoteDataError and kept hitting a dead end trying to figure it out so I tried using tiingo
https://tiingo-python.readthedocs.io/en/latest/readme.html
I read through the documentation and tried passing a dictionary with 'api_key' as a key
into my tiingo client, ie.
from tiingo import TiingoClient
client = TiingoClient()
config = {}
config['session'] = True
config['api_key'] = 'my_api_key'
client = TiingoClient(config)
The documentation says I can now use TiingoClient to make API calls, however,
RuntimeError: Tiingo API Key not provided. Please provide via environment variable or config argument.
It is quite challenging learning the ML models and its syntax but what compounds the difficulty for me is what some data-scientests consider to be trivial as they don't typically deal with gathering or scraping data. Maybe my question is trivial but I've spent about an hour trying to figure out how to import data properly for stock prices and the only method that worked for me so far is
df = web.get_data_yahoo('stock symbol')
but I would like to grasp the other ways of importing stock prices via Tiingo and DataReader so if anyone can provide explanations/tips/suggestions I'd greatly appreciate it.
EDIT: for my tiingo account I did not buy any subscription plan for using their data as I was under the impression I can access data for free with my api-key
This is what I use, but its identical to what you are using it seems.
config = {}
config['session'] = True
config['api_key'] = "key here"
client = TiingoClient(config)
Remove this line: TiingoClient()
I am using Bloomberg API C# library, version 3.8.10.1.
I am wondering, what is the rule for formatting/escaping fractions in symbol names?
Instruments service (//blp/instruments) returns symbols like RIOLN 3<3/4> 03/22/2022<corp>, however, querying reference service (//blp/refdata) or market data service (//blp/mktdata) with:
RIOLN 3¾ 06/15/2025 Corp, RIOLN 3<3/4> 06/15/2025 Corp, RIOLN 3 3/4 06/15/2025 Corp gets me Unknown/Invalid security [nid:810] error.
Namely, any modification of such symbol I can think of, gets me this error. Are there any rules for proper formatting of those symbol name fractions?
You can use the "ASCII" ticker: EJ101044 Corp.
You can find it on a terminal by loading the bond and typing FLDS PARSE.
Or you can use a different identifier (such as CUSIP or Bloomberg Unique ID).
I'm looking for a variable that can tell me which number 'won' the call on a multi-target Dial command.
Example:
Dial(SIP/1000&SIP/1001&SIP/1002,30)
Set(the_unlucky_winner=${...})
I'm not getting anything from the ${DIALEDPEERx} variables. Sounds like these vars are broken but I don't know if this is what I should be using.
Ancient version 1.2.14 deployed at this site. All clients are SIP
Thanks anyone
Only realistic way do that - cal via Local channle like freepbx do(check freepbx.org source) or use Macro on answer(i am afraid not work in 1.2)
Parse the contents of the CDR record for the file. One of the fields is dstchannel which will hold a value like SIP/1002-9786b0b0.
Also keep in mind that the call variable stack is wiped on hangup, unless you have an "h" (hangup) extension defined for the context. So, you can most easily handle your post-call processing there.
Further Reading:
http://www.asteriskdocs.org/en/3rd_Edition/asterisk-book-html-chunk/asterisk-SysAdmin-SECT-1.html
Please Note:
if this answer turns out to solve your problem, please "accept" it for the benefit of others trying to solve the same problem later
Hi all I have a solution to this problem. It is working fine for both normal dial and multi target dial.
In dialstring add a macro, here I am adding "followme" macro.
M(followme)
$agi->exec("dial", "SIP/6001#sip.example.com&SIP/6002#sip.example.com,rtTgM(followme)");
Then after call is answered it ll go to context
[macro-followme]
In this context you write one script to get the connected calls information by
$dstchannel=$agi->get_variable("DIALEDPEERNUMBER");
The way I managed to do it is as follows
Dial(SIP/1000&SIP/1001&SIP/1002,30,M(whoanswered))
[macro-whoanswered]
exten => s,1,NoOp(${CHANNEL})
You will see that the actual extension that answered is containes in ${CHANNEL}
If 1001 answered the channel will be something like SIP/1001-00017cf1
Just use the CUT command to cut it by / and -
I have a GSM/GPS unit connected to a Microcontroller, the communication between them works fine. I am able to get the GPS and send it to the Microcontroller but there are times when the unit is inside the building so I can't really get the current GPS location, instead I want to get the tower location.
The AT command I'm using to get the LAC and CI with response is as follows.
Command: AT+CREG=2
Response:
From this, LAC = 2BCB or 11211 and CI = 2B9A or 11162
The sim card I'm using is registered under T-Mobile, so the MCC = 310 and MNC = 260 by looking them up here. However when I plug those values on this website, I don't get the location.
What am I missing ?
I noticed when I try to check the current network with AT+COPS? I don't get the same results as shown here.
Am I suppose to manually set the network information ? If yes please someone provide me with the correct format. I tried sending At+COPS=4,2,”310 260″ but that threw me an error.
Here is the AT command document I am following, it has a different format. Thanks!
I figured it out, I just had to plug in the values in this website instead of the original website I was using.