@@ -627,7 +627,7 @@ export class Trader extends CTPProvider implements ITraderProvider {
627
627
}
628
628
629
629
queryCommissionRate ( symbol : string , receiver : ICommissionRateReceiver ) {
630
- const instrumentId = this . _symbolToInstrumentId ( symbol ) ;
630
+ const [ instrumentId ] = this . _parseSymbol ( symbol ) ;
631
631
const commRate = this . commRates . get ( instrumentId ) ;
632
632
633
633
if ( commRate ) {
@@ -648,7 +648,7 @@ export class Trader extends CTPProvider implements ITraderProvider {
648
648
}
649
649
650
650
queryMarginRate ( symbol : string , receiver : IMarginRateReceiver ) {
651
- const instrumentId = this . _symbolToInstrumentId ( symbol ) ;
651
+ const [ instrumentId ] = this . _parseSymbol ( symbol ) ;
652
652
const marginRate = this . marginRates . get ( instrumentId ) ;
653
653
654
654
if ( marginRate ) {
@@ -670,10 +670,12 @@ export class Trader extends CTPProvider implements ITraderProvider {
670
670
}
671
671
672
672
queryInstrument ( symbol : string , receiver : IInstrumentReceiver ) {
673
- const instrumentId = this . _symbolToInstrumentId ( symbol ) ;
673
+ const [ instrumentId , exchangeId ] = this . _parseSymbol ( symbol ) ;
674
674
675
675
const instrument = this . instruments . find (
676
- ( instrument ) => instrument . InstrumentID === instrumentId ,
676
+ ( instrument ) =>
677
+ instrument . InstrumentID === instrumentId &&
678
+ instrument . ExchangeID === exchangeId ,
677
679
) ;
678
680
679
681
receiver . onInstrument (
@@ -689,7 +691,7 @@ export class Trader extends CTPProvider implements ITraderProvider {
689
691
return ;
690
692
}
691
693
692
- const instrumentId = this . _symbolToInstrumentId ( symbol ) ;
694
+ const [ instrumentId ] = this . _parseSymbol ( symbol ) ;
693
695
694
696
if ( ! this . symbols . has ( instrumentId ) ) {
695
697
receiver . onPosition ( undefined ) ;
@@ -820,7 +822,7 @@ export class Trader extends CTPProvider implements ITraderProvider {
820
822
return ;
821
823
}
822
824
823
- const instrumentId = this . _symbolToInstrumentId ( symbol ) ;
825
+ const [ instrumentId ] = this . _parseSymbol ( symbol ) ;
824
826
825
827
const instrument = this . instruments . find (
826
828
( instrument ) => instrument . InstrumentID === instrumentId ,
@@ -1469,7 +1471,7 @@ export class Trader extends CTPProvider implements ITraderProvider {
1469
1471
while ( ! this . marginRatesQueue . isEmpty ( ) ) {
1470
1472
const nextQuery = this . marginRatesQueue . peekFront ( ) ! ;
1471
1473
1472
- const instrumentId = this . _symbolToInstrumentId ( nextQuery . symbol ) ;
1474
+ const [ instrumentId ] = this . _parseSymbol ( nextQuery . symbol ) ;
1473
1475
const marginRate = this . marginRates . get ( instrumentId ) ;
1474
1476
1475
1477
if ( marginRate ) {
@@ -1494,7 +1496,7 @@ export class Trader extends CTPProvider implements ITraderProvider {
1494
1496
while ( ! this . commRatesQueue . isEmpty ( ) ) {
1495
1497
const nextQuery = this . commRatesQueue . peekFront ( ) ! ;
1496
1498
1497
- const instrumentId = this . _symbolToInstrumentId ( nextQuery . symbol ) ;
1499
+ const [ instrumentId ] = this . _parseSymbol ( nextQuery . symbol ) ;
1498
1500
const commRate = this . commRates . get ( instrumentId ) ;
1499
1501
1500
1502
if ( commRate ) {
0 commit comments