Documentation ¶
Index ¶
- Constants
- type DepthBidAskResp
- type DepthDResp
- type DepthQuery
- type DepthResp
- type ExitPositionBody
- type ExitPositionResp
- type FyersApi
- func (f *FyersApi) CancelOrder(ctx context.Context, Body OrderCancelBody) (OrderResp, error)
- func (f *FyersApi) ConvertPosition(ctx context.Context, Body PositionConversionBody) (PositionConversionResp, error)
- func (f *FyersApi) DeleteMultiOrder(ctx context.Context, Body []OrderPlacementBody) (MultiOrderResponse, error)
- func (f *FyersApi) ExitPosition(ctx context.Context, Body ExitPositionBody) (ExitPositionResp, error)
- func (f *FyersApi) GetAccessToken() string
- func (f *FyersApi) GetDepth(ctx context.Context, DepthQuery HistoryQuery) (DepthResp, error)
- func (f *FyersApi) GetHistory(ctx context.Context, HistQuery HistoryQuery) (HistoryResp, error)
- func (f *FyersApi) GetOrderHistory(ctx context.Context, OrderId string) (OrderHistResp, error)
- func (f *FyersApi) GetOrderbook(ctx context.Context, Orderquery OrderBookQuery) (OrderBookResp, error)
- func (f *FyersApi) GetPositionbook(ctx context.Context) (PositionBookResp, error)
- func (f *FyersApi) GetQuotes(ctx context.Context, QotQuery QuotesQuery) (QuotesResp, error)
- func (f *FyersApi) GetTradebook(ctx context.Context, Tradequery TradeBookQuery) (TradeBookResp, error)
- func (f *FyersApi) HeaderBuilder() http.Header
- func (f *FyersApi) ModifyMultiOrder(ctx context.Context, Body []OrderPlacementBody) (MultiOrderResponse, error)
- func (f *FyersApi) ModifyOrder(ctx context.Context, Body OrderModificationBody) (OrderResp, error)
- func (f *FyersApi) PlaceMultiOrder(ctx context.Context, Body []OrderPlacementBody) (MultiOrderResponse, error)
- func (f *FyersApi) PlaceOrder(ctx context.Context, Body OrderPlacementBody) (OrderResp, error)
- func (f *FyersApi) SetAccessToken(accessToken string)
- func (f *FyersApi) SetAppID(appId string)
- func (f *FyersApi) SetAppSecret(appSecret string)
- func (f *FyersApi) SetRedirectURL(redirectURL string)
- type FyersApiOptions
- type HistoryQuery
- type HistoryResp
- type HttpLayer
- type MultiOrderResponse
- type MultiOrderSubResponse
- type NetworkInterface
- type OrderBookItem
- type OrderBookItems
- type OrderBookQuery
- type OrderBookResp
- type OrderCancelBody
- type OrderHistResp
- type OrderModificationBody
- type OrderPlacementBody
- type OrderResp
- type PositionBookNetResp
- type PositionBookNetResps
- type PositionBookOverallResp
- type PositionBookResp
- type PositionConversionBody
- type PositionConversionResp
- type QuotesCmdResp
- type QuotesDResp
- type QuotesQuery
- type QuotesResp
- type QuotesVResp
- type TradeBookItem
- type TradeBookItems
- type TradeBookQuery
- type TradeBookResp
Constants ¶
View Source
const ( URIGetOrders string = "/orders" URIGetTrades string = "/trades" URIGetPositionss string = "/positions" URIGetOrderHistory string = "/orders/%s" // "/orders/{id}" URIOrder string = "/orders/sync" URIMultiOrder string = "/multi-order/sync" URIGetHistory string = "/history" URIGetQuotes string = "/quotes" URIGetDepth string = "/depth" )
API endpoints
View Source
const ( DefaultBaseURI string = "https://api-t1.fyers.in/api/v3" DefaultBaseURIData string = "https://api-t1.fyers.in/data" )
BASE URI
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DepthBidAskResp ¶
type DepthDResp ¶
type DepthDResp struct { Totalbuyqty int `json:"totalbuyqty"` Totalsellqty int `json:"totalsellqty"` Bids []DepthBidAskResp `json:"bids"` Ask []DepthBidAskResp `json:"ask"` O float64 `json:"o"` H float64 `json:"h"` L float64 `json:"l"` C float64 `json:"c"` Chp float64 `json:"chp"` TickSize float64 `json:"tick_Size"` Ch float64 `json:"ch"` Ltq int `json:"ltq"` Ltt int `json:"ltt"` Ltp float64 `json:"ltp"` V int `json:"v"` Atp float64 `json:"atp"` LowerCkt float64 `json:"lower_ckt"` UpperCkt float64 `json:"upper_ckt"` Expiry string `json:"expiry"` Oi int `json:"oi"` Oiflag bool `json:"oiflag"` Pdoi int `json:"pdoi"` Oipercent float64 `json:"oipercent"` }
type DepthQuery ¶
type DepthResp ¶
type DepthResp struct { S string `json:"s"` D map[string]DepthDResp `json:"d"` Message string `json:"message"` }
type ExitPositionBody ¶
type ExitPositionResp ¶
type FyersApi ¶
type FyersApi struct { AppId string AppSecret string RedirectUrl string Logger common.LoggerInterface NetworkInterface // contains filtered or unexported fields }
func NewFyersApi ¶
func NewFyersApi(Opt ...FyersApiOptions) *FyersApi
func (*FyersApi) CancelOrder ¶
func (*FyersApi) ConvertPosition ¶
func (f *FyersApi) ConvertPosition(ctx context.Context, Body PositionConversionBody) (PositionConversionResp, error)
func (*FyersApi) DeleteMultiOrder ¶
func (f *FyersApi) DeleteMultiOrder(ctx context.Context, Body []OrderPlacementBody) (MultiOrderResponse, error)
func (*FyersApi) ExitPosition ¶
func (f *FyersApi) ExitPosition(ctx context.Context, Body ExitPositionBody) (ExitPositionResp, error)
func (*FyersApi) GetAccessToken ¶
func (*FyersApi) GetHistory ¶
func (f *FyersApi) GetHistory(ctx context.Context, HistQuery HistoryQuery) (HistoryResp, error)
func (*FyersApi) GetOrderHistory ¶
func (*FyersApi) GetOrderbook ¶
func (f *FyersApi) GetOrderbook(ctx context.Context, Orderquery OrderBookQuery) (OrderBookResp, error)
func (*FyersApi) GetPositionbook ¶
func (f *FyersApi) GetPositionbook(ctx context.Context) (PositionBookResp, error)
func (*FyersApi) GetQuotes ¶
func (f *FyersApi) GetQuotes(ctx context.Context, QotQuery QuotesQuery) (QuotesResp, error)
func (*FyersApi) GetTradebook ¶
func (f *FyersApi) GetTradebook(ctx context.Context, Tradequery TradeBookQuery) (TradeBookResp, error)
func (*FyersApi) HeaderBuilder ¶
func (*FyersApi) ModifyMultiOrder ¶
func (f *FyersApi) ModifyMultiOrder(ctx context.Context, Body []OrderPlacementBody) (MultiOrderResponse, error)
func (*FyersApi) ModifyOrder ¶
func (*FyersApi) PlaceMultiOrder ¶
func (f *FyersApi) PlaceMultiOrder(ctx context.Context, Body []OrderPlacementBody) (MultiOrderResponse, error)
func (*FyersApi) PlaceOrder ¶
func (*FyersApi) SetAccessToken ¶
func (*FyersApi) SetAppSecret ¶
func (*FyersApi) SetRedirectURL ¶
type FyersApiOptions ¶
type FyersApiOptions struct { Version string Debug bool BaseURI string BaseURIData string LogFilePath string WriteToFile *bool Logger common.LoggerInterface NetworkInterface }
type HistoryQuery ¶
type HistoryResp ¶
type HttpLayer ¶
type HttpLayer struct { Logger common.LoggerInterface Debug bool }
type MultiOrderResponse ¶
type MultiOrderResponse struct { S string `json:"s"` Code int `json:"code"` Message string `json:"message"` Data MultiOrderSubResponse `json:"data"` }
type MultiOrderSubResponse ¶
type NetworkInterface ¶
type OrderBookItem ¶
type OrderBookItem struct { ClientID string `json:"clientId"` ID string `json:"id"` ExchOrdID string `json:"exchOrdId"` Qty int `json:"qty"` RemainingQuantity int `json:"remainingQuantity"` FilledQty int `json:"filledQty"` DiscloseQty int `json:"discloseQty"` LimitPrice float64 `json:"limitPrice"` StopPrice int `json:"stopPrice"` TradedPrice float64 `json:"tradedPrice"` Type int `json:"type"` FyToken string `json:"fyToken"` Exchange int `json:"exchange"` Segment int `json:"segment"` Symbol string `json:"symbol"` Instrument int `json:"instrument"` Message string `json:"message"` OfflineOrder bool `json:"offlineOrder"` OrderDateTime string `json:"orderDateTime"` OrderValidity string `json:"orderValidity"` Pan string `json:"pan"` ProductType string `json:"productType"` Side int `json:"side"` Status int `json:"status"` Source string `json:"source"` ExSym string `json:"ex_sym"` Description string `json:"description"` Ch float64 `json:"ch"` Chp float64 `json:"chp"` Lp float64 `json:"lp"` SlNo int `json:"slNo"` DqQtyRem int `json:"dqQtyRem"` OrderNumStatus string `json:"orderNumStatus"` DisclosedQty int `json:"disclosedQty"` OrderTag string `json:"orderTag"` }
type OrderBookItems ¶
type OrderBookItems []OrderBookItem
type OrderBookQuery ¶
type OrderBookResp ¶
type OrderBookResp struct { S string `json:"s"` Code int `json:"code"` Message string `json:"message"` OrderBook OrderBookItems `json:"orderBook"` }
type OrderCancelBody ¶
type OrderCancelBody struct {
ID string `json:"id"`
}
type OrderHistResp ¶
type OrderHistResp struct { S string `json:"s"` Code int `json:"code"` Message string `json:"message"` Data OrderBookItems `json:"data"` }
type OrderModificationBody ¶
type OrderModificationBody struct { Id string `json:"id"` Qty int `json:"qty,omitempty"` Type int `json:"type,omitempty"` LimitPrice float64 `json:"limitPrice,omitempty"` StopPrice float64 `json:"stopPrice,omitempty"` Validity string `json:"validity,omitempty"` TakeProfit float64 `json:"takeProfit,omitempty"` StopLoss float64 `json:"stopLoss,omitempty"` }
type OrderPlacementBody ¶
type OrderPlacementBody struct { Symbol string `json:"symbol"` Qty int `json:"qty"` Type int `json:"type"` Side int `json:"side"` ProductType string `json:"productType"` LimitPrice float64 `json:"limitPrice"` StopPrice float64 `json:"stopPrice"` Validity string `json:"validity"` DisclosedQty int `json:"disclosedQty"` OfflineOrder bool `json:"offlineOrder"` TakeProfit float64 `json:"takeProfit"` StopLoss float64 `json:"stopLoss,omitempty"` OrderTag string `json:"orderTag,omitempty"` }
type PositionBookNetResp ¶
type PositionBookNetResp struct { NetQty int `json:"netQty"` Qty int `json:"qty"` AvgPrice int `json:"avgPrice"` NetAvg int `json:"netAvg"` Side int `json:"side"` ProductType string `json:"productType"` RealizedProfit int `json:"realized_profit"` UnrealizedProfit int `json:"unrealized_profit"` Pl int `json:"pl"` Ltp int `json:"ltp"` BuyQty int `json:"buyQty"` BuyAvg int `json:"buyAvg"` BuyVal int `json:"buyVal"` SellQty int `json:"sellQty"` SellAvg int `json:"sellAvg"` SellVal int `json:"sellVal"` SlNo int `json:"slNo"` FyToken string `json:"fyToken"` CrossCurrency string `json:"crossCurrency"` RbiRefRate int `json:"rbiRefRate"` QtyMultiCom int `json:"qtyMulti_com"` Segment int `json:"segment"` Symbol string `json:"symbol"` ID string `json:"id"` CfBuyQty int `json:"cfBuyQty"` CfSellQty int `json:"cfSellQty"` DayBuyQty int `json:"dayBuyQty"` DaySellQty int `json:"daySellQty"` Exchange int `json:"exchange"` }
type PositionBookNetResps ¶
type PositionBookNetResps []PositionBookNetResp
type PositionBookOverallResp ¶
type PositionBookResp ¶
type PositionBookResp struct { S string `json:"s"` Code int `json:"code"` Message string `json:"message"` NetPositions PositionBookNetResps `json:"netPositions"` Overall PositionBookOverallResp `json:"overall"` }
type PositionConversionBody ¶
type PositionConversionResp ¶
type QuotesCmdResp ¶
type QuotesDResp ¶
type QuotesDResp struct { N string `json:"n"` S string `json:"s"` V QuotesVResp `json:"v"` }
type QuotesQuery ¶
type QuotesQuery struct {
Symbols []string
}
type QuotesResp ¶
type QuotesResp struct { Code int `json:"code"` D []QuotesDResp `json:"d"` Message string `json:"message"` S string `json:"s"` }
type QuotesVResp ¶
type QuotesVResp struct { Ask float64 `json:"ask"` Bid float64 `json:"bid"` Ch float64 `json:"ch"` Chp float64 `json:"chp"` Cmd QuotesCmdResp `json:"cmd"` Description string `json:"description"` Exchange string `json:"exchange"` FyToken string `json:"fyToken"` HighPrice float64 `json:"high_price"` LowPrice float64 `json:"low_price"` Lp float64 `json:"lp"` OpenPrice float64 `json:"open_price"` OriginalName string `json:"original_name"` PrevClosePrice float64 `json:"prev_close_price"` ShortName string `json:"short_name"` Spread float64 `json:"spread"` Symbol string `json:"symbol"` Tt string `json:"tt"` Volume int `json:"volume"` }
type TradeBookItem ¶
type TradeBookItem struct { ClientID string `json:"clientId"` OrderDateTime string `json:"orderDateTime"` OrderNumber string `json:"orderNumber"` ExchangeOrderNo string `json:"exchangeOrderNo"` Exchange int `json:"exchange"` Side int `json:"side"` Segment int `json:"segment"` OrderType int `json:"orderType"` FyToken string `json:"fyToken"` ProductType string `json:"productType"` TradedQty int `json:"tradedQty"` TradePrice float64 `json:"tradePrice"` TradeValue float64 `json:"tradeValue"` TradeNumber string `json:"tradeNumber"` Row int `json:"row"` Symbol string `json:"symbol"` OrderTag string `json:"orderTag"` }
type TradeBookItems ¶
type TradeBookItems []TradeBookItem
type TradeBookQuery ¶
type TradeBookQuery struct {
OrderTag string `url:"order_tag,omitempty"`
}
type TradeBookResp ¶
type TradeBookResp struct { S string `json:"s"` Code int `json:"code"` Message string `json:"message"` OrderBook TradeBookItems `json:"tradeBook"` }
Click to show internal directories.
Click to hide internal directories.