Search code examples
c++quickfixfix-protocol

FIX NewOrderSingle recieves Internal application error, contact support


Im developing a bot in c++ using QuickFix, using Remarkets to test my app but when I send a newOrderSingle y get "Internal application error, contact support."

I assume the application is myself, but i also tried to contact Remarkets without any answer.

The messages go like this:

Logon:

8=FIXT.1.1 9=124 35=A 34=1 49=usr123 52=20201012-21:00:35.860 56=ROFX 553=usr123 554=hdjbxA7# 98=0 108=30 141=Y 1137=9 10=129 

Logon answer:

8=FIXT.1.1 9=89 35=A 34=1 49=ROFX 52=20201012-21:00:36.534 56=usr123 98=0 108=30 141=Y 1137=9 10=246 

Recieve this Trading Session Status that i dont fully understand:

8=FIXT.1.1 9=114 35=h 34=2 49=ROFX 52=20201012-21:00:38.069 56=usr123 325=Y 335=NONE 336=[N/A] 340=2 1300=DDF 1301=ROFX 10=098 
8=FIXT.1.1 9=115 35=h 34=3 49=ROFX 52=20201012-21:00:38.069 56=usr123 325=Y 335=NONE 336=[N/A] 340=2 1300=DUAL 1301=ROFX 10=188 
8=FIXT.1.1 9=114 35=h 34=4 49=ROFX 52=20201012-21:00:38.069 56=usr123 325=Y 335=NONE 336=[N/A] 340=2 1300=DDA 1301=ROFX 10=095 
8=FIXT.1.1 9=115 35=h 34=5 49=ROFX 52=20201012-21:00:38.069 56=usr123 325=Y 335=NONE 336=[N/A] 340=2 1300=MERV 1301=ROFX 10=210 
8=FIXT.1.1 9=115 35=h 34=6 49=ROFX 52=20201012-21:00:38.069 56=usr123 325=Y 335=NONE 336=[N/A] 340=2 1300=RFXI 1301=ROFX 10=210 
8=FIXT.1.1 9=128 35=h 34=7 49=ROFX 52=20201012-21:00:38.070 56=usr123 58=EXTERNAL 325=Y 335=NONE 336=[N/A] 340=2 1300=MATBA 1301=ROFX 10=009 
8=FIXT.1.1 9=118 35=h 34=8 49=ROFX 52=20201012-21:00:38.581 56=usr123 325=Y 335=NONE 336=1 340=0 625=1 1300=[N/A] 1301=ROFX 10=216 

I try to buy

8=FIXT.1.1 9=151 35=D 34=2 49=usr123 52=20201012-21:00:39.084 56=ROFX 1128=7 11=1132322 21=1 40=1 44=250 54=1 55=SOJ.ROSNov20 59=0 60=20201012-21:00:39 99=1 10=151 

Get this rejection

8=FIXT.1.1 9=145 35=j 34=9 49=ROFX 52=20201012-21:00:39.225 56=usr123 58=Internal application error, contact support.13558951763361350 372=[N/A] 380=4 10=036

I have tried several ways to make this message, always getting the same response.

My questions:

  • Is there something wrong with my newOrderSingle?
  • I have a working bot in python using pyRofex. Is there a way for me to see what fix message is pyRofex generating?
  • Is it OK to use tag 55 for the instrument? 55=SOJ.ROSNov20 I've seen some examples with value "EUR/USD" in that field. Should the symbol be a part of a group?
  • About ClOrdID: Remarkets documentation states that

Orders should have a unique identifier (tag ClOrdID <11>) assigned by the institution for a trading day. Orders with duplicate identifiers will be rejected by the exchange.

But every client y see is managing those ClOrdIDs internally. I understand that the only constrain is that it does not repeat in a single market day. Did i get it right?

Thanks in advance!!


Solution

  • Got it right! I have yet to understand the deatils, when I become an expert in fix protocol y promisse I will come and explain, but for the moment i can give you the message that allowed me to buy Option futures.

    8=FIXT.1.1                //Dictionary
    9=220                     //Body Length
    35=D                      //Message type. D= New order single
    34=2                      //MdgSeqNum 
    49=myuser                 //User
    52=20201016-00:21:56.758  //Sending time
    56=ROFX                   //Target comp ID
    1128=7                    //Dictionary version? 7=FIX50SP2
    1=REMXXXX                 //Account
    11=1223221                //ClOrdID 
    21=3                      //HandlInst. 3=manual order
    22=8                      //ID source. 8=Exchange Symbol
    38=2                      //Number of shares ordered. 
    40=2                      //Order type. 2=LIMIT   *1
    44=100                    //Price
    54=1                      //Side. 1=BUY 2=SELL
    55=SOJ.ROSNov20 220c      //Symbol
    60=20201016-00:21:56      //Time of execution/order creation        
    167=OPT                   //Security type. OPT=options
    200=NOV20                 //MaturityMonthYear 
    202=100                   //StrikePrice 
    231=100                   //ContractMultiplier
    461=F                     //CFI_CODE. F=FUTURE      
    10=118                    //CheckSum
    
    
    *1: I dont yet understand the difference between order "LIMIT" or "MARKET" but that is what solved it. 
    

    With that message I got this answer:

    8=FIXT.1.1|9=315|35=8|34=9|49=ROFX|52=20201016-00:21:56.900|56=user|1=Account|6=100.0000|11=1223221|14=2|17=T7661551|31=100.0|32=2|37=189923278|38=2|39=2|40=2|44=100.0|54=1|55=SOJ.ROSNov20 220c|58=Operada |59=0|60=20201016-00:21:56.898|150=F|151=0|207=ROFX|382=1|375=PMYVTR|453=1|448=user|447=D|452=11|10=174|
    

    About my question involving ClOrdID<11>: It's managed from the client, the only limitation is not to repeat the same ID in a single trading day.

    To sell a future option, the same message changing Side<54> from 1(BUY) to 2(SELL) works just fine.

    I'm pretty sure that i have extra fields in my message, will ckeck that.

    Thank you all for your answers, they helped a lot!