Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by howardR. 04/28/24 09:55
basik85278
by basik85278. 04/28/24 08:56
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (alibaba, howardR, basik85278), 756 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Help with pulling Index: Coin name price from deribit plugin #485221
02/05/22 08:30
02/05/22 08:30
Joined: Jul 2021
Posts: 51
D
degenerate_762 Offline OP
Junior Member
degenerate_762  Offline OP
Junior Member
D

Joined: Jul 2021
Posts: 51
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?

Re: Help with pulling Index: Coin name price from deribit plugin [Re: degenerate_762] #485223
02/05/22 09:22
02/05/22 09:22
Joined: Jul 2021
Posts: 51
D
degenerate_762 Offline OP
Junior Member
degenerate_762  Offline OP
Junior Member
D

Joined: Jul 2021
Posts: 51
I'm trying to pull the spot please

Re: Help with pulling Index: Coin name price from deribit plugin [Re: degenerate_762] #485225
02/05/22 13:30
02/05/22 13:30
Joined: Feb 2017
Posts: 1,725
Chicago
AndrewAMD Offline
Serious User
AndrewAMD  Offline
Serious User

Joined: Feb 2017
Posts: 1,725
Chicago
Please share your asset list.

Re: Help with pulling Index: Coin name price from deribit plugin [Re: degenerate_762] #485227
02/05/22 14:45
02/05/22 14:45
Joined: Jul 2021
Posts: 51
D
degenerate_762 Offline OP
Junior Member
degenerate_762  Offline OP
Junior Member
D

Joined: Jul 2021
Posts: 51
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


Re: Help with pulling Index: Coin name price from deribit plugin [Re: AndrewAMD] #485228
02/05/22 15:11
02/05/22 15:11
Joined: Jul 2021
Posts: 51
D
degenerate_762 Offline OP
Junior Member
degenerate_762  Offline OP
Junior Member
D

Joined: Jul 2021
Posts: 51
@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..

Re: Help with pulling Index: Coin name price from deribit plugin [Re: degenerate_762] #485229
02/05/22 15:12
02/05/22 15:12
Joined: Feb 2017
Posts: 1,725
Chicago
AndrewAMD Offline
Serious User
AndrewAMD  Offline
Serious User

Joined: Feb 2017
Posts: 1,725
Chicago
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);

Re: Help with pulling Index: Coin name price from deribit plugin [Re: AndrewAMD] #485230
02/05/22 15:23
02/05/22 15:23
Joined: Jul 2021
Posts: 51
D
degenerate_762 Offline OP
Junior Member
degenerate_762  Offline OP
Junior Member
D

Joined: Jul 2021
Posts: 51

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

Re: Help with pulling Index: Coin name price from deribit plugin [Re: AndrewAMD] #485231
02/05/22 15:31
02/05/22 15:31
Joined: Jul 2021
Posts: 51
D
degenerate_762 Offline OP
Junior Member
degenerate_762  Offline OP
Junior Member
D

Joined: Jul 2021
Posts: 51
@AndrewAMD.

Last edited by degenerate_762; 02/11/22 09:01.
Re: Help with pulling Index: Coin name price from deribit plugin [Re: degenerate_762] #485232
02/05/22 15:32
02/05/22 15:32
Joined: Feb 2017
Posts: 1,725
Chicago
AndrewAMD Offline
Serious User
AndrewAMD  Offline
Serious User

Joined: Feb 2017
Posts: 1,725
Chicago
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.

Re: Help with pulling Index: Coin name price from deribit plugin [Re: AndrewAMD] #485233
02/05/22 15:34
02/05/22 15:34
Joined: Jul 2021
Posts: 51
D
degenerate_762 Offline OP
Junior Member
degenerate_762  Offline OP
Junior Member
D

Joined: Jul 2021
Posts: 51
Thanks @AndrewAMD.

Re: Help with pulling Index: Coin name price from deribit plugin [Re: degenerate_762] #488106
01/20/24 12:41
01/20/24 12:41
Joined: Feb 2016
Posts: 5
Stuttgart
turbodom Offline
Newbie
turbodom  Offline
Newbie

Joined: Feb 2016
Posts: 5
Stuttgart
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?

Re: Help with pulling Index: Coin name price from deribit plugin [Re: degenerate_762] #488107
01/20/24 12:42
01/20/24 12:42
Joined: Feb 2016
Posts: 5
Stuttgart
turbodom Offline
Newbie
turbodom  Offline
Newbie

Joined: Feb 2016
Posts: 5
Stuttgart
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?

Re: Help with pulling Index: Coin name price from deribit plugin [Re: turbodom] #488110
01/23/24 16:02
01/23/24 16:02
Joined: Jul 2021
Posts: 51
D
degenerate_762 Offline OP
Junior Member
degenerate_762  Offline OP
Junior Member
D

Joined: Jul 2021
Posts: 51
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".

Re: Help with pulling Index: Coin name price from deribit plugin [Re: degenerate_762] #488140
02/18/24 13:52
02/18/24 13:52
Joined: Feb 2016
Posts: 5
Stuttgart
turbodom Offline
Newbie
turbodom  Offline
Newbie

Joined: Feb 2016
Posts: 5
Stuttgart
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 ?

Last edited by turbodom; 02/18/24 14:07.
Re: Help with pulling Index: Coin name price from deribit plugin [Re: degenerate_762] #488141
02/19/24 19:12
02/19/24 19:12
Joined: Jul 2021
Posts: 51
D
degenerate_762 Offline OP
Junior Member
degenerate_762  Offline OP
Junior Member
D

Joined: Jul 2021
Posts: 51
Hi @turbodom, I was trading cash and carry. I have also used it as an input to an indicator.

Page 1 of 2 1 2

Moderated by  Petra 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1