Difference between revisions of "4.7.5.3 Trading Functionality. TradingProfiles"

From MultiCharts
Jump to navigation Jump to search
(Created page with "The ITradeManager interface contains the TradingProfiles property that returns an array of profiles represented as the ITradingProfile interface: <syntaxhighlight> public int...")
 
Line 57: Line 57:
 
This structure can be received through the properties of '''Bars.Info.ASymbolInfo2''' for the current symbol.
 
This structure can be received through the properties of '''Bars.Info.ASymbolInfo2''' for the current symbol.
  
[[Category:.NET Programming Giude]]
+
[[Category:4. Understanding PowerLanguage .NET]]

Revision as of 09:25, 6 May 2013

The ITradeManager interface contains the TradingProfiles property that returns an array of profiles represented as the ITradingProfile interface:

public interface ITradingProfile
Events

event TConnection Connection; - By subscribing to this event it is possible get the notifications about disconnects and reconnects.

  • event TRealtime RT; - Real-time


Order operation methods
  • void CancelOrder(int order_id); - cancellation of the order by its ID.
  • void ModifyOrder(int order_id, OrderParams -order, MTPA_ModifiableOrderFields fields_for_modify); - modifications of the order fields by its ID
  • int[] PlaceOCOOrders(MTPA_OCOGroupType oco_type, params OrderParams[] orders); - submission of several orders within OCO group. This returns a list of successfully submitted order identifiers (IDs). The OCO group can be of two types:
  1. One Cancel Others means that the cancellation or execution of one order cancels all other orders.
  2. Reduce Size means that when Order#1 is filled for X contracts the amount of the contracts of the other orders in the group is reduced by X number of contracts.
  • int PlaceOrder(OrderParams order); - submission of one order. If submission is successful the identifier (ID) of the order will be returned. Otherwise, an exception like “System.Runtime.InteropServices.COMException.” will be generated.


Properties
  • string[] Accounts { get; } – returns the list of accounts for the current profile.
  • ETM_ConnectionChanged ConnectionState { get; } – the current connection state.
  • string CurrentAccount { get; set; } – a property that sets the current account that is used for trading.
  • MCSymbolInfo CurrentSymbol { get; set; } – a property that sets the current symbol that is used for trading and that is updated in real-time on RT event.
  • MTPA_ModifiableOrderFields ModifiableFields { get; } – Returns attribute indicating what fields are available for modification on a brokers side.
  • string Name { get; } – Profile name. This is the name specified by a user when creating a broker profile. The same broker can have several profiles with different settings for each one.
  • string PluginName { get; } Trading plug-in name that correlates with the broker (1-to-1).


The CurrentSymbol property has the following type:

struct MCSymbolInfo

  • public MTPA_MCSymbolInfo2 symbol; - the symbol itself.
  • public string data_feed; - data source name (Interactive Brokers, eSignal, CQG etc).


MTPA_MCSymbolInfo2

  • public string SymbolName; - name of the instrument, for example ESU3, EUR/USD
  • public string SymbolRoot; - symbol root (for futures), for example ES, CL
  • public string SymbolDescription; - Instriment description in words, for example, for ESU3 "S&P 500 E-mini Futures Sep13". Some data sources save additional info in this field.
  • public string SymbolExchange; - exchange name, for example GLOBEX, CME
  • public MTPA_MCSymbolCategories SymbolCategory; - symbol category, for example, futures, Forex or stock.
  • public MTPA_MCSymbolCurrency SymbolCurrency; - symbol currency, for example USD, EUR, JPY.
  • public DateTime SymbolExpiry; - expiration date(for futures), for example ESU3 09/19/2013.
  • public int MinMove; - minimum quantity of points, when the price moves by one minimum price increment, for example for ES MinMove = 25
  • public double PriceScale; - price scale, for example for ES = 1/100
  • public double BigPointValue; - Big Point Value. Profit/loss money equivalent in currency of the instrument , when the price moves by one minimum increment, for example, for ES = 50
  • public short PutOrCall; - for options
  • public double StrikePrice; - for options
  • public MTPA_SymbolFields UnsupportedFields; - instrument fields, which are not provided by the source


This structure can be received through the properties of Bars.Info.ASymbolInfo2 for the current symbol.