-
Notifications
You must be signed in to change notification settings - Fork 3
/
traderapi_impl.go
1584 lines (1240 loc) · 101 KB
/
traderapi_impl.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package goctp
/*
#include <stdint.h>
#include <stdlib.h>
#include "ThostFtdcUserApiDataType.h"
#include "ThostFtdcUserApiStruct.h"
extern uintptr_t _wrap_CThostFtdcTraderApi_CreateFtdcTraderApi();
extern uintptr_t _wrap_CThostFtdcTraderApi_CreateFtdcTraderApi2(uintptr_t, char *);
// extern CThostFtdcTraderApi * _wrap_CThostFtdcTraderApi_CreateFtdcTraderApi(uintptr_t, const char *);
extern const char * _wrap_CThostFtdcTraderApi_GetApiVersion(uintptr_t);
extern void _wrap_CThostFtdcTraderApi_Release(uintptr_t);
extern void _wrap_CThostFtdcTraderApi_Init(uintptr_t);
extern int _wrap_CThostFtdcTraderApi_Join(uintptr_t);
extern const char * _wrap_CThostFtdcTraderApi_GetTradingDay(uintptr_t);
extern void _wrap_CThostFtdcTraderApi_RegisterFront(uintptr_t, char *);
extern void _wrap_CThostFtdcTraderApi_RegisterNameServer(uintptr_t, char *);
extern void _wrap_CThostFtdcTraderApi_RegisterFensUserInfo(uintptr_t, struct CThostFtdcFensUserInfoField *);
// extern void _wrap_CThostFtdcTraderApi_RegisterSpi(uintptr_t, struct CThostFtdcTraderSpi *);
extern void _wrap_CThostFtdcTraderApi_SubscribePrivateTopic(uintptr_t, enum THOST_TE_RESUME_TYPE);
extern void _wrap_CThostFtdcTraderApi_SubscribePublicTopic(uintptr_t, enum THOST_TE_RESUME_TYPE);
extern int _wrap_CThostFtdcTraderApi_ReqAuthenticate(uintptr_t, struct CThostFtdcReqAuthenticateField *, int);
extern int _wrap_CThostFtdcTraderApi_RegisterUserSystemInfo(uintptr_t, struct CThostFtdcUserSystemInfoField *);
extern int _wrap_CThostFtdcTraderApi_SubmitUserSystemInfo(uintptr_t, struct CThostFtdcUserSystemInfoField *);
extern int _wrap_CThostFtdcTraderApi_ReqUserLogin(uintptr_t, struct CThostFtdcReqUserLoginField *, int);
extern int _wrap_CThostFtdcTraderApi_ReqUserLoginMac(uintptr_t, struct CThostFtdcReqUserLoginField *, int, int, char*);
extern int _wrap_CThostFtdcTraderApi_ReqUserLogout(uintptr_t, struct CThostFtdcUserLogoutField *, int);
extern int _wrap_CThostFtdcTraderApi_ReqUserPasswordUpdate(uintptr_t, struct CThostFtdcUserPasswordUpdateField *, int);
extern int _wrap_CThostFtdcTraderApi_ReqTradingAccountPasswordUpdate(uintptr_t, struct CThostFtdcTradingAccountPasswordUpdateField *, int);
extern int _wrap_CThostFtdcTraderApi_ReqUserAuthMethod(uintptr_t, struct CThostFtdcReqUserAuthMethodField *, int);
extern int _wrap_CThostFtdcTraderApi_ReqGenUserCaptcha(uintptr_t, struct CThostFtdcReqGenUserCaptchaField *, int);
extern int _wrap_CThostFtdcTraderApi_ReqGenUserText(uintptr_t, struct CThostFtdcReqGenUserTextField *, int);
extern int _wrap_CThostFtdcTraderApi_ReqUserLoginWithCaptcha(uintptr_t, struct CThostFtdcReqUserLoginWithCaptchaField *, int);
extern int _wrap_CThostFtdcTraderApi_ReqUserLoginWithText(uintptr_t, struct CThostFtdcReqUserLoginWithTextField *, int);
extern int _wrap_CThostFtdcTraderApi_ReqUserLoginWithOTP(uintptr_t, struct CThostFtdcReqUserLoginWithOTPField *, int);
extern int _wrap_CThostFtdcTraderApi_ReqOrderInsert(uintptr_t, struct CThostFtdcInputOrderField *, int);
extern int _wrap_CThostFtdcTraderApi_ReqParkedOrderInsert(uintptr_t, struct CThostFtdcParkedOrderField *, int);
extern int _wrap_CThostFtdcTraderApi_ReqParkedOrderAction(uintptr_t, struct CThostFtdcParkedOrderActionField *, int);
extern int _wrap_CThostFtdcTraderApi_ReqOrderAction(uintptr_t, struct CThostFtdcInputOrderActionField *, int);
extern int _wrap_CThostFtdcTraderApi_ReqQryMaxOrderVolume(uintptr_t, struct CThostFtdcQryMaxOrderVolumeField *, int);
extern int _wrap_CThostFtdcTraderApi_ReqSettlementInfoConfirm(uintptr_t, struct CThostFtdcSettlementInfoConfirmField *, int);
extern int _wrap_CThostFtdcTraderApi_ReqRemoveParkedOrder(uintptr_t, struct CThostFtdcRemoveParkedOrderField *, int);
extern int _wrap_CThostFtdcTraderApi_ReqRemoveParkedOrderAction(uintptr_t, struct CThostFtdcRemoveParkedOrderActionField *, int);
extern int _wrap_CThostFtdcTraderApi_ReqExecOrderInsert(uintptr_t, struct CThostFtdcInputExecOrderField *, int);
extern int _wrap_CThostFtdcTraderApi_ReqExecOrderAction(uintptr_t, struct CThostFtdcInputExecOrderActionField *, int);
extern int _wrap_CThostFtdcTraderApi_ReqForQuoteInsert(uintptr_t, struct CThostFtdcInputForQuoteField *, int);
extern int _wrap_CThostFtdcTraderApi_ReqQuoteInsert(uintptr_t, struct CThostFtdcInputQuoteField *, int);
extern int _wrap_CThostFtdcTraderApi_ReqQuoteAction(uintptr_t, struct CThostFtdcInputQuoteActionField *, int);
extern int _wrap_CThostFtdcTraderApi_ReqBatchOrderAction(uintptr_t, struct CThostFtdcInputBatchOrderActionField *, int);
extern int _wrap_CThostFtdcTraderApi_ReqOptionSelfCloseInsert(uintptr_t, struct CThostFtdcInputOptionSelfCloseField *, int);
extern int _wrap_CThostFtdcTraderApi_ReqOptionSelfCloseAction(uintptr_t, struct CThostFtdcInputOptionSelfCloseActionField *, int);
extern int _wrap_CThostFtdcTraderApi_ReqCombActionInsert(uintptr_t, struct CThostFtdcInputCombActionField *, int);
extern int _wrap_CThostFtdcTraderApi_ReqQryOrder(uintptr_t, struct CThostFtdcQryOrderField *, int);
extern int _wrap_CThostFtdcTraderApi_ReqQryTrade(uintptr_t, struct CThostFtdcQryTradeField *, int);
extern int _wrap_CThostFtdcTraderApi_ReqQryInvestorPosition(uintptr_t, struct CThostFtdcQryInvestorPositionField *, int);
extern int _wrap_CThostFtdcTraderApi_ReqQryTradingAccount(uintptr_t, struct CThostFtdcQryTradingAccountField *, int);
extern int _wrap_CThostFtdcTraderApi_ReqQryInvestor(uintptr_t, struct CThostFtdcQryInvestorField *, int);
extern int _wrap_CThostFtdcTraderApi_ReqQryTradingCode(uintptr_t, struct CThostFtdcQryTradingCodeField *, int);
extern int _wrap_CThostFtdcTraderApi_ReqQryInstrumentMarginRate(uintptr_t, struct CThostFtdcQryInstrumentMarginRateField *, int);
extern int _wrap_CThostFtdcTraderApi_ReqQryInstrumentCommissionRate(uintptr_t, struct CThostFtdcQryInstrumentCommissionRateField *, int);
extern int _wrap_CThostFtdcTraderApi_ReqQryExchange(uintptr_t, struct CThostFtdcQryExchangeField *, int);
extern int _wrap_CThostFtdcTraderApi_ReqQryProduct(uintptr_t, struct CThostFtdcQryProductField *, int);
extern int _wrap_CThostFtdcTraderApi_ReqQryInstrument(uintptr_t, struct CThostFtdcQryInstrumentField *, int);
extern int _wrap_CThostFtdcTraderApi_ReqQryDepthMarketData(uintptr_t, struct CThostFtdcQryDepthMarketDataField *, int);
extern int _wrap_CThostFtdcTraderApi_ReqQrySettlementInfo(uintptr_t, struct CThostFtdcQrySettlementInfoField *, int);
extern int _wrap_CThostFtdcTraderApi_ReqQryTransferBank(uintptr_t, struct CThostFtdcQryTransferBankField *, int);
extern int _wrap_CThostFtdcTraderApi_ReqQryInvestorPositionDetail(uintptr_t, struct CThostFtdcQryInvestorPositionDetailField *, int);
extern int _wrap_CThostFtdcTraderApi_ReqQryNotice(uintptr_t, struct CThostFtdcQryNoticeField *, int);
extern int _wrap_CThostFtdcTraderApi_ReqQrySettlementInfoConfirm(uintptr_t, struct CThostFtdcQrySettlementInfoConfirmField *, int);
extern int _wrap_CThostFtdcTraderApi_ReqQryInvestorPositionCombineDetail(uintptr_t, struct CThostFtdcQryInvestorPositionCombineDetailField *, int);
extern int _wrap_CThostFtdcTraderApi_ReqQryCFMMCTradingAccountKey(uintptr_t, struct CThostFtdcQryCFMMCTradingAccountKeyField *, int);
extern int _wrap_CThostFtdcTraderApi_ReqQryEWarrantOffset(uintptr_t, struct CThostFtdcQryEWarrantOffsetField *, int);
extern int _wrap_CThostFtdcTraderApi_ReqQryInvestorProductGroupMargin(uintptr_t, struct CThostFtdcQryInvestorProductGroupMarginField *, int);
extern int _wrap_CThostFtdcTraderApi_ReqQryExchangeMarginRate(uintptr_t, struct CThostFtdcQryExchangeMarginRateField *, int);
extern int _wrap_CThostFtdcTraderApi_ReqQryExchangeMarginRateAdjust(uintptr_t, struct CThostFtdcQryExchangeMarginRateAdjustField *, int);
extern int _wrap_CThostFtdcTraderApi_ReqQryExchangeRate(uintptr_t, struct CThostFtdcQryExchangeRateField *, int);
extern int _wrap_CThostFtdcTraderApi_ReqQrySecAgentACIDMap(uintptr_t, struct CThostFtdcQrySecAgentACIDMapField *, int);
extern int _wrap_CThostFtdcTraderApi_ReqQryProductExchRate(uintptr_t, struct CThostFtdcQryProductExchRateField *, int);
extern int _wrap_CThostFtdcTraderApi_ReqQryProductGroup(uintptr_t, struct CThostFtdcQryProductGroupField *, int);
extern int _wrap_CThostFtdcTraderApi_ReqQryMMInstrumentCommissionRate(uintptr_t, struct CThostFtdcQryMMInstrumentCommissionRateField *, int);
extern int _wrap_CThostFtdcTraderApi_ReqQryMMOptionInstrCommRate(uintptr_t, struct CThostFtdcQryMMOptionInstrCommRateField *, int);
extern int _wrap_CThostFtdcTraderApi_ReqQryInstrumentOrderCommRate(uintptr_t, struct CThostFtdcQryInstrumentOrderCommRateField *, int);
extern int _wrap_CThostFtdcTraderApi_ReqQrySecAgentTradingAccount(uintptr_t, struct CThostFtdcQryTradingAccountField *, int);
extern int _wrap_CThostFtdcTraderApi_ReqQrySecAgentCheckMode(uintptr_t, struct CThostFtdcQrySecAgentCheckModeField *, int);
extern int _wrap_CThostFtdcTraderApi_ReqQrySecAgentTradeInfo(uintptr_t, struct CThostFtdcQrySecAgentTradeInfoField *, int);
extern int _wrap_CThostFtdcTraderApi_ReqQryOptionInstrTradeCost(uintptr_t, struct CThostFtdcQryOptionInstrTradeCostField *, int);
extern int _wrap_CThostFtdcTraderApi_ReqQryOptionInstrCommRate(uintptr_t, struct CThostFtdcQryOptionInstrCommRateField *, int);
extern int _wrap_CThostFtdcTraderApi_ReqQryExecOrder(uintptr_t, struct CThostFtdcQryExecOrderField *, int);
extern int _wrap_CThostFtdcTraderApi_ReqQryForQuote(uintptr_t, struct CThostFtdcQryForQuoteField *, int);
extern int _wrap_CThostFtdcTraderApi_ReqQryQuote(uintptr_t, struct CThostFtdcQryQuoteField *, int);
extern int _wrap_CThostFtdcTraderApi_ReqQryOptionSelfClose(uintptr_t, struct CThostFtdcQryOptionSelfCloseField *, int);
extern int _wrap_CThostFtdcTraderApi_ReqQryInvestUnit(uintptr_t, struct CThostFtdcQryInvestUnitField *, int);
extern int _wrap_CThostFtdcTraderApi_ReqQryCombInstrumentGuard(uintptr_t, struct CThostFtdcQryCombInstrumentGuardField *, int);
extern int _wrap_CThostFtdcTraderApi_ReqQryCombAction(uintptr_t, struct CThostFtdcQryCombActionField *, int);
extern int _wrap_CThostFtdcTraderApi_ReqQryTransferSerial(uintptr_t, struct CThostFtdcQryTransferSerialField *, int);
extern int _wrap_CThostFtdcTraderApi_ReqQryAccountregister(uintptr_t, struct CThostFtdcQryAccountregisterField *, int);
extern int _wrap_CThostFtdcTraderApi_ReqQryContractBank(uintptr_t, struct CThostFtdcQryContractBankField *, int);
extern int _wrap_CThostFtdcTraderApi_ReqQryParkedOrder(uintptr_t, struct CThostFtdcQryParkedOrderField *, int);
extern int _wrap_CThostFtdcTraderApi_ReqQryParkedOrderAction(uintptr_t, struct CThostFtdcQryParkedOrderActionField *, int);
extern int _wrap_CThostFtdcTraderApi_ReqQryTradingNotice(uintptr_t, struct CThostFtdcQryTradingNoticeField *, int);
extern int _wrap_CThostFtdcTraderApi_ReqQryBrokerTradingParams(uintptr_t, struct CThostFtdcQryBrokerTradingParamsField *, int);
extern int _wrap_CThostFtdcTraderApi_ReqQryBrokerTradingAlgos(uintptr_t, struct CThostFtdcQryBrokerTradingAlgosField *, int);
extern int _wrap_CThostFtdcTraderApi_ReqQueryCFMMCTradingAccountToken(uintptr_t, struct CThostFtdcQueryCFMMCTradingAccountTokenField *, int);
extern int _wrap_CThostFtdcTraderApi_ReqFromBankToFutureByFuture(uintptr_t, struct CThostFtdcReqTransferField *, int);
extern int _wrap_CThostFtdcTraderApi_ReqFromFutureToBankByFuture(uintptr_t, struct CThostFtdcReqTransferField *, int);
extern int _wrap_CThostFtdcTraderApi_ReqQueryBankAccountMoneyByFuture(uintptr_t, struct CThostFtdcReqQueryAccountField *, int);
extern int _wrap_CThostFtdcTraderApi_ReqQryClassifiedInstrument(uintptr_t, struct CThostFtdcQryClassifiedInstrumentField *, int);
extern int _wrap_CThostFtdcTraderApi_ReqQryCombPromotionParam(uintptr_t, struct CThostFtdcQryCombPromotionParamField *, int);
extern int _wrap_CThostFtdcTraderApi_ReqQryRiskSettleInvstPosition(uintptr_t, struct CThostFtdcQryRiskSettleInvstPositionField *, int);
extern int _wrap_CThostFtdcTraderApi_ReqQryRiskSettleProductStatus(uintptr_t, struct CThostFtdcQryRiskSettleProductStatusField *, int);
*/
import "C"
import (
"os"
"runtime"
"runtime/cgo"
"unsafe"
"github.com/pseudocodes/goctp/thost"
)
type TraderOption func(api *traderApi)
type traderApi struct {
apiPtr uintptr
spi TraderSpi
length int
systemInfo [273]byte
flowPath string
}
func TraderFlowPath(path string) TraderOption {
return func(api *traderApi) {
api.flowPath = path
}
}
func TraderSystemInfo(systemInfo []byte, length int) TraderOption {
return func(api *traderApi) {
api.length = length
copy(api.systemInfo[:], systemInfo)
}
}
func CreateTraderApi(options ...TraderOption) *traderApi {
api := &traderApi{
flowPath: defaultFlowPath,
}
handle := cgo.NewHandle(api)
for _, opt := range options {
opt(api)
}
if api.flowPath != "" {
if err := os.MkdirAll(api.flowPath, os.ModePerm); err != nil && !os.IsExist(err) {
panic(err)
}
}
cflowPath := C.CString(api.flowPath)
defer C.free(unsafe.Pointer(cflowPath))
api.apiPtr = uintptr(C._wrap_CThostFtdcTraderApi_CreateFtdcTraderApi2(C.uintptr_t(handle), cflowPath))
return api
}
// /获取API的版本信息
// /@retrun 获取到的版本号
func (c *traderApi) GetApiVersion() string {
cString := C._wrap_CThostFtdcTraderApi_GetApiVersion(C.uintptr_t(c.apiPtr))
return C.GoString(cString)
}
// 删除接口对象本身
// /@remark 不再使用本接口对象时,调用该函数删除接口对象
func (c *traderApi) Release() {
C._wrap_CThostFtdcTraderApi_Release(C.uintptr_t(c.apiPtr))
}
// 初始化
// /@remark 初始化运行环境,只有调用后,接口才开始工作
func (c *traderApi) Init() {
C._wrap_CThostFtdcTraderApi_Init(C.uintptr_t(c.apiPtr))
}
// 等待接口线程结束运行
// /@return 线程退出代码
func (c *traderApi) Join() int {
return (int)(C._wrap_CThostFtdcTraderApi_Join(C.uintptr_t(c.apiPtr)))
}
// /获取当前交易日
// /@retrun 获取到的交易日
// /@remark 只有登录成功后,才能得到正确的交易日
func (c *traderApi) GetTradingDay() string {
cString := C._wrap_CThostFtdcTraderApi_GetTradingDay(C.uintptr_t(c.apiPtr))
return C.GoString(cString)
}
func (c *traderApi) RegisterFront(frontAddress string) {
addr := C.CString(frontAddress)
defer C.free(unsafe.Pointer(addr))
C._wrap_CThostFtdcTraderApi_RegisterFront(C.uintptr_t(c.apiPtr), addr)
}
func (c *traderApi) RegisterNameServer(nsAddress string) {
addr := C.CString(nsAddress)
defer C.free(unsafe.Pointer(addr))
C._wrap_CThostFtdcTraderApi_RegisterNameServer(C.uintptr_t(c.apiPtr), addr)
}
// 注册名字服务器用户信息
// /@param pFensUserInfo:用户信息。
func (c *traderApi) RegisterFensUserInfo(pFensUserInfo *thost.CThostFtdcFensUserInfoField) {
C._wrap_CThostFtdcTraderApi_RegisterFensUserInfo(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcFensUserInfoField)(unsafe.Pointer(pFensUserInfo)))
}
// 注册回调接口
// /@param pSpi 派生自回调接口类的实例
func (c *traderApi) RegisterSpi(pSpi TraderSpi) {
c.spi = pSpi
}
// 订阅私有流。
// /@param nResumeType 私有流重传方式
// / THOST_TERT_RESTART:从本交易日开始重传
// / THOST_TERT_RESUME:从上次收到的续传
// / THOST_TERT_QUICK:只传送登录后私有流的内容
// /@remark 该方法要在Init方法前调用。若不调用则不会收到私有流的数据。
func (c *traderApi) SubscribePrivateTopic(nResumeType thost.THOST_TE_RESUME_TYPE) {
C._wrap_CThostFtdcTraderApi_SubscribePrivateTopic(C.uintptr_t(c.apiPtr), C.enum_THOST_TE_RESUME_TYPE(nResumeType))
}
// 订阅公共流。
// /@param nResumeType 公共流重传方式
// / THOST_TERT_RESTART:从本交易日开始重传
// / THOST_TERT_RESUME:从上次收到的续传
// / THOST_TERT_QUICK:只传送登录后公共流的内容
// / THOST_TERT_NONE:取消订阅公共流
// /@remark 该方法要在Init方法前调用。若不调用则不会收到公共流的数据。
func (c *traderApi) SubscribePublicTopic(nResumeType thost.THOST_TE_RESUME_TYPE) {
C._wrap_CThostFtdcTraderApi_SubscribePublicTopic(C.uintptr_t(c.apiPtr), C.enum_THOST_TE_RESUME_TYPE(nResumeType))
}
// 客户端认证请求
func (c *traderApi) ReqAuthenticate(pReqAuthenticateField *thost.CThostFtdcReqAuthenticateField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqAuthenticate(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcReqAuthenticateField)(unsafe.Pointer(pReqAuthenticateField)), C.int(nRequestID)))
}
// 注册用户终端信息,用于中继服务器多连接模式
// /需要在终端认证成功后,用户登录前调用该接口
func (c *traderApi) RegisterUserSystemInfo(pUserSystemInfo *thost.CThostFtdcUserSystemInfoField) int {
return (int)(C._wrap_CThostFtdcTraderApi_RegisterUserSystemInfo(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcUserSystemInfoField)(unsafe.Pointer(pUserSystemInfo))))
}
// 上报用户终端信息,用于中继服务器操作员登录模式
// /操作员登录后,可以多次调用该接口上报客户信息
func (c *traderApi) SubmitUserSystemInfo(pUserSystemInfo *thost.CThostFtdcUserSystemInfoField) int {
return (int)(C._wrap_CThostFtdcTraderApi_SubmitUserSystemInfo(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcUserSystemInfoField)(unsafe.Pointer(pUserSystemInfo))))
}
// 用户登录请求
func (c *traderApi) ReqUserLogin(pReqUserLoginField *thost.CThostFtdcReqUserLoginField, nRequestID int) int {
if runtime.GOOS != "darwin" {
return (int)(C._wrap_CThostFtdcTraderApi_ReqUserLogin(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcReqUserLoginField)(unsafe.Pointer(pReqUserLoginField)), C.int(nRequestID)))
}
if c.length == 0 {
return (int)(C._wrap_CThostFtdcTraderApi_ReqUserLoginMac(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcReqUserLoginField)(unsafe.Pointer(pReqUserLoginField)), C.int(nRequestID), C.int(0), (*C.char)(nil)))
}
out := (*C.char)(unsafe.Pointer(&c.systemInfo[0]))
return (int)(C._wrap_CThostFtdcTraderApi_ReqUserLoginMac(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcReqUserLoginField)(unsafe.Pointer(pReqUserLoginField)), C.int(nRequestID), C.int(c.length), out))
}
// 登出请求
func (c *traderApi) ReqUserLogout(pUserLogout *thost.CThostFtdcUserLogoutField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqUserLogout(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcUserLogoutField)(unsafe.Pointer(pUserLogout)), C.int(nRequestID)))
}
// 用户口令更新请求
func (c *traderApi) ReqUserPasswordUpdate(pUserPasswordUpdate *thost.CThostFtdcUserPasswordUpdateField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqUserPasswordUpdate(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcUserPasswordUpdateField)(unsafe.Pointer(pUserPasswordUpdate)), C.int(nRequestID)))
}
// 资金账户口令更新请求
func (c *traderApi) ReqTradingAccountPasswordUpdate(pTradingAccountPasswordUpdate *thost.CThostFtdcTradingAccountPasswordUpdateField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqTradingAccountPasswordUpdate(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcTradingAccountPasswordUpdateField)(unsafe.Pointer(pTradingAccountPasswordUpdate)), C.int(nRequestID)))
}
// 查询用户当前支持的认证模式
func (c *traderApi) ReqUserAuthMethod(pReqUserAuthMethod *thost.CThostFtdcReqUserAuthMethodField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqUserAuthMethod(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcReqUserAuthMethodField)(unsafe.Pointer(pReqUserAuthMethod)), C.int(nRequestID)))
}
// 用户发出获取图形验证码请求
func (c *traderApi) ReqGenUserCaptcha(pReqGenUserCaptcha *thost.CThostFtdcReqGenUserCaptchaField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqGenUserCaptcha(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcReqGenUserCaptchaField)(unsafe.Pointer(pReqGenUserCaptcha)), C.int(nRequestID)))
}
// 用户发出获取短信验证码请求
func (c *traderApi) ReqGenUserText(pReqGenUserText *thost.CThostFtdcReqGenUserTextField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqGenUserText(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcReqGenUserTextField)(unsafe.Pointer(pReqGenUserText)), C.int(nRequestID)))
}
// 用户发出带有图片验证码的登陆请求
func (c *traderApi) ReqUserLoginWithCaptcha(pReqUserLoginWithCaptcha *thost.CThostFtdcReqUserLoginWithCaptchaField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqUserLoginWithCaptcha(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcReqUserLoginWithCaptchaField)(unsafe.Pointer(pReqUserLoginWithCaptcha)), C.int(nRequestID)))
}
// 用户发出带有短信验证码的登陆请求
func (c *traderApi) ReqUserLoginWithText(pReqUserLoginWithText *thost.CThostFtdcReqUserLoginWithTextField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqUserLoginWithText(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcReqUserLoginWithTextField)(unsafe.Pointer(pReqUserLoginWithText)), C.int(nRequestID)))
}
// 用户发出带有动态口令的登陆请求
func (c *traderApi) ReqUserLoginWithOTP(pReqUserLoginWithOTP *thost.CThostFtdcReqUserLoginWithOTPField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqUserLoginWithOTP(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcReqUserLoginWithOTPField)(unsafe.Pointer(pReqUserLoginWithOTP)), C.int(nRequestID)))
}
// 报单录入请求
func (c *traderApi) ReqOrderInsert(pInputOrder *thost.CThostFtdcInputOrderField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqOrderInsert(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcInputOrderField)(unsafe.Pointer(pInputOrder)), C.int(nRequestID)))
}
// 预埋单录入请求
func (c *traderApi) ReqParkedOrderInsert(pParkedOrder *thost.CThostFtdcParkedOrderField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqParkedOrderInsert(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcParkedOrderField)(unsafe.Pointer(pParkedOrder)), C.int(nRequestID)))
}
// 预埋撤单录入请求
func (c *traderApi) ReqParkedOrderAction(pParkedOrderAction *thost.CThostFtdcParkedOrderActionField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqParkedOrderAction(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcParkedOrderActionField)(unsafe.Pointer(pParkedOrderAction)), C.int(nRequestID)))
}
// 报单操作请求
func (c *traderApi) ReqOrderAction(pInputOrderAction *thost.CThostFtdcInputOrderActionField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqOrderAction(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcInputOrderActionField)(unsafe.Pointer(pInputOrderAction)), C.int(nRequestID)))
}
// 查询最大报单数量请求
func (c *traderApi) ReqQryMaxOrderVolume(pQryMaxOrderVolume *thost.CThostFtdcQryMaxOrderVolumeField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqQryMaxOrderVolume(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcQryMaxOrderVolumeField)(unsafe.Pointer(pQryMaxOrderVolume)), C.int(nRequestID)))
}
// 投资者结算结果确认
func (c *traderApi) ReqSettlementInfoConfirm(pSettlementInfoConfirm *thost.CThostFtdcSettlementInfoConfirmField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqSettlementInfoConfirm(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcSettlementInfoConfirmField)(unsafe.Pointer(pSettlementInfoConfirm)), C.int(nRequestID)))
}
// 请求删除预埋单
func (c *traderApi) ReqRemoveParkedOrder(pRemoveParkedOrder *thost.CThostFtdcRemoveParkedOrderField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqRemoveParkedOrder(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcRemoveParkedOrderField)(unsafe.Pointer(pRemoveParkedOrder)), C.int(nRequestID)))
}
// 请求删除预埋撤单
func (c *traderApi) ReqRemoveParkedOrderAction(pRemoveParkedOrderAction *thost.CThostFtdcRemoveParkedOrderActionField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqRemoveParkedOrderAction(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcRemoveParkedOrderActionField)(unsafe.Pointer(pRemoveParkedOrderAction)), C.int(nRequestID)))
}
// 执行宣告录入请求
func (c *traderApi) ReqExecOrderInsert(pInputExecOrder *thost.CThostFtdcInputExecOrderField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqExecOrderInsert(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcInputExecOrderField)(unsafe.Pointer(pInputExecOrder)), C.int(nRequestID)))
}
// 执行宣告操作请求
func (c *traderApi) ReqExecOrderAction(pInputExecOrderAction *thost.CThostFtdcInputExecOrderActionField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqExecOrderAction(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcInputExecOrderActionField)(unsafe.Pointer(pInputExecOrderAction)), C.int(nRequestID)))
}
// 询价录入请求
func (c *traderApi) ReqForQuoteInsert(pInputForQuote *thost.CThostFtdcInputForQuoteField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqForQuoteInsert(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcInputForQuoteField)(unsafe.Pointer(pInputForQuote)), C.int(nRequestID)))
}
// 报价录入请求
func (c *traderApi) ReqQuoteInsert(pInputQuote *thost.CThostFtdcInputQuoteField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqQuoteInsert(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcInputQuoteField)(unsafe.Pointer(pInputQuote)), C.int(nRequestID)))
}
// 报价操作请求
func (c *traderApi) ReqQuoteAction(pInputQuoteAction *thost.CThostFtdcInputQuoteActionField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqQuoteAction(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcInputQuoteActionField)(unsafe.Pointer(pInputQuoteAction)), C.int(nRequestID)))
}
// 批量报单操作请求
func (c *traderApi) ReqBatchOrderAction(pInputBatchOrderAction *thost.CThostFtdcInputBatchOrderActionField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqBatchOrderAction(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcInputBatchOrderActionField)(unsafe.Pointer(pInputBatchOrderAction)), C.int(nRequestID)))
}
// 期权自对冲录入请求
func (c *traderApi) ReqOptionSelfCloseInsert(pInputOptionSelfClose *thost.CThostFtdcInputOptionSelfCloseField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqOptionSelfCloseInsert(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcInputOptionSelfCloseField)(unsafe.Pointer(pInputOptionSelfClose)), C.int(nRequestID)))
}
// 期权自对冲操作请求
func (c *traderApi) ReqOptionSelfCloseAction(pInputOptionSelfCloseAction *thost.CThostFtdcInputOptionSelfCloseActionField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqOptionSelfCloseAction(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcInputOptionSelfCloseActionField)(unsafe.Pointer(pInputOptionSelfCloseAction)), C.int(nRequestID)))
}
// 申请组合录入请求
func (c *traderApi) ReqCombActionInsert(pInputCombAction *thost.CThostFtdcInputCombActionField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqCombActionInsert(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcInputCombActionField)(unsafe.Pointer(pInputCombAction)), C.int(nRequestID)))
}
// 请求查询报单
func (c *traderApi) ReqQryOrder(pQryOrder *thost.CThostFtdcQryOrderField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqQryOrder(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcQryOrderField)(unsafe.Pointer(pQryOrder)), C.int(nRequestID)))
}
// 请求查询成交
func (c *traderApi) ReqQryTrade(pQryTrade *thost.CThostFtdcQryTradeField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqQryTrade(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcQryTradeField)(unsafe.Pointer(pQryTrade)), C.int(nRequestID)))
}
// 请求查询投资者持仓
func (c *traderApi) ReqQryInvestorPosition(pQryInvestorPosition *thost.CThostFtdcQryInvestorPositionField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqQryInvestorPosition(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcQryInvestorPositionField)(unsafe.Pointer(pQryInvestorPosition)), C.int(nRequestID)))
}
// 请求查询资金账户
func (c *traderApi) ReqQryTradingAccount(pQryTradingAccount *thost.CThostFtdcQryTradingAccountField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqQryTradingAccount(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcQryTradingAccountField)(unsafe.Pointer(pQryTradingAccount)), C.int(nRequestID)))
}
// 请求查询投资者
func (c *traderApi) ReqQryInvestor(pQryInvestor *thost.CThostFtdcQryInvestorField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqQryInvestor(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcQryInvestorField)(unsafe.Pointer(pQryInvestor)), C.int(nRequestID)))
}
// 请求查询交易编码
func (c *traderApi) ReqQryTradingCode(pQryTradingCode *thost.CThostFtdcQryTradingCodeField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqQryTradingCode(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcQryTradingCodeField)(unsafe.Pointer(pQryTradingCode)), C.int(nRequestID)))
}
// 请求查询合约保证金率
func (c *traderApi) ReqQryInstrumentMarginRate(pQryInstrumentMarginRate *thost.CThostFtdcQryInstrumentMarginRateField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqQryInstrumentMarginRate(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcQryInstrumentMarginRateField)(unsafe.Pointer(pQryInstrumentMarginRate)), C.int(nRequestID)))
}
// 请求查询合约手续费率
func (c *traderApi) ReqQryInstrumentCommissionRate(pQryInstrumentCommissionRate *thost.CThostFtdcQryInstrumentCommissionRateField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqQryInstrumentCommissionRate(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcQryInstrumentCommissionRateField)(unsafe.Pointer(pQryInstrumentCommissionRate)), C.int(nRequestID)))
}
// 请求查询交易所
func (c *traderApi) ReqQryExchange(pQryExchange *thost.CThostFtdcQryExchangeField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqQryExchange(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcQryExchangeField)(unsafe.Pointer(pQryExchange)), C.int(nRequestID)))
}
// 请求查询产品
func (c *traderApi) ReqQryProduct(pQryProduct *thost.CThostFtdcQryProductField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqQryProduct(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcQryProductField)(unsafe.Pointer(pQryProduct)), C.int(nRequestID)))
}
// 请求查询合约
func (c *traderApi) ReqQryInstrument(pQryInstrument *thost.CThostFtdcQryInstrumentField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqQryInstrument(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcQryInstrumentField)(unsafe.Pointer(pQryInstrument)), C.int(nRequestID)))
}
// 请求查询行情
func (c *traderApi) ReqQryDepthMarketData(pQryDepthMarketData *thost.CThostFtdcQryDepthMarketDataField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqQryDepthMarketData(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcQryDepthMarketDataField)(unsafe.Pointer(pQryDepthMarketData)), C.int(nRequestID)))
}
// 请求查询投资者结算结果
func (c *traderApi) ReqQrySettlementInfo(pQrySettlementInfo *thost.CThostFtdcQrySettlementInfoField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqQrySettlementInfo(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcQrySettlementInfoField)(unsafe.Pointer(pQrySettlementInfo)), C.int(nRequestID)))
}
// 请求查询转帐银行
func (c *traderApi) ReqQryTransferBank(pQryTransferBank *thost.CThostFtdcQryTransferBankField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqQryTransferBank(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcQryTransferBankField)(unsafe.Pointer(pQryTransferBank)), C.int(nRequestID)))
}
// 请求查询投资者持仓明细
func (c *traderApi) ReqQryInvestorPositionDetail(pQryInvestorPositionDetail *thost.CThostFtdcQryInvestorPositionDetailField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqQryInvestorPositionDetail(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcQryInvestorPositionDetailField)(unsafe.Pointer(pQryInvestorPositionDetail)), C.int(nRequestID)))
}
// 请求查询客户通知
func (c *traderApi) ReqQryNotice(pQryNotice *thost.CThostFtdcQryNoticeField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqQryNotice(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcQryNoticeField)(unsafe.Pointer(pQryNotice)), C.int(nRequestID)))
}
// 请求查询结算信息确认
func (c *traderApi) ReqQrySettlementInfoConfirm(pQrySettlementInfoConfirm *thost.CThostFtdcQrySettlementInfoConfirmField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqQrySettlementInfoConfirm(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcQrySettlementInfoConfirmField)(unsafe.Pointer(pQrySettlementInfoConfirm)), C.int(nRequestID)))
}
// 请求查询投资者持仓明细
func (c *traderApi) ReqQryInvestorPositionCombineDetail(pQryInvestorPositionCombineDetail *thost.CThostFtdcQryInvestorPositionCombineDetailField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqQryInvestorPositionCombineDetail(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcQryInvestorPositionCombineDetailField)(unsafe.Pointer(pQryInvestorPositionCombineDetail)), C.int(nRequestID)))
}
// 请求查询保证金监管系统经纪公司资金账户密钥
func (c *traderApi) ReqQryCFMMCTradingAccountKey(pQryCFMMCTradingAccountKey *thost.CThostFtdcQryCFMMCTradingAccountKeyField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqQryCFMMCTradingAccountKey(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcQryCFMMCTradingAccountKeyField)(unsafe.Pointer(pQryCFMMCTradingAccountKey)), C.int(nRequestID)))
}
// 请求查询仓单折抵信息
func (c *traderApi) ReqQryEWarrantOffset(pQryEWarrantOffset *thost.CThostFtdcQryEWarrantOffsetField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqQryEWarrantOffset(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcQryEWarrantOffsetField)(unsafe.Pointer(pQryEWarrantOffset)), C.int(nRequestID)))
}
// 请求查询投资者品种/跨品种保证金
func (c *traderApi) ReqQryInvestorProductGroupMargin(pQryInvestorProductGroupMargin *thost.CThostFtdcQryInvestorProductGroupMarginField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqQryInvestorProductGroupMargin(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcQryInvestorProductGroupMarginField)(unsafe.Pointer(pQryInvestorProductGroupMargin)), C.int(nRequestID)))
}
// 请求查询交易所保证金率
func (c *traderApi) ReqQryExchangeMarginRate(pQryExchangeMarginRate *thost.CThostFtdcQryExchangeMarginRateField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqQryExchangeMarginRate(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcQryExchangeMarginRateField)(unsafe.Pointer(pQryExchangeMarginRate)), C.int(nRequestID)))
}
// 请求查询交易所调整保证金率
func (c *traderApi) ReqQryExchangeMarginRateAdjust(pQryExchangeMarginRateAdjust *thost.CThostFtdcQryExchangeMarginRateAdjustField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqQryExchangeMarginRateAdjust(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcQryExchangeMarginRateAdjustField)(unsafe.Pointer(pQryExchangeMarginRateAdjust)), C.int(nRequestID)))
}
// 请求查询汇率
func (c *traderApi) ReqQryExchangeRate(pQryExchangeRate *thost.CThostFtdcQryExchangeRateField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqQryExchangeRate(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcQryExchangeRateField)(unsafe.Pointer(pQryExchangeRate)), C.int(nRequestID)))
}
// 请求查询二级代理操作员银期权限
func (c *traderApi) ReqQrySecAgentACIDMap(pQrySecAgentACIDMap *thost.CThostFtdcQrySecAgentACIDMapField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqQrySecAgentACIDMap(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcQrySecAgentACIDMapField)(unsafe.Pointer(pQrySecAgentACIDMap)), C.int(nRequestID)))
}
// 请求查询产品报价汇率
func (c *traderApi) ReqQryProductExchRate(pQryProductExchRate *thost.CThostFtdcQryProductExchRateField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqQryProductExchRate(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcQryProductExchRateField)(unsafe.Pointer(pQryProductExchRate)), C.int(nRequestID)))
}
// 请求查询产品组
func (c *traderApi) ReqQryProductGroup(pQryProductGroup *thost.CThostFtdcQryProductGroupField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqQryProductGroup(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcQryProductGroupField)(unsafe.Pointer(pQryProductGroup)), C.int(nRequestID)))
}
// 请求查询做市商合约手续费率
func (c *traderApi) ReqQryMMInstrumentCommissionRate(pQryMMInstrumentCommissionRate *thost.CThostFtdcQryMMInstrumentCommissionRateField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqQryMMInstrumentCommissionRate(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcQryMMInstrumentCommissionRateField)(unsafe.Pointer(pQryMMInstrumentCommissionRate)), C.int(nRequestID)))
}
// 请求查询做市商期权合约手续费
func (c *traderApi) ReqQryMMOptionInstrCommRate(pQryMMOptionInstrCommRate *thost.CThostFtdcQryMMOptionInstrCommRateField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqQryMMOptionInstrCommRate(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcQryMMOptionInstrCommRateField)(unsafe.Pointer(pQryMMOptionInstrCommRate)), C.int(nRequestID)))
}
// 请求查询报单手续费
func (c *traderApi) ReqQryInstrumentOrderCommRate(pQryInstrumentOrderCommRate *thost.CThostFtdcQryInstrumentOrderCommRateField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqQryInstrumentOrderCommRate(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcQryInstrumentOrderCommRateField)(unsafe.Pointer(pQryInstrumentOrderCommRate)), C.int(nRequestID)))
}
// 请求查询资金账户
func (c *traderApi) ReqQrySecAgentTradingAccount(pQryTradingAccount *thost.CThostFtdcQryTradingAccountField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqQrySecAgentTradingAccount(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcQryTradingAccountField)(unsafe.Pointer(pQryTradingAccount)), C.int(nRequestID)))
}
// 请求查询二级代理商资金校验模式
func (c *traderApi) ReqQrySecAgentCheckMode(pQrySecAgentCheckMode *thost.CThostFtdcQrySecAgentCheckModeField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqQrySecAgentCheckMode(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcQrySecAgentCheckModeField)(unsafe.Pointer(pQrySecAgentCheckMode)), C.int(nRequestID)))
}
// 请求查询二级代理商信息
func (c *traderApi) ReqQrySecAgentTradeInfo(pQrySecAgentTradeInfo *thost.CThostFtdcQrySecAgentTradeInfoField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqQrySecAgentTradeInfo(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcQrySecAgentTradeInfoField)(unsafe.Pointer(pQrySecAgentTradeInfo)), C.int(nRequestID)))
}
// 请求查询期权交易成本
func (c *traderApi) ReqQryOptionInstrTradeCost(pQryOptionInstrTradeCost *thost.CThostFtdcQryOptionInstrTradeCostField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqQryOptionInstrTradeCost(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcQryOptionInstrTradeCostField)(unsafe.Pointer(pQryOptionInstrTradeCost)), C.int(nRequestID)))
}
// 请求查询期权合约手续费
func (c *traderApi) ReqQryOptionInstrCommRate(pQryOptionInstrCommRate *thost.CThostFtdcQryOptionInstrCommRateField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqQryOptionInstrCommRate(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcQryOptionInstrCommRateField)(unsafe.Pointer(pQryOptionInstrCommRate)), C.int(nRequestID)))
}
// 请求查询执行宣告
func (c *traderApi) ReqQryExecOrder(pQryExecOrder *thost.CThostFtdcQryExecOrderField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqQryExecOrder(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcQryExecOrderField)(unsafe.Pointer(pQryExecOrder)), C.int(nRequestID)))
}
// 请求查询询价
func (c *traderApi) ReqQryForQuote(pQryForQuote *thost.CThostFtdcQryForQuoteField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqQryForQuote(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcQryForQuoteField)(unsafe.Pointer(pQryForQuote)), C.int(nRequestID)))
}
// 请求查询报价
func (c *traderApi) ReqQryQuote(pQryQuote *thost.CThostFtdcQryQuoteField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqQryQuote(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcQryQuoteField)(unsafe.Pointer(pQryQuote)), C.int(nRequestID)))
}
// 请求查询期权自对冲
func (c *traderApi) ReqQryOptionSelfClose(pQryOptionSelfClose *thost.CThostFtdcQryOptionSelfCloseField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqQryOptionSelfClose(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcQryOptionSelfCloseField)(unsafe.Pointer(pQryOptionSelfClose)), C.int(nRequestID)))
}
// 请求查询投资单元
func (c *traderApi) ReqQryInvestUnit(pQryInvestUnit *thost.CThostFtdcQryInvestUnitField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqQryInvestUnit(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcQryInvestUnitField)(unsafe.Pointer(pQryInvestUnit)), C.int(nRequestID)))
}
// 请求查询组合合约安全系数
func (c *traderApi) ReqQryCombInstrumentGuard(pQryCombInstrumentGuard *thost.CThostFtdcQryCombInstrumentGuardField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqQryCombInstrumentGuard(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcQryCombInstrumentGuardField)(unsafe.Pointer(pQryCombInstrumentGuard)), C.int(nRequestID)))
}
// 请求查询申请组合
func (c *traderApi) ReqQryCombAction(pQryCombAction *thost.CThostFtdcQryCombActionField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqQryCombAction(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcQryCombActionField)(unsafe.Pointer(pQryCombAction)), C.int(nRequestID)))
}
// 请求查询转帐流水
func (c *traderApi) ReqQryTransferSerial(pQryTransferSerial *thost.CThostFtdcQryTransferSerialField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqQryTransferSerial(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcQryTransferSerialField)(unsafe.Pointer(pQryTransferSerial)), C.int(nRequestID)))
}
// 请求查询银期签约关系
func (c *traderApi) ReqQryAccountregister(pQryAccountregister *thost.CThostFtdcQryAccountregisterField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqQryAccountregister(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcQryAccountregisterField)(unsafe.Pointer(pQryAccountregister)), C.int(nRequestID)))
}
// 请求查询签约银行
func (c *traderApi) ReqQryContractBank(pQryContractBank *thost.CThostFtdcQryContractBankField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqQryContractBank(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcQryContractBankField)(unsafe.Pointer(pQryContractBank)), C.int(nRequestID)))
}
// 请求查询预埋单
func (c *traderApi) ReqQryParkedOrder(pQryParkedOrder *thost.CThostFtdcQryParkedOrderField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqQryParkedOrder(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcQryParkedOrderField)(unsafe.Pointer(pQryParkedOrder)), C.int(nRequestID)))
}
// 请求查询预埋撤单
func (c *traderApi) ReqQryParkedOrderAction(pQryParkedOrderAction *thost.CThostFtdcQryParkedOrderActionField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqQryParkedOrderAction(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcQryParkedOrderActionField)(unsafe.Pointer(pQryParkedOrderAction)), C.int(nRequestID)))
}
// 请求查询交易通知
func (c *traderApi) ReqQryTradingNotice(pQryTradingNotice *thost.CThostFtdcQryTradingNoticeField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqQryTradingNotice(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcQryTradingNoticeField)(unsafe.Pointer(pQryTradingNotice)), C.int(nRequestID)))
}
// 请求查询经纪公司交易参数
func (c *traderApi) ReqQryBrokerTradingParams(pQryBrokerTradingParams *thost.CThostFtdcQryBrokerTradingParamsField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqQryBrokerTradingParams(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcQryBrokerTradingParamsField)(unsafe.Pointer(pQryBrokerTradingParams)), C.int(nRequestID)))
}
// 请求查询经纪公司交易算法
func (c *traderApi) ReqQryBrokerTradingAlgos(pQryBrokerTradingAlgos *thost.CThostFtdcQryBrokerTradingAlgosField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqQryBrokerTradingAlgos(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcQryBrokerTradingAlgosField)(unsafe.Pointer(pQryBrokerTradingAlgos)), C.int(nRequestID)))
}
// 请求查询监控中心用户令牌
func (c *traderApi) ReqQueryCFMMCTradingAccountToken(pQueryCFMMCTradingAccountToken *thost.CThostFtdcQueryCFMMCTradingAccountTokenField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqQueryCFMMCTradingAccountToken(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcQueryCFMMCTradingAccountTokenField)(unsafe.Pointer(pQueryCFMMCTradingAccountToken)), C.int(nRequestID)))
}
// 期货发起银行资金转期货请求
func (c *traderApi) ReqFromBankToFutureByFuture(pReqTransfer *thost.CThostFtdcReqTransferField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqFromBankToFutureByFuture(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcReqTransferField)(unsafe.Pointer(pReqTransfer)), C.int(nRequestID)))
}
// 期货发起期货资金转银行请求
func (c *traderApi) ReqFromFutureToBankByFuture(pReqTransfer *thost.CThostFtdcReqTransferField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqFromFutureToBankByFuture(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcReqTransferField)(unsafe.Pointer(pReqTransfer)), C.int(nRequestID)))
}
// 期货发起查询银行余额请求
func (c *traderApi) ReqQueryBankAccountMoneyByFuture(pReqQueryAccount *thost.CThostFtdcReqQueryAccountField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqQueryBankAccountMoneyByFuture(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcReqQueryAccountField)(unsafe.Pointer(pReqQueryAccount)), C.int(nRequestID)))
}
// 请求查询分类合约
func (c *traderApi) ReqQryClassifiedInstrument(pQryClassifiedInstrument *thost.CThostFtdcQryClassifiedInstrumentField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqQryClassifiedInstrument(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcQryClassifiedInstrumentField)(unsafe.Pointer(pQryClassifiedInstrument)), C.int(nRequestID)))
}
// 请求组合优惠比例
func (c *traderApi) ReqQryCombPromotionParam(pQryCombPromotionParam *thost.CThostFtdcQryCombPromotionParamField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqQryCombPromotionParam(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcQryCombPromotionParamField)(unsafe.Pointer(pQryCombPromotionParam)), C.int(nRequestID)))
}
// 投资者风险结算持仓查询
func (c *traderApi) ReqQryRiskSettleInvstPosition(pQryRiskSettleInvstPosition *thost.CThostFtdcQryRiskSettleInvstPositionField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqQryRiskSettleInvstPosition(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcQryRiskSettleInvstPositionField)(unsafe.Pointer(pQryRiskSettleInvstPosition)), C.int(nRequestID)))
}
// 风险结算产品查询
func (c *traderApi) ReqQryRiskSettleProductStatus(pQryRiskSettleProductStatus *thost.CThostFtdcQryRiskSettleProductStatusField, nRequestID int) int {
return (int)(C._wrap_CThostFtdcTraderApi_ReqQryRiskSettleProductStatus(C.uintptr_t(c.apiPtr), (*C.struct_CThostFtdcQryRiskSettleProductStatusField)(unsafe.Pointer(pQryRiskSettleProductStatus)), C.int(nRequestID)))
}
//------------------------------------------------------------------------------------
//export wrapTraderOnFrontConnected
func wrapTraderOnFrontConnected(v uintptr) {
api := cgo.Handle(v).Value().(*traderApi)
api.spi.OnFrontConnected()
}
//export wrapTraderOnFrontDisconnected
func wrapTraderOnFrontDisconnected(v uintptr, nReason C.int) {
api := cgo.Handle(v).Value().(*traderApi)
api.spi.OnFrontDisconnected(int(nReason))
}
//export wrapTraderOnHeartBeatWarning
func wrapTraderOnHeartBeatWarning(v uintptr, nTimeLapse C.int) {
api := cgo.Handle(v).Value().(*traderApi)
api.spi.OnHeartBeatWarning(int(nTimeLapse))
}
//export wrapTraderOnRspAuthenticate
func wrapTraderOnRspAuthenticate(v uintptr, pRspAuthenticateField *C.struct_CThostFtdcRspAuthenticateField, pRspInfo *C.struct_CThostFtdcRspInfoField, nRequestID C.int, bIsLast C._Bool) {
api := cgo.Handle(v).Value().(*traderApi)
api.spi.OnRspAuthenticate((*thost.CThostFtdcRspAuthenticateField)(unsafe.Pointer(pRspAuthenticateField)), (*thost.CThostFtdcRspInfoField)(unsafe.Pointer(pRspInfo)), int(nRequestID), bool(bIsLast))
}
//export wrapTraderOnRspUserLogin
func wrapTraderOnRspUserLogin(v uintptr, pRspUserLogin *C.struct_CThostFtdcRspUserLoginField, pRspInfo *C.struct_CThostFtdcRspInfoField, nRequestID C.int, bIsLast C._Bool) {
api := cgo.Handle(v).Value().(*traderApi)
api.spi.OnRspUserLogin((*thost.CThostFtdcRspUserLoginField)(unsafe.Pointer(pRspUserLogin)), (*thost.CThostFtdcRspInfoField)(unsafe.Pointer(pRspInfo)), int(nRequestID), bool(bIsLast))
}
//export wrapTraderOnRspUserLogout
func wrapTraderOnRspUserLogout(v uintptr, pUserLogout *C.struct_CThostFtdcUserLogoutField, pRspInfo *C.struct_CThostFtdcRspInfoField, nRequestID C.int, bIsLast C._Bool) {
api := cgo.Handle(v).Value().(*traderApi)
api.spi.OnRspUserLogout((*thost.CThostFtdcUserLogoutField)(unsafe.Pointer(pUserLogout)), (*thost.CThostFtdcRspInfoField)(unsafe.Pointer(pRspInfo)), int(nRequestID), bool(bIsLast))
}
//export wrapTraderOnRspUserPasswordUpdate
func wrapTraderOnRspUserPasswordUpdate(v uintptr, pUserPasswordUpdate *C.struct_CThostFtdcUserPasswordUpdateField, pRspInfo *C.struct_CThostFtdcRspInfoField, nRequestID C.int, bIsLast C._Bool) {
api := cgo.Handle(v).Value().(*traderApi)
api.spi.OnRspUserPasswordUpdate((*thost.CThostFtdcUserPasswordUpdateField)(unsafe.Pointer(pUserPasswordUpdate)), (*thost.CThostFtdcRspInfoField)(unsafe.Pointer(pRspInfo)), int(nRequestID), bool(bIsLast))
}
//export wrapTraderOnRspTradingAccountPasswordUpdate
func wrapTraderOnRspTradingAccountPasswordUpdate(v uintptr, pTradingAccountPasswordUpdate *C.struct_CThostFtdcTradingAccountPasswordUpdateField, pRspInfo *C.struct_CThostFtdcRspInfoField, nRequestID C.int, bIsLast C._Bool) {
api := cgo.Handle(v).Value().(*traderApi)
api.spi.OnRspTradingAccountPasswordUpdate((*thost.CThostFtdcTradingAccountPasswordUpdateField)(unsafe.Pointer(pTradingAccountPasswordUpdate)), (*thost.CThostFtdcRspInfoField)(unsafe.Pointer(pRspInfo)), int(nRequestID), bool(bIsLast))
}
//export wrapTraderOnRspUserAuthMethod
func wrapTraderOnRspUserAuthMethod(v uintptr, pRspUserAuthMethod *C.struct_CThostFtdcRspUserAuthMethodField, pRspInfo *C.struct_CThostFtdcRspInfoField, nRequestID C.int, bIsLast C._Bool) {
api := cgo.Handle(v).Value().(*traderApi)
api.spi.OnRspUserAuthMethod((*thost.CThostFtdcRspUserAuthMethodField)(unsafe.Pointer(pRspUserAuthMethod)), (*thost.CThostFtdcRspInfoField)(unsafe.Pointer(pRspInfo)), int(nRequestID), bool(bIsLast))
}
//export wrapTraderOnRspGenUserCaptcha
func wrapTraderOnRspGenUserCaptcha(v uintptr, pRspGenUserCaptcha *C.struct_CThostFtdcRspGenUserCaptchaField, pRspInfo *C.struct_CThostFtdcRspInfoField, nRequestID C.int, bIsLast C._Bool) {
api := cgo.Handle(v).Value().(*traderApi)
api.spi.OnRspGenUserCaptcha((*thost.CThostFtdcRspGenUserCaptchaField)(unsafe.Pointer(pRspGenUserCaptcha)), (*thost.CThostFtdcRspInfoField)(unsafe.Pointer(pRspInfo)), int(nRequestID), bool(bIsLast))
}
//export wrapTraderOnRspGenUserText
func wrapTraderOnRspGenUserText(v uintptr, pRspGenUserText *C.struct_CThostFtdcRspGenUserTextField, pRspInfo *C.struct_CThostFtdcRspInfoField, nRequestID C.int, bIsLast C._Bool) {
api := cgo.Handle(v).Value().(*traderApi)
api.spi.OnRspGenUserText((*thost.CThostFtdcRspGenUserTextField)(unsafe.Pointer(pRspGenUserText)), (*thost.CThostFtdcRspInfoField)(unsafe.Pointer(pRspInfo)), int(nRequestID), bool(bIsLast))
}
//export wrapTraderOnRspOrderInsert
func wrapTraderOnRspOrderInsert(v uintptr, pInputOrder *C.struct_CThostFtdcInputOrderField, pRspInfo *C.struct_CThostFtdcRspInfoField, nRequestID C.int, bIsLast C._Bool) {
api := cgo.Handle(v).Value().(*traderApi)
api.spi.OnRspOrderInsert((*thost.CThostFtdcInputOrderField)(unsafe.Pointer(pInputOrder)), (*thost.CThostFtdcRspInfoField)(unsafe.Pointer(pRspInfo)), int(nRequestID), bool(bIsLast))
}
//export wrapTraderOnRspParkedOrderInsert
func wrapTraderOnRspParkedOrderInsert(v uintptr, pParkedOrder *C.struct_CThostFtdcParkedOrderField, pRspInfo *C.struct_CThostFtdcRspInfoField, nRequestID C.int, bIsLast C._Bool) {
api := cgo.Handle(v).Value().(*traderApi)
api.spi.OnRspParkedOrderInsert((*thost.CThostFtdcParkedOrderField)(unsafe.Pointer(pParkedOrder)), (*thost.CThostFtdcRspInfoField)(unsafe.Pointer(pRspInfo)), int(nRequestID), bool(bIsLast))
}
//export wrapTraderOnRspParkedOrderAction
func wrapTraderOnRspParkedOrderAction(v uintptr, pParkedOrderAction *C.struct_CThostFtdcParkedOrderActionField, pRspInfo *C.struct_CThostFtdcRspInfoField, nRequestID C.int, bIsLast C._Bool) {
api := cgo.Handle(v).Value().(*traderApi)
api.spi.OnRspParkedOrderAction((*thost.CThostFtdcParkedOrderActionField)(unsafe.Pointer(pParkedOrderAction)), (*thost.CThostFtdcRspInfoField)(unsafe.Pointer(pRspInfo)), int(nRequestID), bool(bIsLast))
}
//export wrapTraderOnRspOrderAction
func wrapTraderOnRspOrderAction(v uintptr, pInputOrderAction *C.struct_CThostFtdcInputOrderActionField, pRspInfo *C.struct_CThostFtdcRspInfoField, nRequestID C.int, bIsLast C._Bool) {
api := cgo.Handle(v).Value().(*traderApi)
api.spi.OnRspOrderAction((*thost.CThostFtdcInputOrderActionField)(unsafe.Pointer(pInputOrderAction)), (*thost.CThostFtdcRspInfoField)(unsafe.Pointer(pRspInfo)), int(nRequestID), bool(bIsLast))
}
//export wrapTraderOnRspQryMaxOrderVolume
func wrapTraderOnRspQryMaxOrderVolume(v uintptr, pQryMaxOrderVolume *C.struct_CThostFtdcQryMaxOrderVolumeField, pRspInfo *C.struct_CThostFtdcRspInfoField, nRequestID C.int, bIsLast C._Bool) {
api := cgo.Handle(v).Value().(*traderApi)
api.spi.OnRspQryMaxOrderVolume((*thost.CThostFtdcQryMaxOrderVolumeField)(unsafe.Pointer(pQryMaxOrderVolume)), (*thost.CThostFtdcRspInfoField)(unsafe.Pointer(pRspInfo)), int(nRequestID), bool(bIsLast))
}
//export wrapTraderOnRspSettlementInfoConfirm
func wrapTraderOnRspSettlementInfoConfirm(v uintptr, pSettlementInfoConfirm *C.struct_CThostFtdcSettlementInfoConfirmField, pRspInfo *C.struct_CThostFtdcRspInfoField, nRequestID C.int, bIsLast C._Bool) {
api := cgo.Handle(v).Value().(*traderApi)
api.spi.OnRspSettlementInfoConfirm((*thost.CThostFtdcSettlementInfoConfirmField)(unsafe.Pointer(pSettlementInfoConfirm)), (*thost.CThostFtdcRspInfoField)(unsafe.Pointer(pRspInfo)), int(nRequestID), bool(bIsLast))
}
//export wrapTraderOnRspRemoveParkedOrder
func wrapTraderOnRspRemoveParkedOrder(v uintptr, pRemoveParkedOrder *C.struct_CThostFtdcRemoveParkedOrderField, pRspInfo *C.struct_CThostFtdcRspInfoField, nRequestID C.int, bIsLast C._Bool) {
api := cgo.Handle(v).Value().(*traderApi)
api.spi.OnRspRemoveParkedOrder((*thost.CThostFtdcRemoveParkedOrderField)(unsafe.Pointer(pRemoveParkedOrder)), (*thost.CThostFtdcRspInfoField)(unsafe.Pointer(pRspInfo)), int(nRequestID), bool(bIsLast))
}
//export wrapTraderOnRspRemoveParkedOrderAction
func wrapTraderOnRspRemoveParkedOrderAction(v uintptr, pRemoveParkedOrderAction *C.struct_CThostFtdcRemoveParkedOrderActionField, pRspInfo *C.struct_CThostFtdcRspInfoField, nRequestID C.int, bIsLast C._Bool) {
api := cgo.Handle(v).Value().(*traderApi)
api.spi.OnRspRemoveParkedOrderAction((*thost.CThostFtdcRemoveParkedOrderActionField)(unsafe.Pointer(pRemoveParkedOrderAction)), (*thost.CThostFtdcRspInfoField)(unsafe.Pointer(pRspInfo)), int(nRequestID), bool(bIsLast))
}
//export wrapTraderOnRspExecOrderInsert
func wrapTraderOnRspExecOrderInsert(v uintptr, pInputExecOrder *C.struct_CThostFtdcInputExecOrderField, pRspInfo *C.struct_CThostFtdcRspInfoField, nRequestID C.int, bIsLast C._Bool) {
api := cgo.Handle(v).Value().(*traderApi)
api.spi.OnRspExecOrderInsert((*thost.CThostFtdcInputExecOrderField)(unsafe.Pointer(pInputExecOrder)), (*thost.CThostFtdcRspInfoField)(unsafe.Pointer(pRspInfo)), int(nRequestID), bool(bIsLast))
}
//export wrapTraderOnRspExecOrderAction
func wrapTraderOnRspExecOrderAction(v uintptr, pInputExecOrderAction *C.struct_CThostFtdcInputExecOrderActionField, pRspInfo *C.struct_CThostFtdcRspInfoField, nRequestID C.int, bIsLast C._Bool) {
api := cgo.Handle(v).Value().(*traderApi)
api.spi.OnRspExecOrderAction((*thost.CThostFtdcInputExecOrderActionField)(unsafe.Pointer(pInputExecOrderAction)), (*thost.CThostFtdcRspInfoField)(unsafe.Pointer(pRspInfo)), int(nRequestID), bool(bIsLast))
}
//export wrapTraderOnRspForQuoteInsert
func wrapTraderOnRspForQuoteInsert(v uintptr, pInputForQuote *C.struct_CThostFtdcInputForQuoteField, pRspInfo *C.struct_CThostFtdcRspInfoField, nRequestID C.int, bIsLast C._Bool) {
api := cgo.Handle(v).Value().(*traderApi)
api.spi.OnRspForQuoteInsert((*thost.CThostFtdcInputForQuoteField)(unsafe.Pointer(pInputForQuote)), (*thost.CThostFtdcRspInfoField)(unsafe.Pointer(pRspInfo)), int(nRequestID), bool(bIsLast))
}
//export wrapTraderOnRspQuoteInsert
func wrapTraderOnRspQuoteInsert(v uintptr, pInputQuote *C.struct_CThostFtdcInputQuoteField, pRspInfo *C.struct_CThostFtdcRspInfoField, nRequestID C.int, bIsLast C._Bool) {
api := cgo.Handle(v).Value().(*traderApi)
api.spi.OnRspQuoteInsert((*thost.CThostFtdcInputQuoteField)(unsafe.Pointer(pInputQuote)), (*thost.CThostFtdcRspInfoField)(unsafe.Pointer(pRspInfo)), int(nRequestID), bool(bIsLast))
}
//export wrapTraderOnRspQuoteAction
func wrapTraderOnRspQuoteAction(v uintptr, pInputQuoteAction *C.struct_CThostFtdcInputQuoteActionField, pRspInfo *C.struct_CThostFtdcRspInfoField, nRequestID C.int, bIsLast C._Bool) {
api := cgo.Handle(v).Value().(*traderApi)
api.spi.OnRspQuoteAction((*thost.CThostFtdcInputQuoteActionField)(unsafe.Pointer(pInputQuoteAction)), (*thost.CThostFtdcRspInfoField)(unsafe.Pointer(pRspInfo)), int(nRequestID), bool(bIsLast))
}
//export wrapTraderOnRspBatchOrderAction
func wrapTraderOnRspBatchOrderAction(v uintptr, pInputBatchOrderAction *C.struct_CThostFtdcInputBatchOrderActionField, pRspInfo *C.struct_CThostFtdcRspInfoField, nRequestID C.int, bIsLast C._Bool) {
api := cgo.Handle(v).Value().(*traderApi)
api.spi.OnRspBatchOrderAction((*thost.CThostFtdcInputBatchOrderActionField)(unsafe.Pointer(pInputBatchOrderAction)), (*thost.CThostFtdcRspInfoField)(unsafe.Pointer(pRspInfo)), int(nRequestID), bool(bIsLast))
}
//export wrapTraderOnRspOptionSelfCloseInsert
func wrapTraderOnRspOptionSelfCloseInsert(v uintptr, pInputOptionSelfClose *C.struct_CThostFtdcInputOptionSelfCloseField, pRspInfo *C.struct_CThostFtdcRspInfoField, nRequestID C.int, bIsLast C._Bool) {
api := cgo.Handle(v).Value().(*traderApi)
api.spi.OnRspOptionSelfCloseInsert((*thost.CThostFtdcInputOptionSelfCloseField)(unsafe.Pointer(pInputOptionSelfClose)), (*thost.CThostFtdcRspInfoField)(unsafe.Pointer(pRspInfo)), int(nRequestID), bool(bIsLast))
}
//export wrapTraderOnRspOptionSelfCloseAction
func wrapTraderOnRspOptionSelfCloseAction(v uintptr, pInputOptionSelfCloseAction *C.struct_CThostFtdcInputOptionSelfCloseActionField, pRspInfo *C.struct_CThostFtdcRspInfoField, nRequestID C.int, bIsLast C._Bool) {
api := cgo.Handle(v).Value().(*traderApi)
api.spi.OnRspOptionSelfCloseAction((*thost.CThostFtdcInputOptionSelfCloseActionField)(unsafe.Pointer(pInputOptionSelfCloseAction)), (*thost.CThostFtdcRspInfoField)(unsafe.Pointer(pRspInfo)), int(nRequestID), bool(bIsLast))
}
//export wrapTraderOnRspCombActionInsert
func wrapTraderOnRspCombActionInsert(v uintptr, pInputCombAction *C.struct_CThostFtdcInputCombActionField, pRspInfo *C.struct_CThostFtdcRspInfoField, nRequestID C.int, bIsLast C._Bool) {
api := cgo.Handle(v).Value().(*traderApi)
api.spi.OnRspCombActionInsert((*thost.CThostFtdcInputCombActionField)(unsafe.Pointer(pInputCombAction)), (*thost.CThostFtdcRspInfoField)(unsafe.Pointer(pRspInfo)), int(nRequestID), bool(bIsLast))
}
//export wrapTraderOnRspQryOrder
func wrapTraderOnRspQryOrder(v uintptr, pOrder *C.struct_CThostFtdcOrderField, pRspInfo *C.struct_CThostFtdcRspInfoField, nRequestID C.int, bIsLast C._Bool) {
api := cgo.Handle(v).Value().(*traderApi)
api.spi.OnRspQryOrder((*thost.CThostFtdcOrderField)(unsafe.Pointer(pOrder)), (*thost.CThostFtdcRspInfoField)(unsafe.Pointer(pRspInfo)), int(nRequestID), bool(bIsLast))
}
//export wrapTraderOnRspQryTrade
func wrapTraderOnRspQryTrade(v uintptr, pTrade *C.struct_CThostFtdcTradeField, pRspInfo *C.struct_CThostFtdcRspInfoField, nRequestID C.int, bIsLast C._Bool) {
api := cgo.Handle(v).Value().(*traderApi)
api.spi.OnRspQryTrade((*thost.CThostFtdcTradeField)(unsafe.Pointer(pTrade)), (*thost.CThostFtdcRspInfoField)(unsafe.Pointer(pRspInfo)), int(nRequestID), bool(bIsLast))
}
//export wrapTraderOnRspQryInvestorPosition
func wrapTraderOnRspQryInvestorPosition(v uintptr, pInvestorPosition *C.struct_CThostFtdcInvestorPositionField, pRspInfo *C.struct_CThostFtdcRspInfoField, nRequestID C.int, bIsLast C._Bool) {
api := cgo.Handle(v).Value().(*traderApi)
api.spi.OnRspQryInvestorPosition((*thost.CThostFtdcInvestorPositionField)(unsafe.Pointer(pInvestorPosition)), (*thost.CThostFtdcRspInfoField)(unsafe.Pointer(pRspInfo)), int(nRequestID), bool(bIsLast))
}
//export wrapTraderOnRspQryTradingAccount
func wrapTraderOnRspQryTradingAccount(v uintptr, pTradingAccount *C.struct_CThostFtdcTradingAccountField, pRspInfo *C.struct_CThostFtdcRspInfoField, nRequestID C.int, bIsLast C._Bool) {
api := cgo.Handle(v).Value().(*traderApi)