[JAVA] Let's take a look at the screen of Quant Analyzer!

It seems convenient, but I don't quite understand it. Study while writing to master it. Still writing.

The actual Quant Analyzer Analyze --Overview screen and

C:\QuantAnalyzer4\extend\Snippets\com\strategyquant\extend\OverviewTab\SQDefault.java I will guess by comparing the contents with VS Code.

A quick guess at Java's proprietary functions and variables

d2WithPlType(stats.getXXXXX(XXXXX), combination.getPLType()) It seems to match the display format (amount, pips,%) d2WithPlType(stats.getXXXXX(XXXXX), SQConst.PL_IN_PCT) It seems that the display format is fixed to% d2(stats.getXXXXX(XXXXXXXXXX) It seems that you are looking for the second decimal place. statsConst.XXXXX I wish I could see the contents of this. If you know how the calculated value is, it seems that you can combine it in various ways.

Upper left display

image.png

TOTAL PROFIT (PROFIT IN MONEY): Total profit / loss (amount)
TOTAL PROFIT (PROFIT IN PIPS): Total P / L (pips)
YEARLY AVERAGE PROFIT: Average annual profit and loss (amount)
YEARLY AVERAGE% RETURN: Annual Average P / L (%)
CAGR (Compound Avarage Growth Rate): Compound annual growth rate

Upper right

image.png

1st row

# OF TRADES: Number of transactions

In SQDefault.java, stats.getInt (StatsConst.NUMBER_OF_TRADES)

DRAWDOWN: Maximum drawdown amount

In SQDefault.java, d2WithPlType (stats.getDouble (dd_key), combination.getPLType ()) ANNUAL % / MAX DD %: In SQDefault.java, d2 (stats.getDouble (StatsConst.AAR_DD_RATIO))

2nd row

SHARPE RATIO: Sharpe ratio

In SQDefault.java, d2 (stats.getDouble (StatsConst.SHARPE_RATIO)) Risk (standard deviation) is a measure of excess return per unit (excess return that exceeds the return that can be obtained even with zero risk). The higher this value, the higher the excess return obtained by taking the risk ( Efficiently earned profits). This is useful when comparing different investment targets and considering which return is higher for the same risk. This Sharpe ratio is also used to evaluate the investment trust management performance as a measure of risk-adjusted returns.

% DRAWDOWN: Maximum drawdown amount (%)

In SQDefault.java, d2WithPlType (stats.getDouble (StatsConst.PCT_DRAWDOWN), SQConst.PL_IN_PCT) R EXPECTANCY: In SQDefault.java, d2WithPlType (stats.getDouble (StatsConst.R_EXPECTANCY), "R") performance metrics developed by Van Tharp, it gives you the average profit value related to average risk (R) that you can expect from a system over many trades. It seems to be how much you can benefit from the risk on average. How is it different from the Sharpe ratio?

3rd row

PROFIT FACTOR: Profit Factor

In SQDefault.java, d2 (stats.getDouble (StatsConst.PROFIT_FACTOR)) No explanation needed

DAILY AVERAGE PROFIT: Daily Average P / L

In SQDefault.java, d2WithPlType (stats.getDouble (StatsConst.AVG_PROFIT_BY_DAY), combination.getPLType ()) No explanation needed R EXPECTANCY SCORE: In SQDefault.java, d2WithPlType (stats.getDouble (StatsConst.R_EXPECTANCY_SCORE), "R") standard R-Expectancy doesn’t consider the length of testing period and number of trades produced. There is a difference when you make for example $2000 per year by making 10 trades, or by making 100 trades. R-Expectancy Score adds a score for trades frequency. It is computed as: R-Expectancy * averageTradesPerYear

4th row

RETURN / DD RATIO In SQDefault.java, d2 (stats.getDouble (StatsConst.RETURN_DD_RATIO))

MONTHLY AVERAGE PROFIT: Monthly Average P / L

In SQDefault.java, d2WithPlType (stats.getDouble (StatsConst.AVG_PROFIT_BY_MONTH), combination.getPLType ()) STR QUALITY NUMBER: In SQDefault.java, d2 (stats.getDouble (StatsConst.SQN))

5th row

WINNING PERCENTAGE: Win rate

In SQDefault.java, d2 (stats.getDouble (StatsConst.WINNING_PCT)) No explanation needed AVERAGE TRADE: In SQDefault.java, d2WithPlType (stats.getDouble (StatsConst.AVG_TRADE), combination.getPLType ()) SQN SCORE: In SQDefault.java, d2 (stats.getDouble (StatsConst.SQN_SCORE))

Strategy image.png

1st row

Wins / Losses Ratio: In SQDefault.java, d2 (stats.getDouble (StatsConst.WIN_LOSS_RATIO)) Did you just express the winning percentage as a ratio? AHPR: In SQDefault.java, d2 (stats.getDouble (StatsConst.AHPR)) Refer to this site, maybe a formula like profit / loss / holding period. Expectancy In SQDefault.java, d2 (stats.getDouble (StatsConst.EXPECTANCY))

Stagnation in Days: Maximum drawdown period (days)

In SQDefault.java, "" + stats.getInt (StatsConst.STAGNATION_PERIOD) It is a mystery why the empty string is added.

2nd row

Payout Ratio (Avg Win/Loss) In SQDefault.java, d2 (stats.getDouble (StatsConst.PAYOUT_RATIO)) Z-Score In SQDefault.java, d2 (stats.getDouble (StatsConst.Z_SCORE)) Deviation In SQDefault.java, d2WithPlType (stats.getDouble (StatsConst.STANDARD_DEV), combination.getPLType ()) There is a description of StatsConst.STANDARD_DEV, is it standard deviation?

Stagnation in%: Maximum drawdown period (%)

In SQDefault.java, d2WithPlType (stats.getDouble (StatsConst.STAGNATION_PERIOD_PCT), SQConst.PL_IN_PCT)

3rd row

Average # of Bars in Trade In SQDefault.java, d2 (stats.getDouble (StatsConst.AVG_BARS_TRADE)) Z-Probability In SQDefault.java, d2 (stats.getDouble (StatsConst.Z_PROBABILITY)) + "%" Exposure In SQDefault.java, d2 (stats.getDouble (StatsConst.EXPOSURE, 0)) + "%" The percentage of financial assets held that are exposed to the risk of market price fluctuations.

Correlation Factor R16: Correlation coefficient R16

In SQDefault.java, d2 (Math.pow (stats.getDouble (StatsConst.STABILITY), 4)) Self-made measurement value. A coefficient of how far the "profit and loss curve" and the "straight line connecting the first and last transactions" are. It can be said that the closer the value is to 1, the more stable it is. Normally it is r ^ 2, but Quant Analyzer seems to use r ^ 4, so the difference is easy to understand. I wanted it to be easier to understand, so I chose r ^ 16.

Trades (I'm just tinkering with it and changing the layout.)

It seems that the explanation is annoying, so I will postpone it. image.png

1st row

# of Wins: Number of wins

No explanation needed In SQDefault.java, "" + stats.getInt (StatsConst.NUMBER_OF_PROFITS)

Gross Profit: Total Profit

No explanation needed In SQDefault.java, d2WithPlType (stats.getDouble (StatsConst.GROSS_PROFIT), combination.getPLType ())

Largest Win: Maximum profit

No explanation needed In SQDefault.java, d2WithPlType (stats.getDouble (StatsConst.MAX_PROFIT), combination.getPLType ())

Avg Consec Wins: Average losing streak

No explanation needed In SQDefault.java, d2 (stats.getDouble (StatsConst.AVG_CONSEC_WIN))

2nd row

# of Losses: Number of losses

No explanation needed In SQDefault.java, "" + stats.getInt (StatsConst.NUMBER_OF_LOSSES)

Gross Loss: Total Loss

No explanation needed In SQDefault.java, d2WithPlType (stats.getDouble (StatsConst.GROSS_LOSS), combination.getPLType ())

Largest Loss: Maximum loss

No explanation needed In SQDefault.java, d2WithPlType (stats.getDouble (StatsConst.MAX_LOSS), combination.getPLType ())

Avg Consec Loss: Average losing streak

No explanation needed In SQDefault.java, d2 (stats.getDouble (StatsConst.AVG_CONSEC_LOSS))

3rd row

In SQDefault.java, ""

Average Win: Average profit

No explanation needed In SQDefault.java, d2WithPlType (stats.getDouble (StatsConst.AVG_WIN), combination.getPLType ())

Max Consec Wins: Maximum consecutive wins

No explanation needed In SQDefault.java, "" + stats.getInt (StatsConst.MAX_CONSEC_WINS) Avg # of Bars in Wins I think it's how many bars you straddle from the start of trading to the settlement ... (I honestly don't know) In SQDefault.java, d2 (stats.getDouble (StatsConst.AVG_BARS_WIN))

4th row

# of Canceled / Expired: Number of canceled / expired

No explanation needed In SQDefault.java, "" + stats.getInt (StatsConst.NUMBER_OF_CANCELED)

Average Loss: Average Loss

No explanation needed In SQDefault.java, d2WithPlType (stats.getDouble (StatsConst.AVG_LOSS), combination.getPLType ())

Max Consec Losses: Maximum consecutive losses

No explanation needed In SQDefault.java, "" + stats.getInt (StatsConst.MAX_CONSEC_LOSS) Avg Bars in Losses I think it's how many bars you straddle from the start of trading to the settlement ... (I honestly don't know) In SQDefault.java, d2 (stats.getDouble (StatsConst.AVG_BARS_LOSS))

Not here, but the one you care about in the Equity Control tab

You may find out a lot by referring to "return stats.getDouble (StatsConst.STABILITY, 0" in "GetValue" of the file in the same folder.

QuantAnalyzer4\extend\Snippets\com\strategyquant\extend\DatabankColumns\Stability.java


@Override
public Object getValue(SQResultsGroup strategyResults, String dataType, String direction, String sampleType, String plType) throws Exception {
	SQResult result = strategyResults.getResult(SQConst.SYMBOL_PORTFOLIO);
	
	SQStats stats = result.getStats(direction, getGlobalPlType(plType), sampleType);
	if(stats==null) throw new StatsMissingException();
	
	return stats.getDouble(StatsConst.STABILITY, 0);
}

I think I can get it with this code

Stability


stats.getDouble(StatsConst.STABILITY, 0)

As mentioned earlier, it is the correlation coefficient (r ^ 4) between the "profit and loss curve" and the "straight line connecting the first and last transactions".

Symmetry


stats.getDouble(StatsConst.SYMMETRY)

Well I do not know!

Fittness


strategyResults.getResult(SQConst.SYMBOL_PORTFOLIO)
.getStats(SQConst.DIRECTION_ALL, SQConst.PL_IN_MONEY, SQConst.KEY_SAMPLE_ALL)
.getDouble(StatsConst.FITNESS, 0)

Well I do not know!

CalmarRatio


stats.getDouble("CalmarRatio", 12)

The Calmar ratio is a comparison of the average annual compounded rate of return and the maximum drawdown risk of commodity trading advisors and hedge funds. The lower the Calmar ratio, the worse the investment performed on a risk-adjusted basis over the specified time period; the higher the Calmar ratio, the better it performed. Generally speaking, the time period used is three years, but this can be higher or lower based on the investment in question. I write something like a risk-return ratio. How is it different from the Sharpe ratio? You can see that the higher it is, the better. Basically I see it on a 3-year basis, but it seems that it can be short or long.

It seems that there are various things in, so it may be interesting to take a look.

Recommended Posts

Let's take a look at the screen of Quant Analyzer!
Let's take a look at the functions of Keycloak's management console (administrator edition)
Let's take a look at the Hotspot JVM startup procedure
[Java] Let's take a look at Switch Expressions (Preview) of JDK 13.
Let's take a look at the functions of Keycloak's management console (user edition), user account service
I took a look at the resources of Azure Container Instance
I tried to take a look at the flow of Android development environment construction with Android Studio
A quick look at the Monty Hall problem
Take a quick look at Gradle and read the build.gradle generated by Spring Initializr
I took a peek at the contents of Java's HashMap
[Android] Exit the activity of the transition source at the time of screen transition
Take a look at Kotlin from an Effective Java perspective
Why put a line break at the end of the file
A solution to the problem of blank spaces at the beginning of textarea
Let's create a TODO application in Java 5 Switch the display of TODO
Let's make a custom_cop that points out the shaking of the name
A quick look back at Java over the last five years
A memorandum of the FizzBuzz problem
Android application: Let's explain the mechanism of screen transition with simple code
Let's express the result of analyzing Java bytecode with a class diagram
How to change the value of a variable at a breakpoint in intelliJ
A look at Jenkins, OpenJDK 8 and Java 11
Take a peek at how Processing 3 works
Fix the view screen of the post page
Find the difference from a multiple of 10
[Swift, a must-see for fledgling! ] Let's understand the implementation of communication processing of WebAPI