Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a0351324f9 | ||
|
|
3f936c17d7 | ||
|
|
71aeebfb44 | ||
|
|
0aa91d4e79 | ||
|
|
08244f17f2 | ||
|
|
4d775e9000 |
No files matched your search
@@ -14,6 +14,7 @@ from PIL.Image import open as image_open
|
||||
from PIL.ImageFile import ImageFile
|
||||
from io import BytesIO
|
||||
from asyncio import sleep
|
||||
from uuid import uuid4
|
||||
|
||||
# ========================================|======================================== #
|
||||
# Class Definitions #
|
||||
@@ -42,8 +43,6 @@ class Order:
|
||||
'DAY',
|
||||
'GTC', # Good Till Cancelled
|
||||
'GTD', # Good Till Date
|
||||
'FAK', # Fill And Kill
|
||||
'FOK', # Fill Or Kill
|
||||
] = 'DAY',
|
||||
ValidityDate : int = 0,
|
||||
):
|
||||
@@ -70,6 +69,8 @@ class Order:
|
||||
True if the order has been deleted.
|
||||
OrderId : HexUUID | None
|
||||
Unique identifier of the order after submission.
|
||||
OrderOmsId : str | None
|
||||
Unique identifier of the order assigned by the OMS.
|
||||
OrderStatus : 'Unknown' | 'InQueue' | 'PartiallyFilled' | 'Cancelled' | 'Broken' | 'Settled'
|
||||
Current lifecycle status of the order. The value is 'Unknown' until a status is received from the server.
|
||||
|
||||
@@ -96,7 +97,7 @@ class Order:
|
||||
self.Volume : int = Volume
|
||||
self.is_deleted : bool = False
|
||||
self.OrderStatus : Literal[
|
||||
'Unknown'
|
||||
'Unknown',
|
||||
'InQueue',
|
||||
'PartiallyFilled',
|
||||
'Cancelled',
|
||||
@@ -104,7 +105,8 @@ class Order:
|
||||
'Settled',
|
||||
] = 'Unknown'
|
||||
|
||||
self.OrderId : HexUUID | None = None
|
||||
self.OrderId : HexUUID | None = None
|
||||
self.OrderOmsId : str | None = None
|
||||
|
||||
# +--------------------------------------------------------------------------------------+ #
|
||||
|
||||
@@ -138,7 +140,9 @@ class Order:
|
||||
|
||||
case 200 :
|
||||
|
||||
self.OrderId = SendOrder_Response.json()['Data']['order_uuid']
|
||||
data = SendOrder_Response.json()
|
||||
self.OrderId = data['Data']['order_uuid']
|
||||
self.OrderOmsId = data['Data']['order_oms_id']
|
||||
return None
|
||||
|
||||
case _ : return None
|
||||
@@ -213,11 +217,10 @@ class Order:
|
||||
|
||||
Edit_response = Edit_response.json()
|
||||
|
||||
self.OrderId = Edit_response['Data']['order_uuid']
|
||||
self.ValidityType = Edit_response['Data']['order_validity_type']
|
||||
self.ValidityDate = ValidityDate
|
||||
self.Price = Edit_response['Data']['order_price']
|
||||
self.Volume = Edit_response['Data']['order_volume']
|
||||
self.Price = Edit_response['Data']['order_price']
|
||||
self.Volume = Edit_response['Data']['order_volume']
|
||||
return None
|
||||
|
||||
case _ :
|
||||
@@ -434,6 +437,7 @@ class EmsEngine_TseIfb_AsyncClient:
|
||||
self,
|
||||
OMS : Literal[
|
||||
'Omex | Parsian',
|
||||
'Omex | Khobregan',
|
||||
'Sahra | Karamad',
|
||||
'Sahra | NIBB',
|
||||
]
|
||||
@@ -557,8 +561,6 @@ class EmsEngine_TseIfb_AsyncClient:
|
||||
'DAY',
|
||||
'GTC', # Good Till Cancelled
|
||||
'GTD', # Good Till Date
|
||||
'FAK', # Fill And Kill
|
||||
'FOK', # Fill Or Kill
|
||||
] = 'DAY',
|
||||
ValidityDate : int = 0,
|
||||
)-> Order | None:
|
||||
@@ -615,7 +617,8 @@ class EmsEngine_TseIfb_AsyncClient:
|
||||
'ValidityDate' : ValidityDate,
|
||||
'symbolName' : symbolName,
|
||||
'Price' : Price,
|
||||
'Volume' : Volume
|
||||
'Volume' : Volume,
|
||||
'InitialOrderId' : uuid4().hex,
|
||||
}
|
||||
}
|
||||
)
|
||||
@@ -635,8 +638,6 @@ class EmsEngine_TseIfb_AsyncClient:
|
||||
'DAY',
|
||||
'GTC', # Good Till Cancelled
|
||||
'GTD', # Good Till Date
|
||||
'FAK', # Fill And Kill
|
||||
'FOK', # Fill Or Kill
|
||||
] = 'DAY',
|
||||
ValidityDate : int = 0,
|
||||
)-> Order | None:
|
||||
@@ -693,7 +694,8 @@ class EmsEngine_TseIfb_AsyncClient:
|
||||
'ValidityDate' : ValidityDate,
|
||||
'symbolName' : symbolName,
|
||||
'Price' : Price,
|
||||
'Volume' : Volume
|
||||
'Volume' : Volume,
|
||||
'InitialOrderId' : uuid4().hex,
|
||||
}
|
||||
}
|
||||
)
|
||||
@@ -712,8 +714,6 @@ class EmsEngine_TseIfb_AsyncClient:
|
||||
'DAY',
|
||||
'GTC', # Good Till Cancelled
|
||||
'GTD', # Good Till Date
|
||||
'FAK', # Fill And Kill
|
||||
'FOK', # Fill Or Kill
|
||||
] = 'DAY',
|
||||
ValidityDate : int = 0,
|
||||
)-> Order | None:
|
||||
@@ -770,7 +770,8 @@ class EmsEngine_TseIfb_AsyncClient:
|
||||
'ValidityDate' : ValidityDate,
|
||||
'symbolIsin' : symbolIsin,
|
||||
'Price' : Price,
|
||||
'Volume' : Volume
|
||||
'Volume' : Volume,
|
||||
'InitialOrderId' : uuid4().hex,
|
||||
}
|
||||
}
|
||||
)
|
||||
@@ -789,8 +790,6 @@ class EmsEngine_TseIfb_AsyncClient:
|
||||
'DAY',
|
||||
'GTC', # Good Till Cancelled
|
||||
'GTD', # Good Till Date
|
||||
'FAK', # Fill And Kill
|
||||
'FOK', # Fill Or Kill
|
||||
] = 'DAY',
|
||||
ValidityDate : int = 0,
|
||||
)-> Order | None:
|
||||
@@ -847,7 +846,8 @@ class EmsEngine_TseIfb_AsyncClient:
|
||||
'ValidityDate' : ValidityDate,
|
||||
'symbolIsin' : symbolIsin,
|
||||
'Price' : Price,
|
||||
'Volume' : Volume
|
||||
'Volume' : Volume,
|
||||
'InitialOrderId' : uuid4().hex,
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
@@ -13,6 +13,7 @@ from HedgeTech.Auth import AuthSyncClient
|
||||
from PIL.Image import open as image_open
|
||||
from PIL.ImageFile import ImageFile
|
||||
from io import BytesIO
|
||||
from uuid import uuid4
|
||||
|
||||
# ========================================|======================================== #
|
||||
# Class Definitions #
|
||||
@@ -43,8 +44,6 @@ class Order:
|
||||
'DAY',
|
||||
'GTC', # Good Till Cancelled
|
||||
'GTD', # Good Till Date
|
||||
'FAK', # Fill And Kill
|
||||
'FOK', # Fill Or Kill
|
||||
] = 'DAY',
|
||||
):
|
||||
|
||||
@@ -70,10 +69,12 @@ class Order:
|
||||
|
||||
Price : int
|
||||
Order price.
|
||||
|
||||
Volume : int
|
||||
Order volume.
|
||||
|
||||
OrderId : HexUUID | None
|
||||
Unique identifier of the order after submission.
|
||||
OrderOmsId : str | None
|
||||
Unique identifier of the order assigned by the OMS.
|
||||
OrderStatus : 'Unknown' | 'InQueue' | 'PartiallyFilled' | 'Cancelled' | 'Broken' | 'Settled'
|
||||
Current lifecycle status of the order. The value is 'Unknown' until a status is received from the server.
|
||||
|
||||
@@ -104,7 +105,8 @@ class Order:
|
||||
'PartiallyFilled',
|
||||
] = 'Unknown'
|
||||
|
||||
self.OrderId : HexUUID | None = None
|
||||
self.OrderId : HexUUID | None = None
|
||||
self.OrderOmsId : str | None = None
|
||||
|
||||
# +--------------------------------------------------------------------------------------+ #
|
||||
|
||||
@@ -141,8 +143,10 @@ class Order:
|
||||
match SendOrder_Response.status_code :
|
||||
|
||||
case 200 :
|
||||
|
||||
self.OrderId = SendOrder_Response.json()['Data']['order_uuid']
|
||||
|
||||
data = SendOrder_Response.json()
|
||||
self.OrderId = data['Data']['order_uuid']
|
||||
self.OrderOmsId = data['Data']['order_oms_id']
|
||||
return None
|
||||
|
||||
case _ : return None
|
||||
@@ -225,11 +229,10 @@ class Order:
|
||||
|
||||
Edit_response = Edit_response.json()
|
||||
|
||||
self.OrderId = Edit_response['Data']['order_uuid']
|
||||
self.ValidityType = Edit_response['Data']['order_validity_type']
|
||||
self.ValidityDate = ValidityDate
|
||||
self.Price = Edit_response['Data']['order_price']
|
||||
self.Volume = Edit_response['Data']['order_volume']
|
||||
self.Price = Edit_response['Data']['order_price']
|
||||
self.Volume = Edit_response['Data']['order_volume']
|
||||
return None
|
||||
|
||||
case _ :
|
||||
@@ -467,6 +470,7 @@ class EmsEngine_TseIfb_SyncClient:
|
||||
self,
|
||||
OMS : Literal[
|
||||
'Omex | Parsian',
|
||||
'Omex | Khobregan',
|
||||
'Sahra | Karamad',
|
||||
'Sahra | NIBB',
|
||||
]
|
||||
@@ -579,7 +583,6 @@ class EmsEngine_TseIfb_SyncClient:
|
||||
|
||||
# +--------------------------------------------------------------------------------------+ #
|
||||
|
||||
|
||||
def Buy_by_Name(
|
||||
self,
|
||||
*,
|
||||
@@ -590,8 +593,6 @@ class EmsEngine_TseIfb_SyncClient:
|
||||
'DAY',
|
||||
'GTC', # Good Till Cancelled
|
||||
'GTD', # Good Till Date
|
||||
'FAK', # Fill And Kill
|
||||
'FOK', # Fill Or Kill
|
||||
] = 'DAY',
|
||||
ValidityDate : int = 0,
|
||||
)-> Order | None:
|
||||
@@ -644,7 +645,8 @@ class EmsEngine_TseIfb_SyncClient:
|
||||
'ValidityDate' : ValidityDate,
|
||||
'symbolName' : symbolName,
|
||||
'Price' : Price,
|
||||
'Volume' : Volume
|
||||
'Volume' : Volume,
|
||||
'InitialOrderId' : uuid4().hex,
|
||||
}
|
||||
}
|
||||
)
|
||||
@@ -665,8 +667,6 @@ class EmsEngine_TseIfb_SyncClient:
|
||||
'DAY',
|
||||
'GTC', # Good Till Cancelled
|
||||
'GTD', # Good Till Date
|
||||
'FAK', # Fill And Kill
|
||||
'FOK', # Fill Or Kill
|
||||
] = 'DAY',
|
||||
ValidityDate : int = 0,
|
||||
)-> Order | None:
|
||||
@@ -719,7 +719,8 @@ class EmsEngine_TseIfb_SyncClient:
|
||||
'ValidityDate' : ValidityDate,
|
||||
'symbolName' : symbolName,
|
||||
'Price' : Price,
|
||||
'Volume' : Volume
|
||||
'Volume' : Volume,
|
||||
'InitialOrderId' : uuid4().hex,
|
||||
}
|
||||
}
|
||||
)
|
||||
@@ -738,8 +739,6 @@ class EmsEngine_TseIfb_SyncClient:
|
||||
'DAY',
|
||||
'GTC', # Good Till Cancelled
|
||||
'GTD', # Good Till Date
|
||||
'FAK', # Fill And Kill
|
||||
'FOK', # Fill Or Kill
|
||||
] = 'DAY',
|
||||
ValidityDate : int = 0,
|
||||
)-> Order | None:
|
||||
@@ -792,7 +791,8 @@ class EmsEngine_TseIfb_SyncClient:
|
||||
'ValidityDate' : ValidityDate,
|
||||
'symbolIsin' : symbolIsin,
|
||||
'Price' : Price,
|
||||
'Volume' : Volume
|
||||
'Volume' : Volume,
|
||||
'InitialOrderId' : uuid4().hex,
|
||||
}
|
||||
}
|
||||
)
|
||||
@@ -811,8 +811,6 @@ class EmsEngine_TseIfb_SyncClient:
|
||||
'DAY',
|
||||
'GTC', # Good Till Cancelled
|
||||
'GTD', # Good Till Date
|
||||
'FAK', # Fill And Kill
|
||||
'FOK', # Fill Or Kill
|
||||
] = 'DAY',
|
||||
ValidityDate : int = 0,
|
||||
)-> Order | None:
|
||||
@@ -865,7 +863,8 @@ class EmsEngine_TseIfb_SyncClient:
|
||||
'ValidityDate' : ValidityDate,
|
||||
'symbolIsin' : symbolIsin,
|
||||
'Price' : Price,
|
||||
'Volume' : Volume
|
||||
'Volume' : Volume,
|
||||
'InitialOrderId' : uuid4().hex,
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
||||
|
||||
[project]
|
||||
name = "HedgeTech"
|
||||
version = "0.3.1b4"
|
||||
version = "0.3.2b1"
|
||||
description = "A unified, high-performance API layer that powers all trading infrastructure across the HedgeTech ecosystem, providing modular, scalable, and real-time interfaces for market data, order management, and execution systems."
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.10"
|
||||
|
||||
Reference in new issue
Block a user