Topics
Replies
jaredthirsk
22 Oct 2016, 00:39
By the way, if anyone is interested in following my development, and possibly helping one another, you can see my open source code (MIT license) here:
https://github.com/LionFire/Trading
@jaredthirsk
jaredthirsk
22 Oct 2016, 00:32
RE: RE: RE: UPDATE:
jaredthirsk said:
Ok I figured out how to regenerate protobuf C#:
- Clone https://github.com/jskeet/protobuf-csharp-port
- Run build\BuildAll.bat (I had some errors about missing .NET Compact Framework, or something, but I ignored it.)
- Go to directory containing the 4 *.proto files from spotware
- Run this: c:\path\to\protobuf-csharp-port\build_output\tools\protogen --protoc_dir=c:\path\to\protobuf-csharp-port\build_output\tools OpenApiMessages.proto OpenApiModelMessages.proto CommonModelMessages.proto CommonMessages.proto
I wish I could edit my post. I also realized I needed to add -namespace=OpenApiLib to the command in #4.
@jaredthirsk
jaredthirsk
21 Oct 2016, 22:11
RE: RE: RE: UPDATE:
jaredthirsk said:
Note: current version of .proto files has two errors (missing ProtoOATrendbarPeriod and ProtoOATrendbar).
My quick interim fix - add this to OpenApiModelMessages.proto: (this is a guess based on the web docs. The docs don't contain field numbers so I have to guess.)
enum ProtoOATrendbarPeriod { M1 = 1; M2 = 2; M3 = 3; M4 = 4; M5 = 5; M10 = 6; M15 = 7; M30 = 8; H1 = 9; H4 = 10; H12 = 11; D1 = 12; W1 = 13; MN1 = 14; } message ProtoOATrendbar { optional double open = 1; optional double close = 2; optional double high = 3; optional double low = 4; required int64 volume = 5; optional int64 utcTimestamp = 6; optional ProtoOATrendbarPeriod period = 7; }
Either add this to CommonModelMessages.proto inside ProtoPayloadType (untested), or comment out PROTO_MESSAGE related code from the C# samples:
PROTO_MESSAGE = 5;
I don't know how to generate OpenApiMessagesFactory.cs, so I made this change:
public ProtoMessage CreateSubscribeForSpotsRequest(long accountId, string accessToken, string symbolName, string clientMsgId = null, List<ProtoOATrendbarPeriod> periods = null) { var _msg = ProtoOASubscribeForSpotsReq.CreateBuilder(); _msg.SetAccountId(accountId); _msg.SetAccessToken(accessToken); _msg.SetSymblolName(symbolName); if (periods != null) { foreach (var period in periods) { _msg.AddTrendbarPeriod(period); } } return CreateMessage((uint)_msg.PayloadType, _msg.Build().ToByteString(), clientMsgId); }
I can subscribe to one or more trendbar periods, and I see the data being sent, but I am not receiving any trendbars from the server. Any help would be appreciated.
@jaredthirsk
jaredthirsk
21 Oct 2016, 20:46
RE: RE: UPDATE:
jaredthirsk said:
Now I have to figure out how to regenerate C# bindings -- the instructions in the readme here seem to be out of date because the file gen_csharp_src.bat doesn't appear to exist anywhere:
https://github.com/spotware/connect-csharp-samples
Ok I figured out how to regenerate protobuf C#:
- Clone https://github.com/jskeet/protobuf-csharp-port
- Run build\BuildAll.bat (I had some errors about missing .NET Compact Framework, or something, but I ignored it.)
- Go to directory containing the 4 *.proto files from spotware
- Run this: c:\path\to\protobuf-csharp-port\build_output\tools\protogen --protoc_dir=c:\path\to\protobuf-csharp-port\build_output\tools OpenApiMessages.proto OpenApiModelMessages.proto CommonModelMessages.proto CommonMessages.proto
It will generate 4 .cs files. Include all 4 in a C# DLL project.
Note: current version of .proto files has two errors (missing ProtoOATrendbarPeriod and ProtoOATrendbar). Hopefully spotware corrects this but I will document my workaround in the next message.
@jaredthirsk
jaredthirsk
21 Oct 2016, 20:22
RE: UPDATE:
jaredthirsk said:
Outdated/incomplete Protobuf download link: https://connect.spotware.com/uploads/open-api-proto-lib.zip
Protobuf download link found here: https://connect.spotware.com/documentation/section/developer-library
Update: within a couple of hours of me emailing Spotware, they updated their Protobuf. Both tick timestamps and the subscribing/receiving trendbars appears to be in there. Thanks, Spotware!
Now I have to figure out how to regenerate C# bindings -- the instructions in the readme here seem to be out of date because the file gen_csharp_src.bat doesn't appear to exist anywhere:
https://github.com/spotware/connect-csharp-samples
@jaredthirsk
jaredthirsk
06 Oct 2016, 00:42
RE: RE: RE:
jaredthirsk said:
Yes. Seems fine now: 30ms/70ms. I am also with a couple other cTrader brokers (one is web only) -- I will check them the next time I have issues (which is hopefully never.)
(While I had issues, the spotware connect api still seemed fast: e.g.: https://api.spotware.com/connect/tradingaccounts/123456)
I notice the proxy server in the cTrader ping popup says New York-1. IIRC, it was New York-2 before.
@jaredthirsk
jaredthirsk
06 Oct 2016, 00:41
RE: RE:
marcus.nielsen said:
jaredthirsk said:
I'm having issues right now too, making cTrader unusable. This would seem urgent!
Also having IC Markets as a broker?
Yes. Seems fine now: 30ms/70ms. I am also with a couple other cTrader brokers (one is web only) -- I will check them the next time I have issues (which is hopefully never.)
(While I had issues, the spotware connect api still seemed fast: e.g.: https://api.spotware.com/connect/tradingaccounts/123456)
@jaredthirsk
jaredthirsk
05 Oct 2016, 18:14
I'm having issues right now too, making cTrader unusable. This would seem urgent!
@jaredthirsk
jaredthirsk
07 Sep 2016, 13:36
RE: RE: .NET 4
she666 said:
zelenij.krokodil said:
Hi cTrader/cAlgo developers,
Is .NET 4.5 supported? Or do we have to compile algos against 4.0 Client Profile?
cAlgo.dll is v4.0.30319 which implies dotNet 4.0
Spotware, any chance of dotNet upgrade for better performance? It's been 3 years and still remains stagnant.
+1
.NET 4 Client Profile is basically abandoned by Microsoft -- everybody has moved on (.NET 4.6.2). Is cTrader/cAlgo abandoned?
@jaredthirsk
jaredthirsk
14 Aug 2016, 09:03
Here is the FIX help page with the most up to date message reference PDF (version 2.5 as of this writing):
@jaredthirsk
jaredthirsk
12 Aug 2016, 18:44
RE:
davidp13 said:
Hi all. I'm sure this questions has probably been asked a million time, but I cannot find a good answer or maybe I'm just missing it, but how can one get access to more data on the platform to perform a backtest on lets say 5min TF?
Thank you in advance.
I use dukascopy. They have a good set of data but it is painfully slow to download multiple years of data, and then I have to run it through a custom conversion script to massage it into something cAlgo will take.
Here is the link:
https://www.dukascopy.com/swiss/english/marketwatch/historical/
Here's another one that is less painful but still annoying:
http://www.histdata.com/download-free-forex-data/
@jaredthirsk
jaredthirsk
24 Jun 2016, 11:28
If you truly want this to be a professional platform with high quality user code to bolster the ecosystem, ease of unit testing seems like a good thing.
@jaredthirsk
jaredthirsk
24 Jun 2016, 11:26
Idea: 1 key - 1 minute, 2 - 5m, 3 - 10m, 4 - 15m, 5 - 30m, 6 - 1h, 7 - 3h, 8 - 4h, 9 - 1d, 0 - 1w. Shift+1: set all charts in workspace to 1 minute, Shift+2 set all to 5 min, etc. (And make it configurable in case people want 10 tick charts and 1 month charts instead, etc.)
This is laborious, needed non-stop (I have 22 symbols in my workspace so I don't have enough room to have multiple charts per symbol), and should be extremely easy to implement!
@jaredthirsk
jaredthirsk
26 Oct 2016, 07:09
Dear programmer of the future,
As of Oct 25 2016, Spotware has kindly given another update to the .proto files, downloadable through the link mentioned above. They haven't updated the C# sample (or I didn't check), but I have regenerated the associated C# files and checked them in to my open source github project which you can find here:
Note: I don't know how to regenerate the OpenApiDeveloperLibrary files (OpenApiMessagesFactory.cs, OpenApiMessagesPresentation.cs, OpenApiModelObjectsFactory.cs). If someone can show me how to do these, please let me know. (But maybe they are manually created?)
@jaredthirsk