LogoLogo
  • Welcome to AMP Futures (USA) Help
  • Trading Platforms
    • Quantower
      • Shortcuts
        • Overview
      • Getting Started
        • What's new
        • Installation
        • First start
        • Add Exchanges-Symbols
          • Add New Micro Crude Oil (CME) Symbol - MCLE
        • Platform update
        • Backup & restore manager
        • Reset settings to default
        • You have found a bug. What’s next?
      • General Settings
        • Main Toolbar
        • Workspaces
        • Single Panel
        • Link panels
        • Binds
        • Group of panels
        • Templates
        • Set as Default
        • Symbols lookup
        • Table management
        • Setup Actions & Advanced filters
        • Alerts
        • General settings
      • Data-Feed Connections
        • Connection to CQG (AMP Futures)
          • Errors with CQG
      • Analytics Panels
        • Chart
          • Chart Overview
          • Chart Types
            • Tick chart
            • Time aggregation
            • Renko
            • Heiken Ashi
            • Kagi
            • Points & Figures
            • Range bars
            • Line break
            • Volume Bars
            • Reversal Bars
          • Chart Settings
          • Chart Trading
          • Chart overlays
          • Technical indicators
            • Channels
              • Donchian Channel
              • High Low Indicator
              • Round Numbers
              • Highest High
              • Lowest Low
              • Bollinger Bands
              • Bollinger Bands Flat
              • Price Channel
              • Keltner Channel
              • Moving Average Envelope
            • Moving averages
              • Exponential Moving Average
              • FYL Indicator
              • Linearly Weighted Moving Average
              • McGinley Dynamic Indicator
              • Modified Moving Average Indicator
              • Pivot Point Moving Average Indicator
              • Regression Line Indicator
              • Simple Moving Average Indicator
              • Smoothed Moving Average Indicator
              • Guppy Multiple Moving Average Indicator
              • Trend Breakout System Indicator
              • Triple Exponential Moving Average Indicator
            • Oscillators
              • Aroon Indicator
              • Moving Average Convergence/Divergence
              • Awesome Oscillator
              • Accelerator Oscillator
              • %R Larry Williams
              • Momentum
              • Rate of Change
              • Relative Strength Index (RSI) Indicator
              • Commodity Channel Index
            • Trend
              • Average Directional Movement Index (ADX) Indicator
              • Ichimoku Cloud Indicator
              • Directional Movement Index (DMI) Indicator
              • ZigZag
            • Volatility
              • Average True Range
              • Standard deviation
            • Volume
              • Delta Flow
              • Delta Rotation
              • Level2 indicator
          • Drawing Tools
          • Volume Analysis Tools | Volume Profiles | Footprint chart | VWAP
            • Cluster chart
            • Volume profiles
            • Time statistics
            • Time histogram
            • Historical Time & Sales
          • OHLC
          • Power Trades
          • VWAP | Volume Weighted Average Price
          • Anchored VWAP
        • Watchlist
        • Time & Sales
        • Price Statistic
        • DOM Surface
        • Option Analytics
        • TPO Profile Chart
      • Trading Panels
        • Multiple Order Entry
        • Order Entry
          • Algo Order Types
          • OCO (Multi-Level)
          • OCO (Post Fill)
          • Order Types
        • DOM Trader
          • How to setup DOM for Scalping
        • Market depth
        • Trading simulator
        • Market Replay
      • Portfolio Panels
        • Positions
        • Working Orders
        • Trades
        • Orders History
        • Synthetic Symbols
        • Historical Symbols
      • Information Panels
        • Account info
        • Symbol Info
        • Event Log
        • RSS
        • Reports
      • Miscellaneous
        • Symbol Mapping Manager
        • Live Support
        • Market Heat map
        • Stat matrix
        • Exchange times
        • Quote Board
        • Browser
        • Excel and RTD function
          • Changing RTD Throttle Interval in Excel
        • Quantower Telegram Bot
      • Quantower Algo
        • Introduction
        • Install for Visual Studio
        • Strategy runner
        • Simple Indicator
        • Simple strategy
        • Input Parameters
        • Built-In indicators access
        • Custom indicators access
        • Level2 data
        • Access Volume analysis data from indicators
        • Indicator with custom painting (GDI)
        • Access Chart from indicator
        • Using markers with indicators
        • Using Clouds in Indicator
        • Adding a custom indicator to Watchlist
        • Downloading history
        • Access to trading portfolio
        • Trading operations
        • Example: Simple Moving Average
        • Access to advanced aggregations
        • Access to symbol/account additional fields
      • Customization
        • Localization
      • FAQ
        • General Errors
Powered by GitBook
On this page
  • Core - main entry point for all data
  • Connections
  • Accounts
  • Symbols
  • Positions
  • Orders
  • Trades
  • An example of using trading data

Was this helpful?

  1. Trading Platforms
  2. Quantower
  3. Quantower Algo

Access to trading portfolio

Access an info about current opened positions, placed orders or history of your trades

PreviousDownloading historyNextTrading operations

Last updated 4 years ago

Was this helpful?

Usually, an algorithm of trading strategy requires an access to various trading information for making decisions. It can be your current opened positions, placed orders or history of your trades. Sometimes you may need also detail information about your account or symbol, you are going to trade on. Quantower API provides you full access to all this information and even more. In this topic, we will show how to retrieve it and use in your strategies or indicators

Core - main entry point for all data

​ object, which is always accessible from your scripts provides you a wide set of different data and functions. You can read full details about this class in our , here we will provide an example of access to the most important and useful data.

You should always remember that Quantower is a trading platform, which provides multi-connection possibility. From one side - it means you can have access to different connections simultaneously and make really professional strategies, such as arbitraging and others. But from another side, when you need to find required symbol or account you have to specify a little more information than just a name - you should provide a connection id in case you have more than one. Quantower store all data from separate connections in special assigned storages and Core object provide you aggregated data from all your current connections.

Here are the main properties from Core object, that will be enough to create the most of classic strategies:

Connections

Gives you an access to all your connections and possibility to manage them. You can get the current state of , its name, broker/data feed identifier or all data from this particular connection.

Accounts

Provides you an access to all your accounts from all connections. You can search for the required account and retrieve : Name, Balance, Currency, and others.

Don't forget that different brokers may provide you with different information their accounts: from very basic to really full and detailed.

Symbols

Provides you an access to all symbols from all connections. Each has many properties you can use them in your algorithms: Name, LotStep, Description, MinLot, MaxLot, and many others.

Positions

Provides you an access to all positions from all connections. If you need to get positions only from specific connections you can filter them using ConnectionID property, which each position provides among : Quantity, Fee, NetPnl, etc. You can also search for a particular position by its id using GetPositionById method.

Orders

Trades

An example of using trading data

And as usual, let's create a simple example to show possibilities of an API. We will display the main information about your active connections and main objects: accounts, symbols, and positions. It will be quite easy to implement using our explanations above. We need only to iterate through all connections and retrieve the required data. Just, for example, we will use Log function to display this data, but you can use it in any way you need in your scripts. This is source code for our example:

protected override List<StrategyMetric> OnGetMetrics(){​    foreach (Connection connection in Core.Connections.Connected)    {        foreach (Position pos in Core.Positions)        {            if (pos.ConnectionId == connection.Id)                Log($"PositionID name: {pos.Id},  Position NetPnL: {pos.NetPnL.ToString()}");        }        Log($"Positions:", StrategyLoggingLevel.Trading);​        foreach (Account account in Core.Accounts)        {            if (account.ConnectionId == connection.Id)                Log($"Account name: {account.Name},  Account Balance: {account.Balance.ToString()}");        }        Log($"Accounts:", StrategyLoggingLevel.Trading);        foreach (Symbol symbol in Core.Symbols)        {            if (symbol.ConnectionId == connection.Id)                Log($"Symbol name: {symbol.Name},  Symbol type: {symbol.SymbolType.ToString()}, Bid: {symbol.Bid}, Ask: {symbol.Ask}");        }        Log($"Symbols:", StrategyLoggingLevel.Trading);​        Log($"Information from '{connection.Name}' connection:", StrategyLoggingLevel.Error);    }​    List<StrategyMetric> result = base.OnGetMetrics();                return result;            }

And this is the result of this script displaying in the StrategyRunner Panel.

In this topic, we showed how to get and analyze main trading data - which is always required by strategies. Another important and necessary part of any strategy is trading operations which will be covered in our next article.

Provides you an access to all from all connections. And you also can filter your orders by some connection id if it needed.

Provides you an access to the history of all trades from all connections since login. Each trade contains about its symbol, price, fee, time of execution and others.

This is only the main properties from . You can check our and found many other interesting's ones: Symbol types, Assets, Reports. Actually, you can get all data that are used by Quantower trading platform, as we use the same API during development our plugins.

Information about accounts, symbol and positions displayed in StrategyRunner panel
Core
API documentation
connection
full information
symbol
other data
orders
information
Core
API documentation