tradx 0.1.1.2__py3-none-any.whl → 0.1.1.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
tradx/marketDataEngine.py
CHANGED
@@ -646,19 +646,16 @@ class marketDataEngine(MarketDataSocketClient):
|
|
646
646
|
baseAlgo: BaseAlgo,
|
647
647
|
):
|
648
648
|
"""
|
649
|
-
Simulates a market order
|
649
|
+
Simulates a market order for the given instrument.
|
650
650
|
Args:
|
651
|
-
exchangeSegment (str): The segment of the
|
652
|
-
exchangeInstrumentID (int): The
|
653
|
-
productType (str): The
|
651
|
+
exchangeSegment (str): The exchange segment of the instrument.
|
652
|
+
exchangeInstrumentID (int): The exchange instrument ID.
|
653
|
+
productType (str): The product type.
|
654
654
|
orderQuantity (int): The quantity of the order. Positive for buy, negative for sell.
|
655
655
|
orderUniqueIdentifier (str): A unique identifier for the order.
|
656
|
-
baseAlgo (BaseAlgo): An instance of
|
656
|
+
baseAlgo (BaseAlgo): An instance of a class derived from BaseAlgo, representing the algorithm to be used for processing the trade event.
|
657
657
|
Returns:
|
658
658
|
None
|
659
|
-
This function fetches the last traded price (LTP) for the given instrument and creates a TradeEvent
|
660
|
-
based on whether the order is a buy or sell. The TradeEvent is then passed to the baseAlgo's trade_
|
661
|
-
method for further processing.
|
662
659
|
"""
|
663
660
|
_list = await self.fetch_ltp(
|
664
661
|
[
|
@@ -694,7 +691,7 @@ class marketDataEngine(MarketDataSocketClient):
|
|
694
691
|
"OrderQuantity": abs(orderQuantity),
|
695
692
|
"OrderStopPrice": 0,
|
696
693
|
"OrderStatus": "Filled",
|
697
|
-
"OrderAverageTradedPrice": _data.
|
694
|
+
"OrderAverageTradedPrice": _data.BidInfo.Price,
|
698
695
|
"LeavesQuantity": 0,
|
699
696
|
"CumulativeQuantity": abs(orderQuantity),
|
700
697
|
"OrderDisclosedQuantity": 0,
|
@@ -704,13 +701,13 @@ class marketDataEngine(MarketDataSocketClient):
|
|
704
701
|
"CancelRejectReason": "",
|
705
702
|
"OrderUniqueIdentifier": orderUniqueIdentifier,
|
706
703
|
"OrderLegStatus": "SingleOrderLeg",
|
707
|
-
"LastTradedPrice": _data.
|
704
|
+
"LastTradedPrice": _data.BidInfo.Price,
|
708
705
|
"LastTradedQuantity": 0,
|
709
706
|
"LastExecutionTransactTime": "2025-01-06T10:14:40",
|
710
707
|
"ExecutionID": "402597456",
|
711
708
|
"ExecutionReportIndex": 4,
|
712
709
|
"IsSpread": False,
|
713
|
-
"OrderAverageTradedPriceAPI": _data.
|
710
|
+
"OrderAverageTradedPriceAPI": _data.BidInfo.Price,
|
714
711
|
"OrderSideAPI": "SELL",
|
715
712
|
"OrderGeneratedDateTimeAPI": datetime.now(),
|
716
713
|
"ExchangeTransactTimeAPI": datetime.now(),
|
@@ -746,7 +743,7 @@ class marketDataEngine(MarketDataSocketClient):
|
|
746
743
|
"OrderQuantity": orderQuantity,
|
747
744
|
"OrderStopPrice": 0,
|
748
745
|
"OrderStatus": "Filled",
|
749
|
-
"OrderAverageTradedPrice": _data.
|
746
|
+
"OrderAverageTradedPrice": _data.AskInfo.Price,
|
750
747
|
"LeavesQuantity": 0,
|
751
748
|
"CumulativeQuantity": orderQuantity,
|
752
749
|
"OrderDisclosedQuantity": 0,
|
@@ -756,13 +753,13 @@ class marketDataEngine(MarketDataSocketClient):
|
|
756
753
|
"CancelRejectReason": "",
|
757
754
|
"OrderUniqueIdentifier": orderUniqueIdentifier,
|
758
755
|
"OrderLegStatus": "SingleOrderLeg",
|
759
|
-
"LastTradedPrice": _data.
|
756
|
+
"LastTradedPrice": _data.AskInfo.Price,
|
760
757
|
"LastTradedQuantity": 0,
|
761
758
|
"LastExecutionTransactTime": "2025-01-15T15:09:56",
|
762
759
|
"ExecutionID": "409661490",
|
763
760
|
"ExecutionReportIndex": 3,
|
764
761
|
"IsSpread": False,
|
765
|
-
"OrderAverageTradedPriceAPI": _data.
|
762
|
+
"OrderAverageTradedPriceAPI": _data.AskInfo.Price,
|
766
763
|
"OrderSideAPI": "BUY",
|
767
764
|
"OrderGeneratedDateTimeAPI": "15-01-2025 15:10:00",
|
768
765
|
"ExchangeTransactTimeAPI": "15-01-2025 15:09:56",
|
@@ -2,7 +2,7 @@ tradx/__init__.py,sha256=MlWuula4lJZLPYPi4d5ZE9yoJnYWtgbZ0QsgWdWPwU0,53
|
|
2
2
|
tradx/algoContainer.py,sha256=1IkVCIF_gXIby8z3pDdlVeUablh-PZVZ1EawyCB7oUs,3807
|
3
3
|
tradx/dualHashMap.py,sha256=XsidIc3aMvpVGOvdfV7lOeZaLCWAD5i180BGyAfdYXE,1737
|
4
4
|
tradx/interactiveEngine.py,sha256=DCuEEYJcTn6DEG9pbaZsmGyHeyWGNG2q46Iljel6Drc,34584
|
5
|
-
tradx/marketDataEngine.py,sha256=
|
5
|
+
tradx/marketDataEngine.py,sha256=MBZ4qPK35pRA6XsTMGXbuZTpGWo-JCGdC30DJVHIQdQ,34337
|
6
6
|
tradx/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
7
7
|
tradx/baseClass/baseAlgo.py,sha256=KClbu25jAP4s3oWjRW1PEaZc0FIqj_ynqT_Xr3fea14,13670
|
8
8
|
tradx/baseClass/candleData.py,sha256=tS-iAoRGwK2xVSvrqmNZPYeB63qD53oPPHaUDfJBWkk,2947
|
@@ -28,6 +28,6 @@ tradx/baseClass/tradeEvent.py,sha256=djunJW5AzjeMfJZVMlrFprplB7vrYBi-mmaR1TA0MK4
|
|
28
28
|
tradx/constants/holidays.py,sha256=GCg0xGvXm1EM0n6YF1KYEnldSiC2sbsc09Iekjwn0ww,1547
|
29
29
|
tradx/logger/logger.py,sha256=DfrjzwYkujTq7arksNTPcQeioXnwT1xgN659blhreog,3232
|
30
30
|
tradx/logger/logger2.py,sha256=ebJ-qqnpnCqvyx1Cz1-kGGULtkH-hfrK6UNfa0bSlH8,2654
|
31
|
-
tradx-0.1.1.
|
32
|
-
tradx-0.1.1.
|
33
|
-
tradx-0.1.1.
|
31
|
+
tradx-0.1.1.3.dist-info/METADATA,sha256=1G8MjvwtFJnu1JgqBgOZFyqst3kC8f5RbuNRb3Ny4GY,2629
|
32
|
+
tradx-0.1.1.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
33
|
+
tradx-0.1.1.3.dist-info/RECORD,,
|
File without changes
|