Help with pulling Index: Coin name price from deribit plugin

Posted By: degenerate_762

Help with pulling Index: Coin name price from deribit plugin - 02/05/22 08:30

Code
function run() 
{
	set(LOGFILE);
	BarPeriod = 15;
	asset("BTC");
	vars Prices = series(price());
}


Code
price 
Login 0 BinanceFutures..
!Connecting to wss://www.deribit.com/ws/api/v2/...
!Authorizing...
!8 BTC futures detected
!430 BTC options detected
!8 ETH futures detected
!484 ETH options detected
!Deribit BTC/USD index: 41467.21
!Deribit ETH/USD index: 3005.82
!Using kh762 main: kh762
!BTC balance: 0.0000000000 (0.00 USD)
!BTC equity: 0.0000000000 (0.00 USD)
!ETH balance: 0.0000000000 (0.00 USD)
!ETH equity: 0.0000000000 (0.00 USD) at UTC 02-05 08:25
Subscribe BTC
Error 053: BTC unavailable at this time
V 2.444 on Sat 22-02-05 09:25:09 (Zorro S Subscription)
Error 047: No bars generated
Logout.. ok


Code
Deribit has 4 types of symbols: Index, Perpetual Futures, Futures, and Options.

Index: Coin name, either "BTC" or "ETH".
Perpetual Futures: [Coin]-PERPETUAL, e.g. "ETH-PERPETUAL".
Futures: [Coin]-DDMMMYY, where MMM is a 3-letter capitalized string, e.g. "BTC-26MAR21".
Options: [Coin]-DDMMMYY-[Strike]-[P/C], e.g. "ETH-25JUN21-340-C".
For options and futures, the contract functions can be used with "BTC" or "ETH" as the underlying.


Could someone please bump me in the right direction?
Posted By: degenerate_762

Re: Help with pulling Index: Coin name price from deribit plugin - 02/05/22 09:22

I'm trying to pull the spot please
Posted By: AndrewAMD

Re: Help with pulling Index: Coin name price from deribit plugin - 02/05/22 13:30

Please share your asset list.
Posted By: degenerate_762

Re: Help with pulling Index: Coin name price from deribit plugin - 02/05/22 14:45

Code
Name	Price	Spread	RollLong	RollShort	PIP	PIPCost	MarginCost	Leverage	LotAmount	Commission	Symbol
BTC	57125	3.5	0	0	0.0001	0.0001	0	0	0.0001	0	BTC
BTC-PERPETUAL	57125	3.5	0	0	0.05	1.12E-05	2.23E-06	0	10	-0.25	BTC-PERPETUAL
BTC-26MAR21	57125	3.5	0	0	0.05	1.12E-05	2.23E-06	0	10	-0.25	BTC-26MAR21
ETH	1991	0.05	0	0	0.0001	0.0001	0	0	0.0001	0	ETH
ETH-PERPETUAL	1991	0.05	0	0	0.05	1.12E-06	4.47E-07	0	1	-0.25	ETH-PERPETUAL
ETH-26MAR21	1991	0.05	0	0	0.05	1.12E-06	4.47E-07	0	1	-0.25	ETH-26MAR21

Posted By: degenerate_762

Re: Help with pulling Index: Coin name price from deribit plugin - 02/05/22 15:11

@AndrewAMD. My AssetList is thesame as the one provided in the manual except that i have made additiion on the symbols in the last column. After making that adjustment, i'm now getting this error when trying to pull the spot/index price.

Code
Deribit 
Login 0 Deribit..
!Connecting to wss://www.deribit.com/ws/api/v2/...
!Authorizing...
!8 BTC futures detected
!430 BTC options detected
!8 ETH futures detected
!484 ETH options detected
!Deribit BTC/USD index: 41514.34
!Deribit ETH/USD index: 3019.97
!Using kh762 main: kh762
!BTC balance: 0.0000000000 (0.00 USD)
!BTC equity: 0.0000000000 (0.00 USD)
!ETH balance: 0.0000000000 (0.00 USD)
!ETH equity: 0.0000000000 (0.00 USD) at UTC 02-05 15:06 - BTC history unavailable!
V 2.444 on Sat 22-02-05 16:06:36 (Zorro S Subscription)
Error 047: No bars generated
Logout..
Posted By: AndrewAMD

Re: Help with pulling Index: Coin name price from deribit plugin - 02/05/22 15:12

Do you know for a fact that you're using this asset list?

After your asset("BTC"); call, add these lines:
Code
printf("\nSymbolTrade: %s",SymbolTrade);
printf("\nSymbolLive: %s",SymbolLive);
printf("\nSymbolHist: %s",SymbolHist);
Posted By: degenerate_762

Re: Help with pulling Index: Coin name price from deribit plugin - 02/05/22 15:23


Code
Deribit 
Login 0 Deribit..
!Connecting to wss://www.deribit.com/ws/api/v2/...
!Authorizing...
!8 BTC futures detected
!430 BTC options detected
!8 ETH futures detected
!484 ETH options detected
!Deribit BTC/USD index: 41712.35
!Deribit ETH/USD index: 3045.89
!Using kh762 main: kh762
!BTC balance: 0.0000000000 (0.00 USD)
!BTC equity: 0.0000000000 (0.00 USD)
!ETH balance: 0.0000000000 (0.00 USD)
!ETH equity: 0.0000000000 (0.00 USD) at UTC 02-05 15:19 - BTC history unavailable!
SymbolTrade: BTC
SymbolLive: BTC
SymbolHist: BTC
V 2.444 on Sat 22-02-05 16:19:56 (Zorro S Subscription)
!readloop_handler: The WebSocket stream was gracefully closed at both endpoints
!BrokerAccount: stopped
Error 047: No bars generated
Logout.. ok
Posted By: degenerate_762

Re: Help with pulling Index: Coin name price from deribit plugin - 02/05/22 15:31

@AndrewAMD.
Posted By: AndrewAMD

Re: Help with pulling Index: Coin name price from deribit plugin - 02/05/22 15:32

OK, so you fixed the plugin issue. My work here is done. cool

You can figure out the other stuff by setting Verbose to 7|DIAG and reading the log.
Posted By: degenerate_762

Re: Help with pulling Index: Coin name price from deribit plugin - 02/05/22 15:34

Thanks @AndrewAMD.
Posted By: turbodom

Re: Help with pulling Index: Coin name price from deribit plugin - 01/20/24 12:41

Hi. I'm trying to pull the index with coin "BTC" as well, but have same error. What was the issue with the plugin ? How did you solve it?
Posted By: turbodom

Re: Help with pulling Index: Coin name price from deribit plugin - 01/20/24 12:42

Hi. I'm trying to pull the index with coin "BTC" as well, but have same error. What was the issue with the plugin ? How did you solve it?
Posted By: degenerate_762

Re: Help with pulling Index: Coin name price from deribit plugin - 01/23/24 16:02

Hi @turbodom, when I was trying to pull the index with coin "BTC", my aim was to calculate the basis which is ****** basis = Spot - Future ******* . I think this is what you are also trying to do. I was however only able to pull the BTC-PERPETUAL (futures price) price using the zorro deribit plugin. The hack was to pull the spot price from another exchange for example binance or using the other plugins available. The implementation can be achieved by having a look through the manual with reference to the chapter "broker arbitrage".
Posted By: turbodom

Re: Help with pulling Index: Coin name price from deribit plugin - 02/18/24 13:52

Hi, thanks for the prompt answer. Okay got it, so Index still not working with Deribit plugin, but you managed to find another way. Yes for basis and other stuff. I'm curious what you do with the basis, do you trade cash and carry or use it as indicator ?
Posted By: degenerate_762

Re: Help with pulling Index: Coin name price from deribit plugin - 02/19/24 19:12

Hi @turbodom, I was trading cash and carry. I have also used it as an input to an indicator.
© 2024 lite-C Forums