Jump to content
koszcz

Streaming ORDERS through iOS SDK

Recommended Posts

Hello, i want to subscribe to ORDERS channel but i have problems with translating CI documentation phrases to LightStreamer iSO SDK vocabulary.

 

I am already successful in subscribing for PRICES channel. This is how i configured ORDERS subscription:

 

LSSubscription *subscription = [[LSSubscription alloc] initWithSubscriptionMode:@"RAW"];

subscription.items = @[ @"ORDERS" ];
subscription.fields = @[ @"OrderId", @"MarketId" ];
subscription.dataAdapter = @"ORDERS";
subscription.requestedSnapshot = @"no";

[subscription addDelegate:self];

[self.client subscribe:subscription];

 

I am getting the error that "Group" name is invalid, so i tried changing "items" from "ORDERS" to "ORDERS.ORDERS" but then even without getting error i still get no updates for ORDERS.

 

Can someone help me figure this out?

Share this post


Link to post

Hi,

 

Just a quick question regarding your query. Do you have any entry or closing orders in the account that you are using for testing? If the account currently has no orders (entry orders or closing orders) then there is nothing to stream in the ORDERS stream.

 

Please let me know and I can follow up as required.

 

Kind Regards,

PM!

Share this post


Link to post

Hi,

 

Internally, we use LSExtendedTableInfo rather than LSSubscription. Intialisation looks like:

//Quote Streamer
//
#define kTableField_QuoteId @"QuoteId"
#define kTableField_OrderId @"OrderId"
#define kTableField_MarketId @"MarketId"
#define kTableField_BidPrice @"BidPrice"
#define kTableField_BidAdjust @"BidAdjust"
#define kTableField_OfferPrice @"OfferPrice"
#define kTableField_OfferAdjust @"OfferAdjust"
#define kTableField_Quantity @"Quantity"
#define kTableField_CurrencyId @"CurrencyId"
#define kTableField_StatusId @"StatusId"
#define kTableField_ReasonId @"ReasonId"
#define kTableField_TypeId @"TypeId"
#define kTableField_RequestDateTime @"RequestDateTimeUTC"
#define kTableField_BreathTimeSecs @"BreathTimeSecs"
#define kTableField_IsOversize @“IsOversize"
#define kDataAdapter_Orders @"ORDERS"

- (id)init
{
    return [super initWithFields:@[kTableField_OrderId,
                                   kTableField_ClientAccountId,
                                   kTableField_TradingAccountId,
                                   kTableField_Currency,
                                   kTableField_CurrencyId,
                                   kTableField_Direction,
                                   kTableField_AutoRollover,
                                   kTableField_ExecutionPrice,
                                   kTableField_LastChangedTime,
                                   kTableField_MarketId,
                                   kTableField_OpenPrice,
                                   kTableField_OriginalLastChangedDateTime,
                                   kTableField_OriginalQuantity,
                                   kTableField_PositionMethodId,
                                   kTableField_Quantity,
                                   kTableField_Type,
                                   kTableField_Status,
                                   kTableField_ReasonId]
                     dataAdapter:kDataAdapter_Orders];
}

- (id)initWithFields:(NSArray *)fields dataAdapter:(NSString *)dataAdapter
{
    if (self = [super init])
    {
        self.tableInfo = [LSExtendedTableInfo extendedTableInfoWithItems:@[dataAdapter]
                                                                    mode:LSModeRaw
                                                                  fields:fields
                                                             dataAdapter:dataAdapter
                                                                snapshot:NO];
    }
    return self;
}

Hope that helps.

 

Kind Regards,

PM!

 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×