From b92bf558b72ca98dfeb7ad39bb3cc4eff7b8e726 Mon Sep 17 00:00:00 2001 From: Jayanth Date: Mon, 29 Apr 2024 10:10:06 +0530 Subject: [PATCH] feat: allow setting product type for GTT orders --- gtt.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gtt.go b/gtt.go index c5f159e..524fefd 100644 --- a/gtt.go +++ b/gtt.go @@ -109,12 +109,17 @@ type GTTParams struct { Exchange string LastPrice float64 TransactionType string + Product string Trigger Trigger } func newGTT(o GTTParams) GTT { var orders Orders + if o.Product == "" { + o.Product = ProductCNC + } + for i := range o.Trigger.TriggerValues() { orders = append(orders, Order{ Exchange: o.Exchange, @@ -123,7 +128,7 @@ func newGTT(o GTTParams) GTT { Quantity: o.Trigger.Quantities()[i], Price: o.Trigger.LimitPrices()[i], OrderType: OrderTypeLimit, - Product: ProductCNC, + Product: o.Product, }) } return GTT{