Page 1 of 1

Placing trades with JS Api fails

Posted: Sat Mar 20, 2021 8:11 pm
by fabse
I want to submit an order through the JS API but this fails with:

Code: Select all

 
java.lang.AssertionError: Strategy that is not marked as trading strategy attempted to trade
at velox.api.layer1.layers.w.d(SourceFile:106)
at java.base/java.lang.Thread.run(Unknown Source)
I use the following code for this:

Code: Select all

 
var SimpleOrderSendParametersBuilder = Packages.velox.api.layer1.data.SimpleOrderSendParametersBuilder
var simpleOrderBuilder = new SimpleOrderSendParametersBuilder("test", true, 1)
simpleOrderBuilder.setTakeProfitOffset(1)
simpleOrderBuilder.setStopLossOffset(2)
api.sendOrder(simpleOrderBuilder.build())
How can I mark a trading strategy in JS to be allowed for trading?
Can I also use these in live markets (except dxfeed) ?

Re: Placing trades with JS Api fails

Posted: Tue Mar 23, 2021 1:33 pm
by Andry API support
We are expecting trading features for JS API in the next release in about 2 weeks.

Re: Placing trades with JS Api fails

Posted: Fri Apr 30, 2021 9:23 am
by fabse
Great to hear that, any news already on a new release? I could not find anything.

Re: Placing trades with JS Api fails

Posted: Wed May 12, 2021 1:17 pm
by Andry API support
Hi fabse, it is still in progress.