/
Nasdaq.Psx.TotalView.Itch.v5.0.Script.Dissector.lua
3838 lines (2965 loc) · 160 KB
/
Nasdaq.Psx.TotalView.Itch.v5.0.Script.Dissector.lua
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
-----------------------------------------------------------------------
-- Lua Script Wireshark Dissector
--
-- Please see end of file for rules and regulations
-----------------------------------------------------------------------
-- Nasdaq Psx TotalView Itch 5.0 Protocol
local nasdaq_psx_totalview_itch_v5_0 = Proto("Nasdaq.Psx.TotalView.Itch.v5.0.Lua", "Nasdaq Psx TotalView Itch 5.0")
-- Component Tables
local show = {}
local format = {}
local nasdaq_psx_totalview_itch_v5_0_display = {}
local nasdaq_psx_totalview_itch_v5_0_dissect = {}
local nasdaq_psx_totalview_itch_v5_0_size_of = {}
local verify = {}
local translate = {}
-----------------------------------------------------------------------
-- Declare Protocol Fields
-----------------------------------------------------------------------
-- Nasdaq Psx TotalView Itch 5.0 Fields
nasdaq_psx_totalview_itch_v5_0.fields.add_order_no_mpid_attribution_message = ProtoField.new("Add Order No Mpid Attribution Message", "nasdaq.psx.totalview.itch.v5.0.addordernompidattributionmessage", ftypes.STRING)
nasdaq_psx_totalview_itch_v5_0.fields.add_order_with_mpid_attribution_message = ProtoField.new("Add Order With Mpid Attribution Message", "nasdaq.psx.totalview.itch.v5.0.addorderwithmpidattributionmessage", ftypes.STRING)
nasdaq_psx_totalview_itch_v5_0.fields.attribution = ProtoField.new("Attribution", "nasdaq.psx.totalview.itch.v5.0.attribution", ftypes.STRING)
nasdaq_psx_totalview_itch_v5_0.fields.auction_collar_extension = ProtoField.new("Auction Collar Extension", "nasdaq.psx.totalview.itch.v5.0.auctioncollarextension", ftypes.UINT32)
nasdaq_psx_totalview_itch_v5_0.fields.auction_collar_reference_price = ProtoField.new("Auction Collar Reference Price", "nasdaq.psx.totalview.itch.v5.0.auctioncollarreferenceprice", ftypes.DOUBLE)
nasdaq_psx_totalview_itch_v5_0.fields.authenticity = ProtoField.new("Authenticity", "nasdaq.psx.totalview.itch.v5.0.authenticity", ftypes.STRING)
nasdaq_psx_totalview_itch_v5_0.fields.breached_level = ProtoField.new("Breached Level", "nasdaq.psx.totalview.itch.v5.0.breachedlevel", ftypes.STRING)
nasdaq_psx_totalview_itch_v5_0.fields.broken_trade_message = ProtoField.new("Broken Trade Message", "nasdaq.psx.totalview.itch.v5.0.brokentrademessage", ftypes.STRING)
nasdaq_psx_totalview_itch_v5_0.fields.buy_sell_indicator = ProtoField.new("Buy Sell Indicator", "nasdaq.psx.totalview.itch.v5.0.buysellindicator", ftypes.STRING)
nasdaq_psx_totalview_itch_v5_0.fields.canceled_shares = ProtoField.new("Canceled Shares", "nasdaq.psx.totalview.itch.v5.0.canceledshares", ftypes.UINT32)
nasdaq_psx_totalview_itch_v5_0.fields.count = ProtoField.new("Count", "nasdaq.psx.totalview.itch.v5.0.count", ftypes.UINT16)
nasdaq_psx_totalview_itch_v5_0.fields.cross_price = ProtoField.new("Cross Price", "nasdaq.psx.totalview.itch.v5.0.crossprice", ftypes.DOUBLE)
nasdaq_psx_totalview_itch_v5_0.fields.cross_shares = ProtoField.new("Cross Shares", "nasdaq.psx.totalview.itch.v5.0.crossshares", ftypes.UINT64)
nasdaq_psx_totalview_itch_v5_0.fields.cross_trade_message = ProtoField.new("Cross Trade Message", "nasdaq.psx.totalview.itch.v5.0.crosstrademessage", ftypes.STRING)
nasdaq_psx_totalview_itch_v5_0.fields.cross_type = ProtoField.new("Cross Type", "nasdaq.psx.totalview.itch.v5.0.crosstype", ftypes.STRING)
nasdaq_psx_totalview_itch_v5_0.fields.current_reference_price = ProtoField.new("Current Reference Price", "nasdaq.psx.totalview.itch.v5.0.currentreferenceprice", ftypes.DOUBLE)
nasdaq_psx_totalview_itch_v5_0.fields.etp_flag = ProtoField.new("Etp Flag", "nasdaq.psx.totalview.itch.v5.0.etpflag", ftypes.STRING)
nasdaq_psx_totalview_itch_v5_0.fields.etp_leverage_factor = ProtoField.new("Etp Leverage Factor", "nasdaq.psx.totalview.itch.v5.0.etpleveragefactor", ftypes.UINT32)
nasdaq_psx_totalview_itch_v5_0.fields.event_code = ProtoField.new("Event Code", "nasdaq.psx.totalview.itch.v5.0.eventcode", ftypes.STRING)
nasdaq_psx_totalview_itch_v5_0.fields.executed_shares = ProtoField.new("Executed Shares", "nasdaq.psx.totalview.itch.v5.0.executedshares", ftypes.UINT32)
nasdaq_psx_totalview_itch_v5_0.fields.execution_price = ProtoField.new("Execution Price", "nasdaq.psx.totalview.itch.v5.0.executionprice", ftypes.DOUBLE)
nasdaq_psx_totalview_itch_v5_0.fields.far_price = ProtoField.new("Far Price", "nasdaq.psx.totalview.itch.v5.0.farprice", ftypes.DOUBLE)
nasdaq_psx_totalview_itch_v5_0.fields.financial_status_indicator = ProtoField.new("Financial Status Indicator", "nasdaq.psx.totalview.itch.v5.0.financialstatusindicator", ftypes.STRING)
nasdaq_psx_totalview_itch_v5_0.fields.imbalance_direction = ProtoField.new("Imbalance Direction", "nasdaq.psx.totalview.itch.v5.0.imbalancedirection", ftypes.STRING)
nasdaq_psx_totalview_itch_v5_0.fields.imbalance_shares = ProtoField.new("Imbalance Shares", "nasdaq.psx.totalview.itch.v5.0.imbalanceshares", ftypes.UINT64)
nasdaq_psx_totalview_itch_v5_0.fields.inverse_indicator = ProtoField.new("Inverse Indicator", "nasdaq.psx.totalview.itch.v5.0.inverseindicator", ftypes.STRING)
nasdaq_psx_totalview_itch_v5_0.fields.ipo_flag = ProtoField.new("Ipo Flag", "nasdaq.psx.totalview.itch.v5.0.ipoflag", ftypes.STRING)
nasdaq_psx_totalview_itch_v5_0.fields.issue_classification = ProtoField.new("Issue Classification", "nasdaq.psx.totalview.itch.v5.0.issueclassification", ftypes.STRING)
nasdaq_psx_totalview_itch_v5_0.fields.issue_sub_type = ProtoField.new("Issue Sub Type", "nasdaq.psx.totalview.itch.v5.0.issuesubtype", ftypes.STRING)
nasdaq_psx_totalview_itch_v5_0.fields.length = ProtoField.new("Length", "nasdaq.psx.totalview.itch.v5.0.length", ftypes.UINT16)
nasdaq_psx_totalview_itch_v5_0.fields.level_1 = ProtoField.new("Level 1", "nasdaq.psx.totalview.itch.v5.0.level1", ftypes.DOUBLE)
nasdaq_psx_totalview_itch_v5_0.fields.level_2 = ProtoField.new("Level 2", "nasdaq.psx.totalview.itch.v5.0.level2", ftypes.DOUBLE)
nasdaq_psx_totalview_itch_v5_0.fields.level_3 = ProtoField.new("Level 3", "nasdaq.psx.totalview.itch.v5.0.level3", ftypes.DOUBLE)
nasdaq_psx_totalview_itch_v5_0.fields.locate_code = ProtoField.new("Locate Code", "nasdaq.psx.totalview.itch.v5.0.locatecode", ftypes.UINT16)
nasdaq_psx_totalview_itch_v5_0.fields.lower_auction_collar_price = ProtoField.new("Lower Auction Collar Price", "nasdaq.psx.totalview.itch.v5.0.lowerauctioncollarprice", ftypes.DOUBLE)
nasdaq_psx_totalview_itch_v5_0.fields.luld_auction_collar_message = ProtoField.new("Luld Auction Collar Message", "nasdaq.psx.totalview.itch.v5.0.luldauctioncollarmessage", ftypes.STRING)
nasdaq_psx_totalview_itch_v5_0.fields.luld_reference_price_tier = ProtoField.new("Luld Reference Price Tier", "nasdaq.psx.totalview.itch.v5.0.luldreferencepricetier", ftypes.STRING)
nasdaq_psx_totalview_itch_v5_0.fields.market_category = ProtoField.new("Market Category", "nasdaq.psx.totalview.itch.v5.0.marketcategory", ftypes.STRING)
nasdaq_psx_totalview_itch_v5_0.fields.market_code = ProtoField.new("Market Code", "nasdaq.psx.totalview.itch.v5.0.marketcode", ftypes.STRING)
nasdaq_psx_totalview_itch_v5_0.fields.market_maker_mode = ProtoField.new("Market Maker Mode", "nasdaq.psx.totalview.itch.v5.0.marketmakermode", ftypes.STRING)
nasdaq_psx_totalview_itch_v5_0.fields.market_participant_position_message = ProtoField.new("Market Participant Position Message", "nasdaq.psx.totalview.itch.v5.0.marketparticipantpositionmessage", ftypes.STRING)
nasdaq_psx_totalview_itch_v5_0.fields.market_participant_state = ProtoField.new("Market Participant State", "nasdaq.psx.totalview.itch.v5.0.marketparticipantstate", ftypes.STRING)
nasdaq_psx_totalview_itch_v5_0.fields.match_number = ProtoField.new("Match Number", "nasdaq.psx.totalview.itch.v5.0.matchnumber", ftypes.UINT64)
nasdaq_psx_totalview_itch_v5_0.fields.message = ProtoField.new("Message", "nasdaq.psx.totalview.itch.v5.0.message", ftypes.STRING)
nasdaq_psx_totalview_itch_v5_0.fields.message_header = ProtoField.new("Message Header", "nasdaq.psx.totalview.itch.v5.0.messageheader", ftypes.STRING)
nasdaq_psx_totalview_itch_v5_0.fields.message_type = ProtoField.new("Message Type", "nasdaq.psx.totalview.itch.v5.0.messagetype", ftypes.STRING)
nasdaq_psx_totalview_itch_v5_0.fields.mpid = ProtoField.new("Mpid", "nasdaq.psx.totalview.itch.v5.0.mpid", ftypes.STRING)
nasdaq_psx_totalview_itch_v5_0.fields.mwcb_decline_level_message = ProtoField.new("Mwcb Decline Level Message", "nasdaq.psx.totalview.itch.v5.0.mwcbdeclinelevelmessage", ftypes.STRING)
nasdaq_psx_totalview_itch_v5_0.fields.mwcb_status_level_message = ProtoField.new("Mwcb Status Level Message", "nasdaq.psx.totalview.itch.v5.0.mwcbstatuslevelmessage", ftypes.STRING)
nasdaq_psx_totalview_itch_v5_0.fields.near_price = ProtoField.new("Near Price", "nasdaq.psx.totalview.itch.v5.0.nearprice", ftypes.DOUBLE)
nasdaq_psx_totalview_itch_v5_0.fields.net_order_imbalance_indicator_message = ProtoField.new("Net Order Imbalance Indicator Message", "nasdaq.psx.totalview.itch.v5.0.netorderimbalanceindicatormessage", ftypes.STRING)
nasdaq_psx_totalview_itch_v5_0.fields.new_order_reference_number = ProtoField.new("New Order Reference Number", "nasdaq.psx.totalview.itch.v5.0.neworderreferencenumber", ftypes.UINT64)
nasdaq_psx_totalview_itch_v5_0.fields.operational_halt_action = ProtoField.new("Operational Halt Action", "nasdaq.psx.totalview.itch.v5.0.operationalhaltaction", ftypes.STRING)
nasdaq_psx_totalview_itch_v5_0.fields.operational_halt_message = ProtoField.new("Operational Halt Message", "nasdaq.psx.totalview.itch.v5.0.operationalhaltmessage", ftypes.STRING)
nasdaq_psx_totalview_itch_v5_0.fields.order_cancel_message = ProtoField.new("Order Cancel Message", "nasdaq.psx.totalview.itch.v5.0.ordercancelmessage", ftypes.STRING)
nasdaq_psx_totalview_itch_v5_0.fields.order_delete_message = ProtoField.new("Order Delete Message", "nasdaq.psx.totalview.itch.v5.0.orderdeletemessage", ftypes.STRING)
nasdaq_psx_totalview_itch_v5_0.fields.order_executed_message = ProtoField.new("Order Executed Message", "nasdaq.psx.totalview.itch.v5.0.orderexecutedmessage", ftypes.STRING)
nasdaq_psx_totalview_itch_v5_0.fields.order_executed_with_price_message = ProtoField.new("Order Executed With Price Message", "nasdaq.psx.totalview.itch.v5.0.orderexecutedwithpricemessage", ftypes.STRING)
nasdaq_psx_totalview_itch_v5_0.fields.order_reference_number = ProtoField.new("Order Reference Number", "nasdaq.psx.totalview.itch.v5.0.orderreferencenumber", ftypes.UINT64)
nasdaq_psx_totalview_itch_v5_0.fields.order_replace_message = ProtoField.new("Order Replace Message", "nasdaq.psx.totalview.itch.v5.0.orderreplacemessage", ftypes.STRING)
nasdaq_psx_totalview_itch_v5_0.fields.original_order_reference_number = ProtoField.new("Original Order Reference Number", "nasdaq.psx.totalview.itch.v5.0.originalorderreferencenumber", ftypes.UINT64)
nasdaq_psx_totalview_itch_v5_0.fields.packet = ProtoField.new("Packet", "nasdaq.psx.totalview.itch.v5.0.packet", ftypes.STRING)
nasdaq_psx_totalview_itch_v5_0.fields.packet_header = ProtoField.new("Packet Header", "nasdaq.psx.totalview.itch.v5.0.packetheader", ftypes.STRING)
nasdaq_psx_totalview_itch_v5_0.fields.paired_shares = ProtoField.new("Paired Shares", "nasdaq.psx.totalview.itch.v5.0.pairedshares", ftypes.UINT64)
nasdaq_psx_totalview_itch_v5_0.fields.payload = ProtoField.new("Payload", "nasdaq.psx.totalview.itch.v5.0.payload", ftypes.STRING)
nasdaq_psx_totalview_itch_v5_0.fields.price = ProtoField.new("Price", "nasdaq.psx.totalview.itch.v5.0.price", ftypes.DOUBLE)
nasdaq_psx_totalview_itch_v5_0.fields.price_variation_indicator = ProtoField.new("Price Variation Indicator", "nasdaq.psx.totalview.itch.v5.0.pricevariationindicator", ftypes.STRING)
nasdaq_psx_totalview_itch_v5_0.fields.primary_market_maker = ProtoField.new("Primary Market Maker", "nasdaq.psx.totalview.itch.v5.0.primarymarketmaker", ftypes.STRING)
nasdaq_psx_totalview_itch_v5_0.fields.printable = ProtoField.new("Printable", "nasdaq.psx.totalview.itch.v5.0.printable", ftypes.STRING)
nasdaq_psx_totalview_itch_v5_0.fields.reason = ProtoField.new("Reason", "nasdaq.psx.totalview.itch.v5.0.reason", ftypes.STRING)
nasdaq_psx_totalview_itch_v5_0.fields.reg_sho_action = ProtoField.new("Reg Sho Action", "nasdaq.psx.totalview.itch.v5.0.regshoaction", ftypes.STRING)
nasdaq_psx_totalview_itch_v5_0.fields.reg_sho_short_sale_price_test_restricted_indicator_message = ProtoField.new("Reg Sho Short Sale Price Test Restricted Indicator Message", "nasdaq.psx.totalview.itch.v5.0.regshoshortsalepricetestrestrictedindicatormessage", ftypes.STRING)
nasdaq_psx_totalview_itch_v5_0.fields.reserved = ProtoField.new("Reserved", "nasdaq.psx.totalview.itch.v5.0.reserved", ftypes.STRING)
nasdaq_psx_totalview_itch_v5_0.fields.round_lot_size = ProtoField.new("Round Lot Size", "nasdaq.psx.totalview.itch.v5.0.roundlotsize", ftypes.UINT32)
nasdaq_psx_totalview_itch_v5_0.fields.round_lots_only = ProtoField.new("Round Lots Only", "nasdaq.psx.totalview.itch.v5.0.roundlotsonly", ftypes.STRING)
nasdaq_psx_totalview_itch_v5_0.fields.sequence = ProtoField.new("Sequence", "nasdaq.psx.totalview.itch.v5.0.sequence", ftypes.UINT64)
nasdaq_psx_totalview_itch_v5_0.fields.session = ProtoField.new("Session", "nasdaq.psx.totalview.itch.v5.0.session", ftypes.STRING)
nasdaq_psx_totalview_itch_v5_0.fields.shares = ProtoField.new("Shares", "nasdaq.psx.totalview.itch.v5.0.shares", ftypes.UINT32)
nasdaq_psx_totalview_itch_v5_0.fields.short_sale_threshold_indicator = ProtoField.new("Short Sale Threshold Indicator", "nasdaq.psx.totalview.itch.v5.0.shortsalethresholdindicator", ftypes.STRING)
nasdaq_psx_totalview_itch_v5_0.fields.stock = ProtoField.new("Stock", "nasdaq.psx.totalview.itch.v5.0.stock", ftypes.STRING)
nasdaq_psx_totalview_itch_v5_0.fields.stock_directory_message = ProtoField.new("Stock Directory Message", "nasdaq.psx.totalview.itch.v5.0.stockdirectorymessage", ftypes.STRING)
nasdaq_psx_totalview_itch_v5_0.fields.stock_locate = ProtoField.new("Stock Locate", "nasdaq.psx.totalview.itch.v5.0.stocklocate", ftypes.UINT16)
nasdaq_psx_totalview_itch_v5_0.fields.stock_trading_action_message = ProtoField.new("Stock Trading Action Message", "nasdaq.psx.totalview.itch.v5.0.stocktradingactionmessage", ftypes.STRING)
nasdaq_psx_totalview_itch_v5_0.fields.system_event_message = ProtoField.new("System Event Message", "nasdaq.psx.totalview.itch.v5.0.systemeventmessage", ftypes.STRING)
nasdaq_psx_totalview_itch_v5_0.fields.timestamp = ProtoField.new("Timestamp", "nasdaq.psx.totalview.itch.v5.0.timestamp", ftypes.UINT64)
nasdaq_psx_totalview_itch_v5_0.fields.tracking_number = ProtoField.new("Tracking Number", "nasdaq.psx.totalview.itch.v5.0.trackingnumber", ftypes.UINT16)
nasdaq_psx_totalview_itch_v5_0.fields.trade_message_non_cross = ProtoField.new("Trade Message Non Cross", "nasdaq.psx.totalview.itch.v5.0.trademessagenoncross", ftypes.STRING)
nasdaq_psx_totalview_itch_v5_0.fields.trading_state = ProtoField.new("Trading State", "nasdaq.psx.totalview.itch.v5.0.tradingstate", ftypes.STRING)
nasdaq_psx_totalview_itch_v5_0.fields.upper_auction_collar_price = ProtoField.new("Upper Auction Collar Price", "nasdaq.psx.totalview.itch.v5.0.upperauctioncollarprice", ftypes.DOUBLE)
-----------------------------------------------------------------------
-- Declare Dissection Options
-----------------------------------------------------------------------
-- Nasdaq Psx TotalView Itch 5.0 Element Dissection Options
show.add_order_no_mpid_attribution_message = true
show.add_order_with_mpid_attribution_message = true
show.broken_trade_message = true
show.cross_trade_message = true
show.luld_auction_collar_message = true
show.market_participant_position_message = true
show.message = true
show.message_header = true
show.mwcb_decline_level_message = true
show.mwcb_status_level_message = true
show.net_order_imbalance_indicator_message = true
show.operational_halt_message = true
show.order_cancel_message = true
show.order_delete_message = true
show.order_executed_message = true
show.order_executed_with_price_message = true
show.order_replace_message = true
show.packet = true
show.packet_header = true
show.reg_sho_short_sale_price_test_restricted_indicator_message = true
show.stock_directory_message = true
show.stock_trading_action_message = true
show.system_event_message = true
show.trade_message_non_cross = true
show.payload = false
-- Register Nasdaq Psx TotalView Itch 5.0 Show Options
nasdaq_psx_totalview_itch_v5_0.prefs.show_add_order_no_mpid_attribution_message = Pref.bool("Show Add Order No Mpid Attribution Message", show.add_order_no_mpid_attribution_message, "Parse and add Add Order No Mpid Attribution Message to protocol tree")
nasdaq_psx_totalview_itch_v5_0.prefs.show_add_order_with_mpid_attribution_message = Pref.bool("Show Add Order With Mpid Attribution Message", show.add_order_with_mpid_attribution_message, "Parse and add Add Order With Mpid Attribution Message to protocol tree")
nasdaq_psx_totalview_itch_v5_0.prefs.show_broken_trade_message = Pref.bool("Show Broken Trade Message", show.broken_trade_message, "Parse and add Broken Trade Message to protocol tree")
nasdaq_psx_totalview_itch_v5_0.prefs.show_cross_trade_message = Pref.bool("Show Cross Trade Message", show.cross_trade_message, "Parse and add Cross Trade Message to protocol tree")
nasdaq_psx_totalview_itch_v5_0.prefs.show_luld_auction_collar_message = Pref.bool("Show Luld Auction Collar Message", show.luld_auction_collar_message, "Parse and add Luld Auction Collar Message to protocol tree")
nasdaq_psx_totalview_itch_v5_0.prefs.show_market_participant_position_message = Pref.bool("Show Market Participant Position Message", show.market_participant_position_message, "Parse and add Market Participant Position Message to protocol tree")
nasdaq_psx_totalview_itch_v5_0.prefs.show_message = Pref.bool("Show Message", show.message, "Parse and add Message to protocol tree")
nasdaq_psx_totalview_itch_v5_0.prefs.show_message_header = Pref.bool("Show Message Header", show.message_header, "Parse and add Message Header to protocol tree")
nasdaq_psx_totalview_itch_v5_0.prefs.show_mwcb_decline_level_message = Pref.bool("Show Mwcb Decline Level Message", show.mwcb_decline_level_message, "Parse and add Mwcb Decline Level Message to protocol tree")
nasdaq_psx_totalview_itch_v5_0.prefs.show_mwcb_status_level_message = Pref.bool("Show Mwcb Status Level Message", show.mwcb_status_level_message, "Parse and add Mwcb Status Level Message to protocol tree")
nasdaq_psx_totalview_itch_v5_0.prefs.show_net_order_imbalance_indicator_message = Pref.bool("Show Net Order Imbalance Indicator Message", show.net_order_imbalance_indicator_message, "Parse and add Net Order Imbalance Indicator Message to protocol tree")
nasdaq_psx_totalview_itch_v5_0.prefs.show_operational_halt_message = Pref.bool("Show Operational Halt Message", show.operational_halt_message, "Parse and add Operational Halt Message to protocol tree")
nasdaq_psx_totalview_itch_v5_0.prefs.show_order_cancel_message = Pref.bool("Show Order Cancel Message", show.order_cancel_message, "Parse and add Order Cancel Message to protocol tree")
nasdaq_psx_totalview_itch_v5_0.prefs.show_order_delete_message = Pref.bool("Show Order Delete Message", show.order_delete_message, "Parse and add Order Delete Message to protocol tree")
nasdaq_psx_totalview_itch_v5_0.prefs.show_order_executed_message = Pref.bool("Show Order Executed Message", show.order_executed_message, "Parse and add Order Executed Message to protocol tree")
nasdaq_psx_totalview_itch_v5_0.prefs.show_order_executed_with_price_message = Pref.bool("Show Order Executed With Price Message", show.order_executed_with_price_message, "Parse and add Order Executed With Price Message to protocol tree")
nasdaq_psx_totalview_itch_v5_0.prefs.show_order_replace_message = Pref.bool("Show Order Replace Message", show.order_replace_message, "Parse and add Order Replace Message to protocol tree")
nasdaq_psx_totalview_itch_v5_0.prefs.show_packet = Pref.bool("Show Packet", show.packet, "Parse and add Packet to protocol tree")
nasdaq_psx_totalview_itch_v5_0.prefs.show_packet_header = Pref.bool("Show Packet Header", show.packet_header, "Parse and add Packet Header to protocol tree")
nasdaq_psx_totalview_itch_v5_0.prefs.show_reg_sho_short_sale_price_test_restricted_indicator_message = Pref.bool("Show Reg Sho Short Sale Price Test Restricted Indicator Message", show.reg_sho_short_sale_price_test_restricted_indicator_message, "Parse and add Reg Sho Short Sale Price Test Restricted Indicator Message to protocol tree")
nasdaq_psx_totalview_itch_v5_0.prefs.show_stock_directory_message = Pref.bool("Show Stock Directory Message", show.stock_directory_message, "Parse and add Stock Directory Message to protocol tree")
nasdaq_psx_totalview_itch_v5_0.prefs.show_stock_trading_action_message = Pref.bool("Show Stock Trading Action Message", show.stock_trading_action_message, "Parse and add Stock Trading Action Message to protocol tree")
nasdaq_psx_totalview_itch_v5_0.prefs.show_system_event_message = Pref.bool("Show System Event Message", show.system_event_message, "Parse and add System Event Message to protocol tree")
nasdaq_psx_totalview_itch_v5_0.prefs.show_trade_message_non_cross = Pref.bool("Show Trade Message Non Cross", show.trade_message_non_cross, "Parse and add Trade Message Non Cross to protocol tree")
nasdaq_psx_totalview_itch_v5_0.prefs.show_payload = Pref.bool("Show Payload", show.payload, "Parse and add Payload to protocol tree")
-- Handle changed preferences
function nasdaq_psx_totalview_itch_v5_0.prefs_changed()
local changed = false
-- Check if show options have changed
if show.add_order_no_mpid_attribution_message ~= nasdaq_psx_totalview_itch_v5_0.prefs.show_add_order_no_mpid_attribution_message then
show.add_order_no_mpid_attribution_message = nasdaq_psx_totalview_itch_v5_0.prefs.show_add_order_no_mpid_attribution_message
changed = true
end
if show.add_order_with_mpid_attribution_message ~= nasdaq_psx_totalview_itch_v5_0.prefs.show_add_order_with_mpid_attribution_message then
show.add_order_with_mpid_attribution_message = nasdaq_psx_totalview_itch_v5_0.prefs.show_add_order_with_mpid_attribution_message
changed = true
end
if show.broken_trade_message ~= nasdaq_psx_totalview_itch_v5_0.prefs.show_broken_trade_message then
show.broken_trade_message = nasdaq_psx_totalview_itch_v5_0.prefs.show_broken_trade_message
changed = true
end
if show.cross_trade_message ~= nasdaq_psx_totalview_itch_v5_0.prefs.show_cross_trade_message then
show.cross_trade_message = nasdaq_psx_totalview_itch_v5_0.prefs.show_cross_trade_message
changed = true
end
if show.luld_auction_collar_message ~= nasdaq_psx_totalview_itch_v5_0.prefs.show_luld_auction_collar_message then
show.luld_auction_collar_message = nasdaq_psx_totalview_itch_v5_0.prefs.show_luld_auction_collar_message
changed = true
end
if show.market_participant_position_message ~= nasdaq_psx_totalview_itch_v5_0.prefs.show_market_participant_position_message then
show.market_participant_position_message = nasdaq_psx_totalview_itch_v5_0.prefs.show_market_participant_position_message
changed = true
end
if show.message ~= nasdaq_psx_totalview_itch_v5_0.prefs.show_message then
show.message = nasdaq_psx_totalview_itch_v5_0.prefs.show_message
changed = true
end
if show.message_header ~= nasdaq_psx_totalview_itch_v5_0.prefs.show_message_header then
show.message_header = nasdaq_psx_totalview_itch_v5_0.prefs.show_message_header
changed = true
end
if show.mwcb_decline_level_message ~= nasdaq_psx_totalview_itch_v5_0.prefs.show_mwcb_decline_level_message then
show.mwcb_decline_level_message = nasdaq_psx_totalview_itch_v5_0.prefs.show_mwcb_decline_level_message
changed = true
end
if show.mwcb_status_level_message ~= nasdaq_psx_totalview_itch_v5_0.prefs.show_mwcb_status_level_message then
show.mwcb_status_level_message = nasdaq_psx_totalview_itch_v5_0.prefs.show_mwcb_status_level_message
changed = true
end
if show.net_order_imbalance_indicator_message ~= nasdaq_psx_totalview_itch_v5_0.prefs.show_net_order_imbalance_indicator_message then
show.net_order_imbalance_indicator_message = nasdaq_psx_totalview_itch_v5_0.prefs.show_net_order_imbalance_indicator_message
changed = true
end
if show.operational_halt_message ~= nasdaq_psx_totalview_itch_v5_0.prefs.show_operational_halt_message then
show.operational_halt_message = nasdaq_psx_totalview_itch_v5_0.prefs.show_operational_halt_message
changed = true
end
if show.order_cancel_message ~= nasdaq_psx_totalview_itch_v5_0.prefs.show_order_cancel_message then
show.order_cancel_message = nasdaq_psx_totalview_itch_v5_0.prefs.show_order_cancel_message
changed = true
end
if show.order_delete_message ~= nasdaq_psx_totalview_itch_v5_0.prefs.show_order_delete_message then
show.order_delete_message = nasdaq_psx_totalview_itch_v5_0.prefs.show_order_delete_message
changed = true
end
if show.order_executed_message ~= nasdaq_psx_totalview_itch_v5_0.prefs.show_order_executed_message then
show.order_executed_message = nasdaq_psx_totalview_itch_v5_0.prefs.show_order_executed_message
changed = true
end
if show.order_executed_with_price_message ~= nasdaq_psx_totalview_itch_v5_0.prefs.show_order_executed_with_price_message then
show.order_executed_with_price_message = nasdaq_psx_totalview_itch_v5_0.prefs.show_order_executed_with_price_message
changed = true
end
if show.order_replace_message ~= nasdaq_psx_totalview_itch_v5_0.prefs.show_order_replace_message then
show.order_replace_message = nasdaq_psx_totalview_itch_v5_0.prefs.show_order_replace_message
changed = true
end
if show.packet ~= nasdaq_psx_totalview_itch_v5_0.prefs.show_packet then
show.packet = nasdaq_psx_totalview_itch_v5_0.prefs.show_packet
changed = true
end
if show.packet_header ~= nasdaq_psx_totalview_itch_v5_0.prefs.show_packet_header then
show.packet_header = nasdaq_psx_totalview_itch_v5_0.prefs.show_packet_header
changed = true
end
if show.reg_sho_short_sale_price_test_restricted_indicator_message ~= nasdaq_psx_totalview_itch_v5_0.prefs.show_reg_sho_short_sale_price_test_restricted_indicator_message then
show.reg_sho_short_sale_price_test_restricted_indicator_message = nasdaq_psx_totalview_itch_v5_0.prefs.show_reg_sho_short_sale_price_test_restricted_indicator_message
changed = true
end
if show.stock_directory_message ~= nasdaq_psx_totalview_itch_v5_0.prefs.show_stock_directory_message then
show.stock_directory_message = nasdaq_psx_totalview_itch_v5_0.prefs.show_stock_directory_message
changed = true
end
if show.stock_trading_action_message ~= nasdaq_psx_totalview_itch_v5_0.prefs.show_stock_trading_action_message then
show.stock_trading_action_message = nasdaq_psx_totalview_itch_v5_0.prefs.show_stock_trading_action_message
changed = true
end
if show.system_event_message ~= nasdaq_psx_totalview_itch_v5_0.prefs.show_system_event_message then
show.system_event_message = nasdaq_psx_totalview_itch_v5_0.prefs.show_system_event_message
changed = true
end
if show.trade_message_non_cross ~= nasdaq_psx_totalview_itch_v5_0.prefs.show_trade_message_non_cross then
show.trade_message_non_cross = nasdaq_psx_totalview_itch_v5_0.prefs.show_trade_message_non_cross
changed = true
end
if show.payload ~= nasdaq_psx_totalview_itch_v5_0.prefs.show_payload then
show.payload = nasdaq_psx_totalview_itch_v5_0.prefs.show_payload
changed = true
end
-- Reload on changed preference
if changed then
reload()
end
end
-----------------------------------------------------------------------
-- Protocol Functions
-----------------------------------------------------------------------
-- trim trailing spaces
trim_right_spaces = function(str)
local finish = str:len()
for i = 1, finish do
if str:byte(i) == 0x20 then
return str:sub(1, i - 1)
end
end
return str
end
-----------------------------------------------------------------------
-- Dissect Nasdaq Psx TotalView Itch 5.0
-----------------------------------------------------------------------
-- Size: Price Variation Indicator
nasdaq_psx_totalview_itch_v5_0_size_of.price_variation_indicator = 1
-- Display: Price Variation Indicator
nasdaq_psx_totalview_itch_v5_0_display.price_variation_indicator = function(value)
if value == "L" then
return "Price Variation Indicator: Less Than 1 (L)"
end
if value == "1" then
return "Price Variation Indicator: 1 To 199 (1)"
end
if value == "2" then
return "Price Variation Indicator: 2 To 299 (2)"
end
if value == "3" then
return "Price Variation Indicator: 3 To 399 (3)"
end
if value == "4" then
return "Price Variation Indicator: 4 To 499 (4)"
end
if value == "5" then
return "Price Variation Indicator: 5 To 599 (5)"
end
if value == "6" then
return "Price Variation Indicator: 6 To 699 (6)"
end
if value == "7" then
return "Price Variation Indicator: 7 To 799 (7)"
end
if value == "8" then
return "Price Variation Indicator: 8 To 899 (8)"
end
if value == "9" then
return "Price Variation Indicator: 9 To 999 (9)"
end
if value == "A" then
return "Price Variation Indicator: 10 To 1999 (A)"
end
if value == "B" then
return "Price Variation Indicator: 20 To 2999 (B)"
end
if value == "C" then
return "Price Variation Indicator: 30 Or Greater (C)"
end
if value == " " then
return "Price Variation Indicator: No Calculation (<whitespace>)"
end
return "Price Variation Indicator: Unknown("..value..")"
end
-- Dissect: Price Variation Indicator
nasdaq_psx_totalview_itch_v5_0_dissect.price_variation_indicator = function(buffer, offset, packet, parent)
local length = nasdaq_psx_totalview_itch_v5_0_size_of.price_variation_indicator
local range = buffer(offset, length)
local value = range:string()
local display = nasdaq_psx_totalview_itch_v5_0_display.price_variation_indicator(value, buffer, offset, packet, parent)
parent:add(nasdaq_psx_totalview_itch_v5_0.fields.price_variation_indicator, range, value, display)
return offset + length, value
end
-- Size: Cross Type
nasdaq_psx_totalview_itch_v5_0_size_of.cross_type = 1
-- Display: Cross Type
nasdaq_psx_totalview_itch_v5_0_display.cross_type = function(value)
if value == "O" then
return "Cross Type: Opening Cross (O)"
end
if value == "C" then
return "Cross Type: Closing Cross (C)"
end
if value == "H" then
return "Cross Type: Cross Halted Or Paused (H)"
end
if value == "I" then
return "Cross Type: Intraday Cross And Post Close Cross (I)"
end
return "Cross Type: Unknown("..value..")"
end
-- Dissect: Cross Type
nasdaq_psx_totalview_itch_v5_0_dissect.cross_type = function(buffer, offset, packet, parent)
local length = nasdaq_psx_totalview_itch_v5_0_size_of.cross_type
local range = buffer(offset, length)
local value = range:string()
local display = nasdaq_psx_totalview_itch_v5_0_display.cross_type(value, buffer, offset, packet, parent)
parent:add(nasdaq_psx_totalview_itch_v5_0.fields.cross_type, range, value, display)
return offset + length, value
end
-- Size: Current Reference Price
nasdaq_psx_totalview_itch_v5_0_size_of.current_reference_price = 4
-- Display: Current Reference Price
nasdaq_psx_totalview_itch_v5_0_display.current_reference_price = function(value)
return "Current Reference Price: "..value
end
-- Translate: Current Reference Price
translate.current_reference_price = function(raw)
return raw/10000
end
-- Dissect: Current Reference Price
nasdaq_psx_totalview_itch_v5_0_dissect.current_reference_price = function(buffer, offset, packet, parent)
local length = nasdaq_psx_totalview_itch_v5_0_size_of.current_reference_price
local range = buffer(offset, length)
local raw = range:uint()
local value = translate.current_reference_price(raw)
local display = nasdaq_psx_totalview_itch_v5_0_display.current_reference_price(value, buffer, offset, packet, parent)
parent:add(nasdaq_psx_totalview_itch_v5_0.fields.current_reference_price, range, value, display)
return offset + length, value
end
-- Size: Near Price
nasdaq_psx_totalview_itch_v5_0_size_of.near_price = 4
-- Display: Near Price
nasdaq_psx_totalview_itch_v5_0_display.near_price = function(value)
return "Near Price: "..value
end
-- Translate: Near Price
translate.near_price = function(raw)
return raw/10000
end
-- Dissect: Near Price
nasdaq_psx_totalview_itch_v5_0_dissect.near_price = function(buffer, offset, packet, parent)
local length = nasdaq_psx_totalview_itch_v5_0_size_of.near_price
local range = buffer(offset, length)
local raw = range:uint()
local value = translate.near_price(raw)
local display = nasdaq_psx_totalview_itch_v5_0_display.near_price(value, buffer, offset, packet, parent)
parent:add(nasdaq_psx_totalview_itch_v5_0.fields.near_price, range, value, display)
return offset + length, value
end
-- Size: Far Price
nasdaq_psx_totalview_itch_v5_0_size_of.far_price = 4
-- Display: Far Price
nasdaq_psx_totalview_itch_v5_0_display.far_price = function(value)
return "Far Price: "..value
end
-- Translate: Far Price
translate.far_price = function(raw)
return raw/10000
end
-- Dissect: Far Price
nasdaq_psx_totalview_itch_v5_0_dissect.far_price = function(buffer, offset, packet, parent)
local length = nasdaq_psx_totalview_itch_v5_0_size_of.far_price
local range = buffer(offset, length)
local raw = range:uint()
local value = translate.far_price(raw)
local display = nasdaq_psx_totalview_itch_v5_0_display.far_price(value, buffer, offset, packet, parent)
parent:add(nasdaq_psx_totalview_itch_v5_0.fields.far_price, range, value, display)
return offset + length, value
end
-- Size: Stock
nasdaq_psx_totalview_itch_v5_0_size_of.stock = 8
-- Display: Stock
nasdaq_psx_totalview_itch_v5_0_display.stock = function(value)
return "Stock: "..value
end
-- Dissect: Stock
nasdaq_psx_totalview_itch_v5_0_dissect.stock = function(buffer, offset, packet, parent)
local length = nasdaq_psx_totalview_itch_v5_0_size_of.stock
local range = buffer(offset, length)
local value = trim_right_spaces(range:string())
local display = nasdaq_psx_totalview_itch_v5_0_display.stock(value, buffer, offset, packet, parent)
parent:add(nasdaq_psx_totalview_itch_v5_0.fields.stock, range, value, display)
return offset + length, value
end
-- Size: Imbalance Direction
nasdaq_psx_totalview_itch_v5_0_size_of.imbalance_direction = 1
-- Display: Imbalance Direction
nasdaq_psx_totalview_itch_v5_0_display.imbalance_direction = function(value)
if value == "B" then
return "Imbalance Direction: Buy (B)"
end
if value == "S" then
return "Imbalance Direction: Sell (S)"
end
if value == "N" then
return "Imbalance Direction: No Imbalance (N)"
end
if value == "O" then
return "Imbalance Direction: Insufficient Orders (O)"
end
return "Imbalance Direction: Unknown("..value..")"
end
-- Dissect: Imbalance Direction
nasdaq_psx_totalview_itch_v5_0_dissect.imbalance_direction = function(buffer, offset, packet, parent)
local length = nasdaq_psx_totalview_itch_v5_0_size_of.imbalance_direction
local range = buffer(offset, length)
local value = range:string()
local display = nasdaq_psx_totalview_itch_v5_0_display.imbalance_direction(value, buffer, offset, packet, parent)
parent:add(nasdaq_psx_totalview_itch_v5_0.fields.imbalance_direction, range, value, display)
return offset + length, value
end
-- Size: Imbalance Shares
nasdaq_psx_totalview_itch_v5_0_size_of.imbalance_shares = 8
-- Display: Imbalance Shares
nasdaq_psx_totalview_itch_v5_0_display.imbalance_shares = function(value)
return "Imbalance Shares: "..value
end
-- Dissect: Imbalance Shares
nasdaq_psx_totalview_itch_v5_0_dissect.imbalance_shares = function(buffer, offset, packet, parent)
local length = nasdaq_psx_totalview_itch_v5_0_size_of.imbalance_shares
local range = buffer(offset, length)
local value = range:uint64()
local display = nasdaq_psx_totalview_itch_v5_0_display.imbalance_shares(value, buffer, offset, packet, parent)
parent:add(nasdaq_psx_totalview_itch_v5_0.fields.imbalance_shares, range, value, display)
return offset + length, value
end
-- Size: Paired Shares
nasdaq_psx_totalview_itch_v5_0_size_of.paired_shares = 8
-- Display: Paired Shares
nasdaq_psx_totalview_itch_v5_0_display.paired_shares = function(value)
return "Paired Shares: "..value
end
-- Dissect: Paired Shares
nasdaq_psx_totalview_itch_v5_0_dissect.paired_shares = function(buffer, offset, packet, parent)
local length = nasdaq_psx_totalview_itch_v5_0_size_of.paired_shares
local range = buffer(offset, length)
local value = range:uint64()
local display = nasdaq_psx_totalview_itch_v5_0_display.paired_shares(value, buffer, offset, packet, parent)
parent:add(nasdaq_psx_totalview_itch_v5_0.fields.paired_shares, range, value, display)
return offset + length, value
end
-- Size: Timestamp
nasdaq_psx_totalview_itch_v5_0_size_of.timestamp = 6
-- Display: Timestamp
nasdaq_psx_totalview_itch_v5_0_display.timestamp = function(value)
return "Timestamp: "..value
end
-- Dissect: Timestamp
nasdaq_psx_totalview_itch_v5_0_dissect.timestamp = function(buffer, offset, packet, parent)
local length = nasdaq_psx_totalview_itch_v5_0_size_of.timestamp
local range = buffer(offset, length)
local value = range:uint64()
local display = nasdaq_psx_totalview_itch_v5_0_display.timestamp(value, buffer, offset, packet, parent)
parent:add(nasdaq_psx_totalview_itch_v5_0.fields.timestamp, range, value, display)
return offset + length, value
end
-- Size: Tracking Number
nasdaq_psx_totalview_itch_v5_0_size_of.tracking_number = 2
-- Display: Tracking Number
nasdaq_psx_totalview_itch_v5_0_display.tracking_number = function(value)
return "Tracking Number: "..value
end
-- Dissect: Tracking Number
nasdaq_psx_totalview_itch_v5_0_dissect.tracking_number = function(buffer, offset, packet, parent)
local length = nasdaq_psx_totalview_itch_v5_0_size_of.tracking_number
local range = buffer(offset, length)
local value = range:uint()
local display = nasdaq_psx_totalview_itch_v5_0_display.tracking_number(value, buffer, offset, packet, parent)
parent:add(nasdaq_psx_totalview_itch_v5_0.fields.tracking_number, range, value, display)
return offset + length, value
end
-- Size: Stock Locate
nasdaq_psx_totalview_itch_v5_0_size_of.stock_locate = 2
-- Display: Stock Locate
nasdaq_psx_totalview_itch_v5_0_display.stock_locate = function(value)
return "Stock Locate: "..value
end
-- Dissect: Stock Locate
nasdaq_psx_totalview_itch_v5_0_dissect.stock_locate = function(buffer, offset, packet, parent)
local length = nasdaq_psx_totalview_itch_v5_0_size_of.stock_locate
local range = buffer(offset, length)
local value = range:uint()
local display = nasdaq_psx_totalview_itch_v5_0_display.stock_locate(value, buffer, offset, packet, parent)
parent:add(nasdaq_psx_totalview_itch_v5_0.fields.stock_locate, range, value, display)
return offset + length, value
end
-- Calculate size of: Net Order Imbalance Indicator Message
nasdaq_psx_totalview_itch_v5_0_size_of.net_order_imbalance_indicator_message = function(buffer, offset)
local index = 0
index = index + nasdaq_psx_totalview_itch_v5_0_size_of.stock_locate
index = index + nasdaq_psx_totalview_itch_v5_0_size_of.tracking_number
index = index + nasdaq_psx_totalview_itch_v5_0_size_of.timestamp
index = index + nasdaq_psx_totalview_itch_v5_0_size_of.paired_shares
index = index + nasdaq_psx_totalview_itch_v5_0_size_of.imbalance_shares
index = index + nasdaq_psx_totalview_itch_v5_0_size_of.imbalance_direction
index = index + nasdaq_psx_totalview_itch_v5_0_size_of.stock
index = index + nasdaq_psx_totalview_itch_v5_0_size_of.far_price
index = index + nasdaq_psx_totalview_itch_v5_0_size_of.near_price
index = index + nasdaq_psx_totalview_itch_v5_0_size_of.current_reference_price
index = index + nasdaq_psx_totalview_itch_v5_0_size_of.cross_type
index = index + nasdaq_psx_totalview_itch_v5_0_size_of.price_variation_indicator
return index
end
-- Display: Net Order Imbalance Indicator Message
nasdaq_psx_totalview_itch_v5_0_display.net_order_imbalance_indicator_message = function(buffer, offset, size, packet, parent)
return ""
end
-- Dissect Fields: Net Order Imbalance Indicator Message
nasdaq_psx_totalview_itch_v5_0_dissect.net_order_imbalance_indicator_message_fields = function(buffer, offset, packet, parent)
local index = offset
-- Stock Locate: 2 Byte Unsigned Fixed Width Integer
index, stock_locate = nasdaq_psx_totalview_itch_v5_0_dissect.stock_locate(buffer, index, packet, parent)
-- Tracking Number: 2 Byte Unsigned Fixed Width Integer
index, tracking_number = nasdaq_psx_totalview_itch_v5_0_dissect.tracking_number(buffer, index, packet, parent)
-- Timestamp: 6 Byte Unsigned Fixed Width Integer
index, timestamp = nasdaq_psx_totalview_itch_v5_0_dissect.timestamp(buffer, index, packet, parent)
-- Paired Shares: 8 Byte Unsigned Fixed Width Integer
index, paired_shares = nasdaq_psx_totalview_itch_v5_0_dissect.paired_shares(buffer, index, packet, parent)
-- Imbalance Shares: 8 Byte Unsigned Fixed Width Integer
index, imbalance_shares = nasdaq_psx_totalview_itch_v5_0_dissect.imbalance_shares(buffer, index, packet, parent)
-- Imbalance Direction: 1 Byte Ascii String Enum with 4 values
index, imbalance_direction = nasdaq_psx_totalview_itch_v5_0_dissect.imbalance_direction(buffer, index, packet, parent)
-- Stock: 8 Byte Ascii String
index, stock = nasdaq_psx_totalview_itch_v5_0_dissect.stock(buffer, index, packet, parent)
-- Far Price: 4 Byte Unsigned Fixed Width Integer
index, far_price = nasdaq_psx_totalview_itch_v5_0_dissect.far_price(buffer, index, packet, parent)
-- Near Price: 4 Byte Unsigned Fixed Width Integer
index, near_price = nasdaq_psx_totalview_itch_v5_0_dissect.near_price(buffer, index, packet, parent)
-- Current Reference Price: 4 Byte Unsigned Fixed Width Integer
index, current_reference_price = nasdaq_psx_totalview_itch_v5_0_dissect.current_reference_price(buffer, index, packet, parent)
-- Cross Type: 1 Byte Ascii String Enum with 4 values
index, cross_type = nasdaq_psx_totalview_itch_v5_0_dissect.cross_type(buffer, index, packet, parent)
-- Price Variation Indicator: 1 Byte Ascii String Enum with 14 values
index, price_variation_indicator = nasdaq_psx_totalview_itch_v5_0_dissect.price_variation_indicator(buffer, index, packet, parent)
return index
end
-- Dissect: Net Order Imbalance Indicator Message
nasdaq_psx_totalview_itch_v5_0_dissect.net_order_imbalance_indicator_message = function(buffer, offset, packet, parent)
-- Optionally add struct element to protocol tree
if show.net_order_imbalance_indicator_message then
local length = nasdaq_psx_totalview_itch_v5_0_size_of.net_order_imbalance_indicator_message(buffer, offset)
local range = buffer(offset, length)
local display = nasdaq_psx_totalview_itch_v5_0_display.net_order_imbalance_indicator_message(buffer, packet, parent)
parent = parent:add(nasdaq_psx_totalview_itch_v5_0.fields.net_order_imbalance_indicator_message, range, display)
end
return nasdaq_psx_totalview_itch_v5_0_dissect.net_order_imbalance_indicator_message_fields(buffer, offset, packet, parent)
end
-- Size: Match Number
nasdaq_psx_totalview_itch_v5_0_size_of.match_number = 8
-- Display: Match Number
nasdaq_psx_totalview_itch_v5_0_display.match_number = function(value)
return "Match Number: "..value
end
-- Dissect: Match Number
nasdaq_psx_totalview_itch_v5_0_dissect.match_number = function(buffer, offset, packet, parent)
local length = nasdaq_psx_totalview_itch_v5_0_size_of.match_number
local range = buffer(offset, length)
local value = range:uint64()
local display = nasdaq_psx_totalview_itch_v5_0_display.match_number(value, buffer, offset, packet, parent)
parent:add(nasdaq_psx_totalview_itch_v5_0.fields.match_number, range, value, display)
return offset + length, value
end
-- Calculate size of: Broken Trade Message
nasdaq_psx_totalview_itch_v5_0_size_of.broken_trade_message = function(buffer, offset)
local index = 0
index = index + nasdaq_psx_totalview_itch_v5_0_size_of.stock_locate
index = index + nasdaq_psx_totalview_itch_v5_0_size_of.tracking_number
index = index + nasdaq_psx_totalview_itch_v5_0_size_of.timestamp
index = index + nasdaq_psx_totalview_itch_v5_0_size_of.match_number
return index
end
-- Display: Broken Trade Message
nasdaq_psx_totalview_itch_v5_0_display.broken_trade_message = function(buffer, offset, size, packet, parent)
return ""
end
-- Dissect Fields: Broken Trade Message
nasdaq_psx_totalview_itch_v5_0_dissect.broken_trade_message_fields = function(buffer, offset, packet, parent)
local index = offset
-- Stock Locate: 2 Byte Unsigned Fixed Width Integer
index, stock_locate = nasdaq_psx_totalview_itch_v5_0_dissect.stock_locate(buffer, index, packet, parent)
-- Tracking Number: 2 Byte Unsigned Fixed Width Integer
index, tracking_number = nasdaq_psx_totalview_itch_v5_0_dissect.tracking_number(buffer, index, packet, parent)
-- Timestamp: 6 Byte Unsigned Fixed Width Integer
index, timestamp = nasdaq_psx_totalview_itch_v5_0_dissect.timestamp(buffer, index, packet, parent)
-- Match Number: 8 Byte Unsigned Fixed Width Integer
index, match_number = nasdaq_psx_totalview_itch_v5_0_dissect.match_number(buffer, index, packet, parent)
return index
end
-- Dissect: Broken Trade Message
nasdaq_psx_totalview_itch_v5_0_dissect.broken_trade_message = function(buffer, offset, packet, parent)
-- Optionally add struct element to protocol tree
if show.broken_trade_message then
local length = nasdaq_psx_totalview_itch_v5_0_size_of.broken_trade_message(buffer, offset)
local range = buffer(offset, length)
local display = nasdaq_psx_totalview_itch_v5_0_display.broken_trade_message(buffer, packet, parent)
parent = parent:add(nasdaq_psx_totalview_itch_v5_0.fields.broken_trade_message, range, display)
end
return nasdaq_psx_totalview_itch_v5_0_dissect.broken_trade_message_fields(buffer, offset, packet, parent)
end
-- Size: Cross Price
nasdaq_psx_totalview_itch_v5_0_size_of.cross_price = 4
-- Display: Cross Price
nasdaq_psx_totalview_itch_v5_0_display.cross_price = function(value)
return "Cross Price: "..value
end
-- Translate: Cross Price
translate.cross_price = function(raw)
return raw/10000
end
-- Dissect: Cross Price
nasdaq_psx_totalview_itch_v5_0_dissect.cross_price = function(buffer, offset, packet, parent)
local length = nasdaq_psx_totalview_itch_v5_0_size_of.cross_price
local range = buffer(offset, length)
local raw = range:uint()
local value = translate.cross_price(raw)
local display = nasdaq_psx_totalview_itch_v5_0_display.cross_price(value, buffer, offset, packet, parent)
parent:add(nasdaq_psx_totalview_itch_v5_0.fields.cross_price, range, value, display)
return offset + length, value
end
-- Size: Cross Shares
nasdaq_psx_totalview_itch_v5_0_size_of.cross_shares = 8
-- Display: Cross Shares
nasdaq_psx_totalview_itch_v5_0_display.cross_shares = function(value)
return "Cross Shares: "..value
end
-- Dissect: Cross Shares
nasdaq_psx_totalview_itch_v5_0_dissect.cross_shares = function(buffer, offset, packet, parent)
local length = nasdaq_psx_totalview_itch_v5_0_size_of.cross_shares
local range = buffer(offset, length)
local value = range:uint64()
local display = nasdaq_psx_totalview_itch_v5_0_display.cross_shares(value, buffer, offset, packet, parent)
parent:add(nasdaq_psx_totalview_itch_v5_0.fields.cross_shares, range, value, display)
return offset + length, value
end
-- Calculate size of: Cross Trade Message
nasdaq_psx_totalview_itch_v5_0_size_of.cross_trade_message = function(buffer, offset)
local index = 0
index = index + nasdaq_psx_totalview_itch_v5_0_size_of.stock_locate
index = index + nasdaq_psx_totalview_itch_v5_0_size_of.tracking_number
index = index + nasdaq_psx_totalview_itch_v5_0_size_of.timestamp
index = index + nasdaq_psx_totalview_itch_v5_0_size_of.cross_shares
index = index + nasdaq_psx_totalview_itch_v5_0_size_of.stock
index = index + nasdaq_psx_totalview_itch_v5_0_size_of.cross_price
index = index + nasdaq_psx_totalview_itch_v5_0_size_of.match_number
index = index + nasdaq_psx_totalview_itch_v5_0_size_of.cross_type
return index
end
-- Display: Cross Trade Message
nasdaq_psx_totalview_itch_v5_0_display.cross_trade_message = function(buffer, offset, size, packet, parent)
return ""
end
-- Dissect Fields: Cross Trade Message
nasdaq_psx_totalview_itch_v5_0_dissect.cross_trade_message_fields = function(buffer, offset, packet, parent)
local index = offset
-- Stock Locate: 2 Byte Unsigned Fixed Width Integer
index, stock_locate = nasdaq_psx_totalview_itch_v5_0_dissect.stock_locate(buffer, index, packet, parent)
-- Tracking Number: 2 Byte Unsigned Fixed Width Integer
index, tracking_number = nasdaq_psx_totalview_itch_v5_0_dissect.tracking_number(buffer, index, packet, parent)
-- Timestamp: 6 Byte Unsigned Fixed Width Integer
index, timestamp = nasdaq_psx_totalview_itch_v5_0_dissect.timestamp(buffer, index, packet, parent)
-- Cross Shares: 8 Byte Unsigned Fixed Width Integer
index, cross_shares = nasdaq_psx_totalview_itch_v5_0_dissect.cross_shares(buffer, index, packet, parent)
-- Stock: 8 Byte Ascii String
index, stock = nasdaq_psx_totalview_itch_v5_0_dissect.stock(buffer, index, packet, parent)
-- Cross Price: 4 Byte Unsigned Fixed Width Integer
index, cross_price = nasdaq_psx_totalview_itch_v5_0_dissect.cross_price(buffer, index, packet, parent)
-- Match Number: 8 Byte Unsigned Fixed Width Integer
index, match_number = nasdaq_psx_totalview_itch_v5_0_dissect.match_number(buffer, index, packet, parent)
-- Cross Type: 1 Byte Ascii String Enum with 4 values
index, cross_type = nasdaq_psx_totalview_itch_v5_0_dissect.cross_type(buffer, index, packet, parent)
return index
end
-- Dissect: Cross Trade Message
nasdaq_psx_totalview_itch_v5_0_dissect.cross_trade_message = function(buffer, offset, packet, parent)
-- Optionally add struct element to protocol tree
if show.cross_trade_message then
local length = nasdaq_psx_totalview_itch_v5_0_size_of.cross_trade_message(buffer, offset)
local range = buffer(offset, length)
local display = nasdaq_psx_totalview_itch_v5_0_display.cross_trade_message(buffer, packet, parent)
parent = parent:add(nasdaq_psx_totalview_itch_v5_0.fields.cross_trade_message, range, display)
end
return nasdaq_psx_totalview_itch_v5_0_dissect.cross_trade_message_fields(buffer, offset, packet, parent)
end
-- Size: Price
nasdaq_psx_totalview_itch_v5_0_size_of.price = 4
-- Display: Price
nasdaq_psx_totalview_itch_v5_0_display.price = function(value)
return "Price: "..value
end
-- Translate: Price
translate.price = function(raw)
return raw/10000
end
-- Dissect: Price
nasdaq_psx_totalview_itch_v5_0_dissect.price = function(buffer, offset, packet, parent)
local length = nasdaq_psx_totalview_itch_v5_0_size_of.price
local range = buffer(offset, length)
local raw = range:uint()
local value = translate.price(raw)
local display = nasdaq_psx_totalview_itch_v5_0_display.price(value, buffer, offset, packet, parent)
parent:add(nasdaq_psx_totalview_itch_v5_0.fields.price, range, value, display)
return offset + length, value
end
-- Size: Shares
nasdaq_psx_totalview_itch_v5_0_size_of.shares = 4
-- Display: Shares
nasdaq_psx_totalview_itch_v5_0_display.shares = function(value)
return "Shares: "..value
end
-- Dissect: Shares
nasdaq_psx_totalview_itch_v5_0_dissect.shares = function(buffer, offset, packet, parent)
local length = nasdaq_psx_totalview_itch_v5_0_size_of.shares
local range = buffer(offset, length)
local value = range:uint()
local display = nasdaq_psx_totalview_itch_v5_0_display.shares(value, buffer, offset, packet, parent)
parent:add(nasdaq_psx_totalview_itch_v5_0.fields.shares, range, value, display)
return offset + length, value
end
-- Size: Buy Sell Indicator
nasdaq_psx_totalview_itch_v5_0_size_of.buy_sell_indicator = 1
-- Display: Buy Sell Indicator
nasdaq_psx_totalview_itch_v5_0_display.buy_sell_indicator = function(value)
if value == "B" then
return "Buy Sell Indicator: Buy (B)"
end
if value == "S" then
return "Buy Sell Indicator: Sell (S)"
end
return "Buy Sell Indicator: Unknown("..value..")"
end
-- Dissect: Buy Sell Indicator
nasdaq_psx_totalview_itch_v5_0_dissect.buy_sell_indicator = function(buffer, offset, packet, parent)
local length = nasdaq_psx_totalview_itch_v5_0_size_of.buy_sell_indicator
local range = buffer(offset, length)
local value = range:string()
local display = nasdaq_psx_totalview_itch_v5_0_display.buy_sell_indicator(value, buffer, offset, packet, parent)
parent:add(nasdaq_psx_totalview_itch_v5_0.fields.buy_sell_indicator, range, value, display)
return offset + length, value
end
-- Size: Order Reference Number
nasdaq_psx_totalview_itch_v5_0_size_of.order_reference_number = 8
-- Display: Order Reference Number
nasdaq_psx_totalview_itch_v5_0_display.order_reference_number = function(value)
return "Order Reference Number: "..value
end
-- Dissect: Order Reference Number
nasdaq_psx_totalview_itch_v5_0_dissect.order_reference_number = function(buffer, offset, packet, parent)
local length = nasdaq_psx_totalview_itch_v5_0_size_of.order_reference_number
local range = buffer(offset, length)