When i trying to place order I am getting error response as invalid disclosed quantity

revanth1425
When i trying to place order I am getting error response as invalid disclosed quantity
  • sujith
    Hi @revanth1425,
    It is mandatory by exchange that disclosed quantity for equity, cds must be minimum of 10% of quantity of order and for mcx it must be minimum of 25% of quantity. TR earlier didn't had this rule and they added it now. Just make sure you send proper disclosed quantity while placing orders.
  • revanth1425
    NSData *data=[NSKeyedArchiver archivedDataWithRootObject:message];

    if(data.length > 247)
    {
    id packets = [message subdataWithRange:NSMakeRange(0,2)];
    int packetsNumber = CFSwapInt16BigToHost(*(int*)([packets bytes]));
    NSLog(@ number of packets %i,packetsNumber);

    id packetsLng1 = [message subdataWithRange:NSMakeRange(2,4)];
    int packetsLength1 = CFSwapInt16BigToHost(*(int*)([packetsLng1 bytes]));
    NSLog(@ packet length1 %i,packetsLength1);

    id packetQuote = [message subdataWithRange:NSMakeRange(4,4+packetsLength1)];
    // int packetsQuoteValue = CFSwapInt16BigToHost(*(int*)([packetQuote bytes]));
    // NSLog(@ quote1 %i,packetsQuoteValue);


    id data4 = [packetQuote subdataWithRange:NSMakeRange(0, 4)];
    int32_t value = CFSwapInt32BigToHost(*(int32_t*)([data4 bytes]));
    NSLog(@ instrument token1 %d,value);


    id packetsLng2 = [message subdataWithRange:NSMakeRange(4+packetsLength1,4+packetsLength1+2)];
    int packetsLength2 = CFSwapInt16BigToHost(*(int*)([packetsLng2 bytes]));
    NSLog(@ packet length2 %d,packetsLength2);
    //
    id packetQuote2 = [message subdataWithRange:NSMakeRange(4+packetsLength1+2,4+packetsLength1+2+packetsLength2)];
    int packetsQuoteValue2 = CFSwapInt16BigToHost(*(int*)([packetQuote2 bytes]));
    NSLog(@ quote1 %i,packetsQuoteValue2);




    Message is the response data and i am taking subdatas and getting lengths it is working fine for first packet length but getting error when it comes to the second packet length.I followed the documentation for getting the packet lengths
  • sujith
    Hi @revanth1425,
    Can you elaborate? I didn't get what you are trying to do.
Sign In or Register to comment.