Skip to content
This repository has been archived by the owner on Feb 10, 2022. It is now read-only.

Commit

Permalink
Merge pull request #153 from jvirtanen/cleanups/fix
Browse files Browse the repository at this point in the history
parity-fix: Clean up value handling
  • Loading branch information
jvirtanen committed Jul 29, 2020
2 parents 571f536 + 8cb5a9c commit ebacbc9
Showing 1 changed file with 14 additions and 10 deletions.
Expand Up @@ -138,24 +138,26 @@ private void newOrderSingle(FIXMessage message) throws IOException {
FIXValue priceValue = null;

for (int i = 0; i < message.getFieldCount(); i++) {
FIXValue value = message.valueAt(i);

switch (message.tagAt(i)) {
case ClOrdID:
clOrdIdValue = message.valueAt(i);
clOrdIdValue = value;
break;
case Account:
accountValue = message.valueAt(i);
accountValue = value;
break;
case Side:
sideValue = message.valueAt(i);
sideValue = value;
break;
case Symbol:
symbolValue = message.valueAt(i);
symbolValue = value;
break;
case OrderQty:
orderQtyValue = message.valueAt(i);
orderQtyValue = value;
break;
case Price:
priceValue = message.valueAt(i);
priceValue = value;
break;
}
}
Expand Down Expand Up @@ -267,15 +269,17 @@ private void orderCancel(FIXMessage message, char msgType) throws IOException {
FIXValue orderQtyValue = null;

for (int i = 0; i < message.getFieldCount(); i++) {
FIXValue value = message.valueAt(i);

switch (message.tagAt(i)) {
case ClOrdID:
clOrdIdValue = message.valueAt(i);
clOrdIdValue = value;
break;
case OrigClOrdID:
origClOrdIdValue = message.valueAt(i);
origClOrdIdValue = value;
break;
case OrderQty:
orderQtyValue = message.valueAt(i);
orderQtyValue = value;
break;
}
}
Expand All @@ -294,7 +298,7 @@ private void orderCancel(FIXMessage message, char msgType) throws IOException {
char cxlRejResponseTo = CxlRejResponseToValues.OrderCancelRequest;

if (msgType == OrderCancelReplaceRequest)
cxlRejResponseTo = CxlRejResponseToValues.OrderCancel;
cxlRejResponseTo = CxlRejResponseToValues.OrderCancelReplaceRequest;

String origClOrdId = origClOrdIdValue.asString();
String clOrdId = clOrdIdValue.asString();
Expand Down

0 comments on commit ebacbc9

Please sign in to comment.