Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sreenivasdoosa
GitHub Repository: sreenivasdoosa/sdoosa-algo-trade-python
Path: blob/master/src/ordermgmt/OrderInputParams.py
297 views
1
2
from models.Segment import Segment
3
from models.ProductType import ProductType
4
5
class OrderInputParams:
6
def __init__(self, tradingSymbol):
7
self.exchange = "NSE" # default
8
self.isFnO = False
9
self.segment = Segment.EQUITY # default
10
self.productType = ProductType.MIS # default
11
self.tradingSymbol = tradingSymbol
12
self.direction = ""
13
self.orderType = "" # One of the values of ordermgmt.OrderType
14
self.qty = 0
15
self.price = 0
16
self.triggerPrice = 0 # Applicable in case of SL order
17
18
def __str__(self):
19
return "symbol=" + str(self.tradingSymbol) + ", exchange=" + self.exchange \
20
+ ", productType=" + self.productType + ", segment=" + self.segment \
21
+ ", direction=" + self.direction + ", orderType=" + self.orderType \
22
+ ", qty=" + str(self.qty) + ", price=" + str(self.price) + ", triggerPrice=" + str(self.triggerPrice) \
23
+ ", isFnO=" + str(self.isFnO)
24
25