Giter Club home page Giter Club logo

ctrader-open-api-v2-java-example's People

Contributors

amarchanka avatar avolynets avatar dependabot[bot] avatar leosko avatar oafanasenko avatar panagiotischar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ctrader-open-api-v2-java-example's Issues

Getting historical trades

Hi,

I am using "ProtoOADealListReq" to get historical trades of my demo account.
No matter what unix time value I use for "fromTimestamp" and "toTimestamp". I get no deals even though during that time I had trades executed. I also used "ProtoOACashFlowHistoryListReq" but no results either.
Can you please help?

class java.io.IOException Operation timed out

Describe the bug
The listener timed out after it didn't receive any messages for a while.

To Reproduce
Create a listener using nettyClient.addListener() and let it stay open. It will time out after a few hours if no message is received.

Expected behavior
The connection should stay alive always.

Log files

2020-08-13 18:09:55 WARN  CloseOnExceptionHandler:66 - Exception caught in channel [id: 0x6c81328b, L:/10.0.10.34:55726 - R:live.ctraderapi.com/185.17.146.199:5035]: class java.io.IOException Operation timed out. Closing channel.

Additional context
Add any other context about the problem here.

Any plans to create SDK in Golang or Javascript?

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is.

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Cannot create two instances of NettyClient

Describe the bug
I am unable to create to two instances of NettyClient as I need to Authorise a Live and a Demo account in the same application.

To Reproduce
Try initialising two instances of NettyClient.

Expected behavior
We should be able to create as many instances of NettyClient as we want.

Log files

2020-08-15 19:23:40 WARN  ChannelInitializer:97 - Failed to initialize a channel. Closing: [id: 0x75c8ff27]
io.netty.channel.ChannelPipelineException: com.spotware.connect.netty.handler.HeartbeatOnIdleHandler is not a @Sharable handler, so can't be added or removed multiple times.
	at io.netty.channel.DefaultChannelPipeline.checkMultiplicity(DefaultChannelPipeline.java:604)
	at io.netty.channel.DefaultChannelPipeline.addLast(DefaultChannelPipeline.java:202)
	at io.netty.channel.DefaultChannelPipeline.addLast(DefaultChannelPipeline.java:195)
	at com.spotware.connect.netty.NettyClient.initPipelineForChannel(NettyClient.java:109)
	at com.spotware.connect.netty.NettyClient.access$000(NettyClient.java:38)
	at com.spotware.connect.netty.NettyClient$1.initChannel(NettyClient.java:83)
	at com.spotware.connect.netty.NettyClient$1.initChannel(NettyClient.java:80)
	at io.netty.channel.ChannelInitializer.initChannel(ChannelInitializer.java:129)
	at io.netty.channel.ChannelInitializer.handlerAdded(ChannelInitializer.java:112)
	at io.netty.channel.AbstractChannelHandlerContext.callHandlerAdded(AbstractChannelHandlerContext.java:964)
	at io.netty.channel.DefaultChannelPipeline.callHandlerAdded0(DefaultChannelPipeline.java:613)
	at io.netty.channel.DefaultChannelPipeline.access$100(DefaultChannelPipeline.java:46)
	at io.netty.channel.DefaultChannelPipeline$PendingHandlerAddedTask.execute(DefaultChannelPipeline.java:1475)
	at io.netty.channel.DefaultChannelPipeline.callHandlerAddedForAllHandlers(DefaultChannelPipeline.java:1127)
	at io.netty.channel.DefaultChannelPipeline.invokeHandlerAddedIfNeeded(DefaultChannelPipeline.java:654)
	at io.netty.channel.AbstractChannel$AbstractUnsafe.register0(AbstractChannel.java:503)
	at io.netty.channel.AbstractChannel$AbstractUnsafe.access$200(AbstractChannel.java:416)
	at io.netty.channel.AbstractChannel$AbstractUnsafe$1.run(AbstractChannel.java:475)
	at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163)
	at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:510)
	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:518)
	at io.netty.util.concurrent.SingleThreadEventExecutor$6.run(SingleThreadEventExecutor.java:1044)
	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.base/java.lang.Thread.run(Thread.java:832)

Additional context
Add any other context about the problem here.

Cannot build com.xtrader.protocol.openapi.v2.*

Describe the bug
Package does not exist.
Error:(15, 42) java: package com.xtrader.protocol.proto.commons does not exist

Log files
Information:java: Errors occurred while compiling module 'openapi2-client'
Information:javac 1.8.0_144 was used to compile java sources
Information:Modules "openapi2-client", "openapi2-example" were fully rebuilt due to project configuration/dependencies changes
Information:7/16/20, 16:02 - Build completed with 100 errors and 0 warnings in 6 s 280 ms
/Users/hienphung/IdeaProjects/ctrader-open-api-v2-java-example/openapi2-client/src/main/java/com/spotware/connect/protocol/ProtoMessageFactory.java
Error:Error:line (15)java: package com.xtrader.protocol.proto.commons does not exist
Error:Error:line (59)java: cannot find symbol
symbol: class ProtoMessage
location: class com.spotware.connect.protocol.ProtoMessageFactory
Error:Error:line (72)java: cannot find symbol
symbol: class ProtoMessage
location: class com.spotware.connect.protocol.ProtoMessageFactory
Error:Error:line (60)java: package ProtoMessage does not exist
Error:Error:line (60)java: cannot find symbol
symbol: variable ProtoMessage
location: class com.spotware.connect.protocol.ProtoMessageFactory
/Users/hienphung/IdeaProjects/ctrader-open-api-v2-java-example/openapi2-client/src/main/java/com/spotware/connect/protocol/OA2ProtoMessageFactory.java
Error:Error:line (5)java: package com.xtrader.protocol.openapi.v2 does not exist
Error:Error:line (6)java: package com.xtrader.protocol.openapi.v2 does not exist
Error:Error:line (7)java: package com.xtrader.protocol.openapi.v2 does not exist
Error:Error:line (8)java: package com.xtrader.protocol.openapi.v2 does not exist
Error:Error:line (9)java: package com.xtrader.protocol.openapi.v2 does not exist
Error:Error:line (10)java: package com.xtrader.protocol.openapi.v2 does not exist
Error:Error:line (11)java: package com.xtrader.protocol.openapi.v2 does not exist
.....

Unable to Build project on Raspberry Pi

Describe the bug
Unable to build project on platform linux/arm.

To Reproduce
Try running mvn compile on an ARM machine.

Expected behavior
The program should build on any platform.

Log files

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$1 (file:/usr/share/maven/lib/guice.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of com.google.inject.internal.cglib.core.$ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.spotware.openapi2:openapi2-client:jar:1.0-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ com.spotware.openapi2:openapi2-client:[unknown-version], /home/pi/openapi2-client/pom.xml, line 60, column 21
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] ---------------< com.spotware.openapi2:openapi2-client >----------------
[INFO] Building Open API 2 client in Java 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- protoc-jar-maven-plugin:2.5.0.4:run (default) @ openapi2-client ---
[INFO] Include directories:
[INFO]     /home/pi/openapi2-client/src/main/protobuf
[INFO] Input directories:
[INFO]     /home/pi/openapi2-client/src/main/protobuf
[INFO] Output targets:
[INFO]     java: /home/pi/openapi2-client/target/generated-sources (add: main, clean: false)
[INFO] /home/pi/openapi2-client/target/generated-sources does not exist. Creating...
[INFO]     Processing (java): OpenApiModelMessages.proto
protoc-jar: protoc version: 250, detected platform: linux/arm
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  4.838 s
[INFO] Finished at: 2020-08-14T13:43:37+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.os72:protoc-jar-maven-plugin:2.5.0.4:run (default) on project openapi2-client: Unable to execute protoc-jar for /home/pi/openapi2-client/src/main/protobuf/OpenApiModelMessages.proto: Unsupported platform: linux/arm -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

Additional context
Add any other context about the problem here.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.