tradetransaction

package
v0.9.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 23, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Copyright 2021 Sander Ruscigno

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TradeRequest

type TradeRequest struct {
	AccountID      int64     `json:"account_id"`      // Account ID
	RequestID      int64     `json:"request_id"`      // Request ID
	CreationOrder  int64     `json:"creation_order"`  // Creation order
	Action         string    `json:"action"`          // Trade operation type
	Magic          int64     `json:"magic"`           // Expert Advisor ID (magic number)
	OrderID        int64     `json:"order_id"`        // Order ticket
	Symbol         string    `json:"symbol"`          // Trade symbol
	Volume         float64   `json:"volume"`          // Requested volume for a deal in lots
	Price          float64   `json:"price"`           // Price
	Stoplimit      float64   `json:"stoplimit"`       // StopLimit level of the order
	StopLoss       float64   `json:"stop_loss"`       // Stop Loss level of the order
	TakeProfit     float64   `json:"take_profit"`     // Take Profit level of the order
	Deviation      int64     `json:"deviation"`       // Maximal possible deviation from the requested price
	OrderType      string    `json:"order_type"`      // Order type
	TypeFilling    string    `json:"type_filling"`    // Order execution type
	TypeTime       string    `json:"type_time"`       // Order expiration type
	TimeExpiration time.Time `json:"time_expiration"` // Order expiration time (for the orders of ORDER_TIME_SPECIFIED type)
	Comment        string    `json:"comment"`         // Order comment
	Position       int64     `json:"position"`        // TradeTransaction ticket
	PositionBy     int64     `json:"position_by"`     // The ticket of an opposite tradetransaction
	Created        time.Time `json:"created"`
	Updated        time.Time `json:"updated"`
	Deleted        time.Time `json:"deleted"`
}

TradeRequest:The Structure of a Trade Request Result

type TradeResult

type TradeResult struct {
	AccountID       int64     `json:"account_id"`       // Account ID
	ResultID        int64     `json:"result_id"`        // Result ID
	CreationOrder   int64     `json:"creation_order"`   // Creation order
	RetCode         uint32    `json:"retcode"`          // Operation return code
	DealID          int64     `json:"deal_id"`          // Deal ticket, if it is performed
	OrderID         int64     `json:"order_id"`         // Order ticket, if it is placed
	Volume          float64   `json:"volume"`           // Deal volume, confirmed by broker
	Price           float64   `json:"price"`            // Deal price, confirmed by broker
	Bid             float64   `json:"bid"`              // Current Bid price
	Ask             float64   `json:"ask"`              // Current Ask price
	Comment         string    `json:"comment"`          // Broker comment to operation (by default it is filled by description of trade server return code)
	RequestID       uint32    `json:"request_id"`       // Request ID set by the terminal during the dispatch
	RetcodeExternal uint32    `json:"retcode_external"` // Return code of an external trading system
	Created         time.Time `json:"created"`
	Updated         time.Time `json:"updated"`
	Deleted         time.Time `json:"deleted"`
}

TradeTransaction: Execution of trade operations results in the opening of a tradetransaction

type TradeTransaction

type TradeTransaction struct {
	AccountID       int64     `json:"account_id"`        // Account ID
	TransactionID   int64     `json:"transaction_id"`    // Transaction ID
	CreationOrder   int64     `json:"creation_order"`    // Creation order
	DealID          int64     `json:"deal_id"`           // Deal ticket
	OrderID         int64     `json:"order_id"`          // Order ticket
	Symbol          string    `json:"symbol"`            // Trade symbol name
	TradeType       string    `json:"trade_type"`        // Trade transaction type
	OrderType       string    `json:"order_type"`        // Order type
	OrderState      string    `json:"order_state"`       // Order state
	DealType        string    `json:"deal_type"`         // Deal type
	TimeType        string    `json:"time_type"`         // Order type by action period
	TimeExpiration  time.Time `json:"time_expiration"`   // Order expiration time
	Price           float64   `json:"price"`             // Price
	PriceTrigger    float64   `json:"price_trigger"`     // Stop limit order activation price
	PriceStopLoss   float64   `json:"price_stop_loss"`   // Stop Loss level
	PriceTakeProfit float64   `json:"price_take_profit"` // Take Profit level
	Volume          float64   `json:"volume"`            // Volume in lots
	Position        int64     `json:"position"`          // Position ticket
	PositionBy      int64     `json:"position_by"`       // Ticket of an opposite position
	Created         time.Time `json:"created"`
	Updated         time.Time `json:"updated"`
	Deleted         time.Time `json:"deleted"`
}

TradeTransaction: Structure of a Trade Transaction

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL