Documentation

Last updated on 5. 5. 2015 by Mark Fric

Understanding report objects

When new report (link MT4 statement, Myfxbook statement or backtest report) is loaded into Quant Analyzer, it is internally stored into SQResultsGroup object.

We will describe various objects that are used to store values for the purposes of plugins and snippets development.


Objects hierarchy

  • SQResultsGroup
    • SymbolsTable
    • ResultKeysList
    • SQResult
      • SQOrdersList
      • SQStats

So SQResults contains list of trades for given symbol/strategy and its stats values.

If SQResultsGroup contains a portfolio it contains also a special result for whole portfolio where the stats are computed for the portfolio as a whole.


SQResultsGroup

top object that holds everything else. When you load some file with trades into Quant Analyzer it is internally stored in SQResultsGroup object. This is the object that contains imported list of trades and stats values (like Net Profit, Drawdown, Sharpe ratio, etc.) computed from this list of trades.

SQResultsGroup can contain one or more SQResults. One result is a result for one symbol or strategy if you imported a portfolio. So if you imported trades of just one symbol there will be just one result in results group. If you imported or created portfolio, every symbol/strategy in portfolio will be stored in its own result.

Methods:

  • SymbolsTable getSymbolsTable()), setSymbolsTable(SymbolsTable) – returns or sets SymbolsTable.
  • ArrayList<String> getResultKeysList()), setResultKeysList(ArrayList<String>) – returns or sets results key list. Every results is stored under a special key from this array. The key could be a name of strategy or symbol traded. Example of keys: “Portfolio”, “Data1”, “Data2”, “EURUSD”, “Strategy 0.1234”
  • SQResult getResult(key), setResult(key, SQResult) – returns or sets trading results for given key.

SymbolsTable

is an array that holds table of all symbols (currencies/markets) that were traded with their recognized point value and pip/tick size. This is used in statistics computation, so that we can compute P/L in pips/ticks . For example if you imported report that traded on EURUSD and GBPUSD then SymbolsTable contains two entries – for EURUSD and GBPUSD.


Result keys list

this is a simple array of keys that are used for storing the results. Each result must be stored under its own unique key.


SQResult

holds orders and computed stats (Net Profit, Sharpe ratio etc.) for given result key.

Methods:

  • SQOrderList getOrders(), setOrders(SQOrderList) – stores/retrieves orders for this result
  • SQOrderList getOriginalOrders(), setOriginalOrders(SQOrderList) – stores/retrieves original orders for this result – used in What If and Equity chart
  • getStats(direction, plType, sampleType ), setStats(direction, plType, sampleType, SQStats) – returns/sets SQStats – a map of of statistics computed based on this list of trades.
    Note that Quant Analyzer computes stats for long and short side both sides together, for in sample and out of sample period, and also for results in money, % or pips/ticks. So there are multiple NetProfit computed for each of these combinations of conditions.

SQStats

is a map that holds values like NetProfit, Number of Trades, etc.

Functions get(key), set(key,value),for example getDouble(NetProfit), getInt(NumberOfTrades). You can check the standard values that are computed by default here: Stats values constants You can also use StatsValues snippets to compute new values. Check How to add new StatsValue in How to..


SQOrderList

is an array of trades, each trade stored in SQOrder object.


SQOrder

holds values of one trade OpenTime, OpenPrice, etc.

Was this article helpful? The article was useful The article was not useful

Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments