forked from zerodha/gokiteconnect
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
67 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
package kiteconnect | ||
|
||
type TriggerType string | ||
|
||
const ( | ||
Single TriggerType = "single" | ||
TwoLeg TriggerType = "two-leg" | ||
) | ||
|
||
type Triggers []Trigger | ||
|
||
type GTTMeta struct { | ||
RejectionReason string `json:"rejection_reason"` | ||
} | ||
|
||
type GTTCondition struct { | ||
Exchange string `json:"exchange"` | ||
LastPrice float64 `json:"last_price"` | ||
Tradingsymbol string `json:"tradingsymbol"` | ||
TriggerValues []float64 `json:"trigger_values"` | ||
} | ||
|
||
type Trigger struct { | ||
ID int `json:"id"` | ||
UserID string `json:"user_id"` | ||
ParentTrigger interface{} `json:"parent_trigger"` | ||
Type string `json:"type"` | ||
CreatedAt string `json:"created_at"` | ||
UpdatedAt string `json:"updated_at"` | ||
ExpiresAt string `json:"expires_at"` | ||
Status string `json:"status"` | ||
Condition GTTCondition `json:"condition"` | ||
Orders []Order `json:"orders"` | ||
Meta GTTMeta `json:"meta"` | ||
} | ||
|
||
type GTTOrderParams struct { | ||
Tradingsymbol string | ||
Exchange string | ||
LastPrice float64 | ||
Type TriggerType | ||
TriggerValues []float64 | ||
Orders []Order | ||
} | ||
|
||
func AddTrigger(o GTTOrderParams) error { | ||
return nil | ||
} | ||
|
||
func UpdateTrigger(triggerID int) error { | ||
return nil | ||
} | ||
|
||
func GetTriggers() (Triggers, error) { | ||
return nil, nil | ||
} | ||
|
||
func GetTrigger(triggerID int) (Trigger, error) { | ||
return Trigger{}, nil | ||
} | ||
|
||
func RemoveTrigger(triggerID int) error { | ||
return nil | ||
} |