zerodha / gokiteconnect

Official Go client for Kite Connect API's
MIT License
178 stars 73 forks source link

Allow specifying product type for NFO GTT orders #103

Closed imJayanth closed 3 months ago

imJayanth commented 5 months ago

When creating a GTT (Good Till Triggered) order using the gokiteconnect library, the product type is assigned as CNC by default. However, in certain cases like trading in derivative instruments (e.g., NFO - Nifty Futures & Options), CNC product type is not allowed, and the order placement fails with the error message:

GTT for NIFTY2450222500CE was triggered: Order placement failed (Trading in NFO is not allowed using CNC product type). Try placing an order in NRML/MIS.

Proposed Solution: Add a parameter for specifying the product type when creating a GTT order. If this parameter is left empty or not provided, the default product type can remain as CNC.

Example Usage:

gttParams := kiteconnect.GTTParams{
    // Other parameters...
    Product: "NRML", // or "MIS" for NFO
}

Additional Information:

imJayanth commented 3 months ago

Release: v4.3.3