Kraken Plugin Issues

Posted By: Arkom

Kraken Plugin Issues - 09/14/21 04:34

Hello,

When using the new Kraken Plugin, I am having trouble with trading on a 1-Day BarPeriod. I keep getting error below after a certain amount of time. This was an attempt with BarPeriod = 30, but I tried the other BarPeriods I show further down.

Code
[507: Sun 21-09-12 22:00w] 45198.10/45198.40\45190.60/45191.80 -0.10
Exit  XBT/USD  0
[XBT/USD::S] Skipped (frame)
!PUBLIC: readloop_handler: stream truncated
!BrokerAsset: stopped.
!XBT/USD: 45191.80000 0.10000 1
!XBT/USD: 45191.80000 0.10000 1
!PUBLIC: readloop_handler: stream truncated
!BrokerAsset: stopped
!XBT/USD: 45191.80000 0.10000 1
!XBT/USD: 45191.80000 0.10000 1
!PUBLIC: readloop_handler: stream truncated
!BrokerAsset: stopped
!BrokerAsset: stopped

[508: Sun 21-09-12 22:30wf] 45191.80/45191.80\45191.80/45191.80 -0.10
Exit  XBT/USD  0
[XBT/USD::S] Skipped (frame)
!XBT/USD: 45191.80000 0.10000 1
!XBT/USD: 45191.80000 0.10000 1
!PUBLIC: readloop_handler: stream truncated
!BrokerAsset: stopped
!XBT/USD: 45191.80000 0.10000 1
!XBT/USD: 45191.80000 0.10000 1
!PUBLIC: readloop_handler: stream truncated
!BrokerAsset: stopped
!XBT/USD: 45191.80000 0.10000 1
!XBT/USD: 45191.80000 0.10000 1
!PUBLIC: readloop_handler: stream truncated
!BrokerAsset: stopped
!XBT/USD: 45191.80000 0.10000 1
!XBT/USD: 45191.80000 0.10000 1
!PUBLIC: readloop_handler: stream truncated
!BrokerAsset: stopped
!XBT/USD: 45191.80000 0.10000 1
!XBT/USD: 45191.80000 0.10000 1
!PUBLIC: readloop_handler: stream truncated
!BrokerAsset: stopped
!XBT/USD: 45191.80000 0.10000 1
!XBT/USD: 45191.80000 0.10000 1
!PUBLIC: readloop_handler: stream truncated
!BrokerAsset: stopped
!BrokerAsset: stopped

[509: Sun 21-09-12 23:00f] 45191.80/45191.80\45191.80/45191.80 -0.10
Exit  XBT/USD  0
[XBT/USD::S] Skipped (frame).
!XBT/USD: 45191.80000 0.10000 1
!XBT/USD: 45191.80000 0.10000 1
!PUBLIC: readloop_handler: stream truncated
!BrokerAsset: stopped
!XBT/USD: 45191.80000 0.10000 1
!XBT/USD: 45191.80000 0.10000 1
!PUBLIC: readloop_handler: stream truncated
!BrokerAsset: stopped
!XBT/USD: 45191.80000 0.10000 1
!XBT/USD: 45191.80000 0.10000 1
!PUBLIC: readloop_handler: stream truncated
!BrokerAsset: stopped
!XBT/USD: 45191.80000 0.10000 1
!XBT/USD: 45191.80000 0.10000 1
!PUBLIC: readloop_handler: stream truncated
!BrokerAsset: stopped
!XBT/USD: 45191.80000 0.10000 1
!XBT/USD: 45191.80000 0.10000 1
!PUBLIC: readloop_handler: stream truncated
!BrokerAsset: stopped
!XBT/USD: 45191.80000 0.10000 1
!XBT/USD: 45191.80000 0.10000 1
!PUBLIC: readloop_handler: stream truncated
!BrokerAsset: stopped
!BrokerAsset: stopped

[510: Sun 21-09-12 23:30f] 45191.80/45191.80\45191.80/45191.80 -0.10
Exit  XBT/USD  0
[XBT/USD::S] Skipped (frame)
!XBT/USD: 45191.80000 0.10000 1
!XBT/USD: 45191.80000 0.10000 1
!PUBLIC: readloop_handler: stream truncated
!BrokerAsset: stopped
!XBT/USD: 45191.80000 0.10000 1
!XBT/USD: 45191.80000 0.10000 1
!PUBLIC: readloop_handler: stream truncated
!BrokerAsset: stopped.
!XBT/USD: 45191.80000 0.10000 1
!XBT/USD: 45191.80000 0.10000 1
!PUBLIC: readloop_handler: stream truncated
!BrokerAsset: stopped
!XBT/USD: 45191.80000 0.10000 1
!XBT/USD: 45191.80000 0.10000 1
!PUBLIC: readloop_handler: stream truncated
!BrokerAsset: stopped


Things I have tried is setting the TickTime to be 5-10 secs like suggested (maybe I did this wrong). I tried it with a BarPeriod reduced to 1-hour and set TimeFrame = 24. This didn't work either as the text above is a result of this test. The strategy I am building uses 1-Day Candles especially for some of the indicators I use. The code below shows the settings I put for operating in a 24-7 timeframe.

Code
        //Tried this first after BarPeriod by itself failed.
	BarPeriod = 1440;
	set(TICKS);
	TickTime = 5000;	
	
	//Tried this for other attempt
	BarPeriod = 60;
	TimeFrame = frameSync(24);
	
	//Other Settings
	StartMarket = EndMarket = 0;	
	Outlier = 0; 	
	resf(BarMode, BR_WEEKEND+BR_MARKET);		
	setf(BarMode, BR_FLAT);


It is almost like it disconnects/gets stuck in a weird request loop where it stops getting data from Kraken API. My question is am I doing something incorrect with properly setting up Kraken Plugin to operate in a 24-7 environment with BarPeriod = 1440?
Posted By: AndrewAMD

Re: Kraken Plugin Issues - 09/14/21 13:36

Kraken is a websocket-based plugin. This means you **must** have a lower TickTime!

Change TickTime to 250. Also, make sure you're using the latest Zorro version, which has the latest Kraken plugin (version 1.0.1.2). You can verify this by checking the DLL properties in Windows Explorer.
Posted By: Arkom

Re: Kraken Plugin Issues - 09/25/21 23:38

So after a good weeks worth of testing and messing with the TickTime like suggested, I am still getting a lot of these messages.

Code
!Getting websocket token...
!PRIVATE: readloop_handler: stream truncated
!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
!PRIVATE: readloop_handler: stream truncated
!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
!PRIVATE: readloop_handler: stream truncated
!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

[365: Fri 21-09-24 15:40] 44165.60/45165.30\40766.90/41827.80 -11.40
Exit  XBT/USD  0
!PUBLIC: readloop_handler: stream truncated
!PUBLIC: readloop_handler: stream truncated
!PUBLIC: readloop_handler: stream truncated
!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
!PRIVATE: readloop_handler: stream truncated
!PUBLIC: readloop_handler: stream truncated
[366: Sat 21-09-25 15:40w] 41827.70/43200.00\41659.50/42668.20 -0.10
Exit  XBT/USD  0


It seems like it still disconnects and has trouble, I am not sure if this could potentially put the Zorro in a bad state or miss a trade. I changed the TickTime to what you suggested and then reduced it even more testing it further. Repeated this up to TickTime = 100.
© 2024 lite-C Forums