Order ID (12digits numbert)

Add your new features and requests here.
jupiter13
Posts: 1
Joined: Thu Jan 17, 2019 1:44 pm

Order ID (12digits numbert)

Post by jupiter13 » Fri Oct 09, 2020 2:46 pm

Hi,

Is it possible to get an Order ID for each Ask and Bid that come into the Order Book? Can you show me an example? 

Thank you in advance

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

Re: Order ID (12digits numbert)

Post by Andry API support » Tue Oct 13, 2020 3:45 pm

Hi jupiter13,
an example of printing all ids accepted by an exchange to log:

Code: Select all

 
package velox.api.layer1.simplified.demo;

import velox.api.layer1.annotations.Layer1ApiVersion;
import velox.api.layer1.annotations.Layer1ApiVersionValue;
import velox.api.layer1.annotations.Layer1SimpleAttachable;
import velox.api.layer1.annotations.Layer1StrategyName;
import velox.api.layer1.common.Log;
import velox.api.layer1.data.InstrumentInfo;
import velox.api.layer1.simplified.Api;
import velox.api.layer1.simplified.CustomModule;
import velox.api.layer1.simplified.InitialState;
import velox.api.layer1.simplified.MarketByOrderDepthDataAdapter;

@Layer1SimpleAttachable
@Layer1StrategyName("MboIds")
@Layer1ApiVersion(Layer1ApiVersionValue.VERSION2)
public class MboIds extends MarketByOrderDepthDataAdapter implements CustomModule 
{

    @Override
    public void initialize(String alias, InstrumentInfo info, Api api, InitialState initialState) {
    }
    
    @Override
    public void stop() {
    }

    @Override
    public void send(String orderId, boolean isBid, int price, int size) {
        Log.info(isBid + " " + orderId);
    }

}

Post Reply