Exemplo n.º 1
0
}

smartApi.convertPosition(params)
gttCreateParams = {
    "tradingsymbol": "SBIN-EQ",
    "symboltoken": "3045",
    "exchange": "NSE",
    "producttype": "MARGIN",
    "transactiontype": "BUY",
    "price": 100000,
    "qty": 10,
    "disclosedqty": 10,
    "triggerprice": 200000,
    "timeperiod": 365
}
rule_id = smartApi.gttCreateRule(gttCreateParams)

gttModifyParams = {
    "id": rule_id,
    "symboltoken": "3045",
    "exchange": "NSE",
    "price": 19500,
    "quantity": 10,
    "triggerprice": 200000,
    "disclosedqty": 10,
    "timeperiod": 365
}
modified_id = smartApi.gttModifyRule(gttModifyParams)

cancelParams = {"id": rule_id, "symboltoken": "3045", "exchange": "NSE"}
Exemplo n.º 2
0
    print("Order placement failed: {}".format(e.message))
#gtt rule creation
try:
    gttCreateParams = {
        "tradingsymbol": "SBIN-EQ",
        "symboltoken": "3045",
        "exchange": "NSE",
        "producttype": "MARGIN",
        "transactiontype": "BUY",
        "price": 100000,
        "qty": 10,
        "disclosedqty": 10,
        "triggerprice": 200000,
        "timeperiod": 365
    }
    rule_id = obj.gttCreateRule(gttCreateParams)
    print("The GTT rule id is: {}".format(rule_id))
except Exception as e:
    print("GTT Rule creation failed: {}".format(e.message))

#gtt rule list
try:
    status = ["FORALL"]  #should be a list
    page = 1
    count = 10
    lists = obj.gttLists(status, page, count)
except Exception as e:
    print("GTT Rule List failed: {}".format(e.message))

#Historic api
try: