Pulling Data through the Kraken Plugin

Posted By: loopiezlol

Pulling Data through the Kraken Plugin - 03/06/22 08:17

Hey,

I previously used both the Binance and Coinbase plugins to fetch both M1 and EOD data directly through Zorro.

However, I'm having issues doing the same through the Kraken one which I plan to use due to its support for SET_LEVERAGE.

I'm wondering what I'm doing wrong with this script:

Code
function main() 
{
	
	
	StartDate = 2021;
	EndDate = 2022;
	Verbose = 7|DIAG;

	assetHistory("ETH/USD",1);
	
}


getting the following output

Code

DownloadKraken compiling........... ok
!Kraken Plugin, version: 1.0.1.3
!Logging in...
!Loading Kraken asset info...
!Loading Kraken tradable pair info...
!REST server status: online
!Getting currency balances...
!Getting websocket token...
!Websocket connected to wss://ws.kraken.com/
!Websocket connected to wss://ws-auth.kraken.com/
!Kraken server version: 1.8.8, status: online
!Kraken server version: 1.8.8, status: online at UTC 03-06 08:13
!ETH/USD 03-06 08:11:00 to 03-06 08:13:38 failed
!ETH/USD 03-06 08:11:00 to 03-06 08:12:38 failed.
!ETH/USD 01-01 00:00:00 to 12-31 23:59:59 failed
!ETH/USD 01-01 00:00:00 to 12-31 23:58:59 failed
!ETH/USD 01-01 00:00:00 to 12-31 23:57:59 failed
!ETH/USD 01-01 00:00:00 to 12-31 23:56:59 failed
!ETH/USD 01-01 00:00:00 to 12-31 23:55:59 failed
!ETH/USD 01-01 00:00:00 to 12-31 23:54:59 failed
!ETH/USD 01-01 00:00:00 to 12-31 23:53:59 failed - ETH/USD history unavailable!
Error 056: Can't download ETH/USD 2021 history
Logout..
!Logging out... ok



using the assets given in the manual:

Code
Name,Price,Spread,RollLong,RollShort,PIP,PIPCost,MarginCost,Leverage,LotAmount,Commission,Symbol
BCH/ETH,0.53794,0.0001,0,0,0.0001,0.0001,0,1,0.00001,-0.25,
ETH/USD,450.2,0.01,0,0,0.01,0.01,0,1,0.00001,-0.25,
ETH/XBT,0.0292241,0.00001,0,0,0.00001,0.00001,0,1,0.00001,-0.25,
LTC/ETH,0.13093,0.00001,0,0,0.00001,0.00001,0,1,0.00001,-0.25,
LTC/USD,179,0.01,0,0,0.01,0.01,0,1,0.00001,-0.25,
LTC/XBT,0.003834,0.000001,0,0,0.000001,0.000001,0,1,0.00001,-0.25,
XBT/USD,44785.8,3.3,0,0,0.01,0.01,0,1,0.00001,-0.25,



Any thoughts on what went wrong?
Posted By: Grant

Re: Pulling Data through the Kraken Plugin - 03/06/22 23:34

You left all symbols blank in your asset list.
Posted By: loopiezlol

Re: Pulling Data through the Kraken Plugin - 03/07/22 07:52

Hey Grant, thanks for the heads up, but I don't think that's it.

I believe the symbol defaults to the name when it's missing. Either way, I explicitely set the symbol too, but still getting errors.

[Linked Image]

To me it seems that the internal pagination logic of the plugin may be broken, as seen in the log.
Posted By: Grant

Re: Pulling Data through the Kraken Plugin - 03/07/22 12:30

I don't use Kraken myself, so that was just a wild guess of mine.

I think this "too many requests" message is the bottleneck. There's prob a limit on the number of data queries, which is pretty common for most sources.
Posted By: loopiezlol

Re: Pulling Data through the Kraken Plugin - 04/03/22 12:03

makes sense. this is also specified in the manual

> Rate upper limit. Kraken has a strange and complex rate limiting policy. To avoid bans, SET_DELAY was preconfigured to sufficiently slow responses. SET_DELAY affects all REST requests, but no open websocket streams.

was wondering if anyone knows a reliable way to circumvent this - maybe a value to use with SET_DELAY
Posted By: loopiezlol

Re: Pulling Data through the Kraken Plugin - 04/03/22 12:16

In their docs, Kraken mentions that a 1s delay may be too much, so I tried increasing that using the SET_DELAY broker command. yet, that doesn't seem to help much as "too many requests" is still hit

> Calling the public endpoints at a frequency of 1 per second (or less) would remain within the rate limits, but exceeding this frequency could cause the calls to be rate limited. If the rate limits are reached, additional calls would be restricted for a few seconds (or possibly longer if calls continue to be made while the rate limits are active).

Code

function run() 
{
	set(PLOTNOW,LOGFILE);
	BarPeriod = 1;
	
	StartDate = 20220101;
	
	brokerCommand(SET_DELAY, 10000);
	
	asset("ETH/USD");
	
	if (is(INITRUN)) {
		assetHistory("ETH/USD", 1+OVERRIDE);
	}


}


© 2024 lite-C Forums