Placing trades with JS Api fails

Custom indicators, trading strategies, data export and recording and more...
fabse
Posts: 7
Joined: Tue Nov 03, 2020 7:01 pm
Been thanked: 8 times

Placing trades with JS Api fails

Post by fabse » Sat Mar 20, 2021 8:11 pm

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) ?

Andry API support
Posts: 548
Joined: Mon Jul 09, 2018 11:18 am
Has thanked: 25 times
Been thanked: 85 times

Re: Placing trades with JS Api fails

Post by Andry API support » Tue Mar 23, 2021 1:33 pm

We are expecting trading features for JS API in the next release in about 2 weeks.

fabse
Posts: 7
Joined: Tue Nov 03, 2020 7:01 pm
Been thanked: 8 times

Re: Placing trades with JS Api fails

Post by fabse » Fri Apr 30, 2021 9:23 am

Great to hear that, any news already on a new release? I could not find anything.

Andry API support
Posts: 548
Joined: Mon Jul 09, 2018 11:18 am
Has thanked: 25 times
Been thanked: 85 times

Re: Placing trades with JS Api fails

Post by Andry API support » Wed May 12, 2021 1:17 pm

Hi fabse, it is still in progress.

Post Reply