How to grade your trading strategy for various market scenarios in 6 simple steps

Evaluating your trading strategy using backtesting and forward testing can help you double check your trade set-up. But what if you had one more tool at your disposal to triple check your strategy?

Well, there is! PHI 1’s unique – Strategy Grading.

First, what does strategy grading even mean…? Let us explain.

Strategy grading refers to the automatic scenario-based scoring of your trading strategies. In simple terms, it refers to scoring your algorithmic trading strategy for various market scenarios such as downtrend, uptrend, crash, and so on. The process involves grading any set of mechanical trading rules in a variety of market conditions.

Different market conditions are pre-defined in your algo trading system and when you enter your trading set-up or rules, the system generates a score or grade that shows how your strategy will perform in each market condition in the system.

Why should you grade your trading strategy?

Scoring your algorithmic trading strategy has obvious benefits. It can help you understand how your strategy will perform in various market conditions, including market extremes. This can enable you to refine your strategy before you trade and avert huge losses.

It also helps eliminate biased performance, when your trading strategy works only in certain market conditions or at least helps you decide when to use a particular strategy.

How does PHI 1’s strategy grading feature work?

The strategy grading mechanism measures the performance of any arbitrary trading strategy for various market scenarios. It can grade strategy for 7 different market scenarios currently:

1. Uptrend High Volatility (Bull Market)

2. Uptrend Low Volatility (Bull Market)

3. Downtrend High Volatility (Bear Market)

4. Downtrend Low Volatility (Bear Market)

5. Sideways High Volatility

6. Sideways Low Volatility

7. Market Crash

How to grade your trading strategy on PHI 1 in 6 simple steps

Step 1: First, you would need to create a strategy in the Code Mode or Form Mode (if you prefer not to code).

Step 2: Name the strategy and select Run and Save.

Caption: In this case, we have created the Trix Momentum strategy. The init code calculates the required indicator by providing the name and parameters of the built-in momentum indicator, and the step code takes entry and exit positions based on its values

The displayed summary results and individual trades can be assessed, and the strategy can be modified based on the analysis.

The Strategy Return Chart displays the equity return and drawdown for the strategy.

Step 3: You can now test the performance of your trading strategy over a wide range of market conditions. Simple select Strategy to list all your saved strategies.

Step 4: Select Grading corresponding to the strategy that you would like PHI 1 to score or grade.

This starts all relevant backtests that your strategy should be assessed on to know its suitability for a wide range of market scenarios.

Step 5: Once the process is complete, you can view and analyze the results. This will help you further fine tune your strategy or use it only in specific market environments.

Step 6: Well, this requires you to try it out! Are you still waiting? Well, you don’t have to, because PHI 1 offers a free trial for 14 days. Post the trial, you can choose a plan that suits you best.

Isn’t strategy grading a game changer in making trades more decisive?

Not just this, PHI 1 also offers screening, bulk backtesting, simulation, and deployment, all in one unified trading platform.

Experience the power of automation in trading. Go full throttle with PHI 1.

Here’s a surprise for you – Code for the above mentioned Trix Momentum Strategy. Try it now!

TRIX_Momentum Strategy

Initialize Code:

self.trix = Trix(self.data,period=20)

self.signal = EMA(self.trix, period=12)

Step Code:

if (self.trix[0] > self.signal[0]) and (self.trix[-1] < self.signal[-1])  and (self.position.size==0):

order_target_percent(target=1)

if (self.trix[0] < self.signal[0]) and (self.trix[-1] > self.signal[-1]) and (self.position.size > 0):

order_target_percent(target=0)

if (self.trix[0] < self.signal[0]) and (self.trix[-1] > self.signal[-1])  and (self.position.size==0):

order_target_percent(target=1)

if (self.trix[0] > self.signal[0]) and (self.trix[-1] < self.signal[-1]) and (self.position.size < 0):

order_target_percent(target=0)

Take your trading up a notch with PHI 1!

The Secret to Trading Better – Backtesting and Forward Testing!

What is the one thing you should avoid when your money is at stake? Being reckless! At least, that should be the case while you are trading, especially when you have the means to evaluate your trading strategy. Your two best friends, in trading, are backtesting and forward testing

What is Backtesting?

Backtesting is testing your trade set-up or trading strategy using historical data to assess its performance over a specific period. Backtesting trading strategies is simple using trading systems.

With backtesting, you can learn more about how viable your trading strategy is without the need to risk your money.

You can test both – simple and complex trading strategies requiring multiple parameters and inputs with backtesting. The analysis that you get from backtesting can optimize your trading strategy.

Here are some pros and cons of backtesting:

First, the pros:

1. Backtesting helps develop confidence in your trading strategy.

2. You can make necessary improvements to your trading strategy.

3. You can test your strategy for specific periods and parameters.

The Cons:

1. Past data does not guarantee future performance.

2. Historical data include limited market conditions and do not account for unplanned events.

3. There may be a chance of over-fitting strategy parameters. You may end up over-optimizing the strategy to a point where it perfectly fits historical data, but fails in most other scenarios.

Backtesting trading strategies does not tell you how your strategy will perform in forecasted or live trading conditions.

This is because live charts and backtesting charts may vary a lot, and your trading behavior may also be different when you put in actual money. Further, there are always unplanned events impacting markets.

Of course, backtesting helps optimize your trading strategies, but you need to take your strategy to the next level with forward testing.

What is Forward testing?

Forward testing, which is also known as paper trading, refers to testing your trading strategy in a live environment. However, as the name suggests, paper trading is done only on paper, with no actual money.

Here are some pros of forward testing:

1. You can validate the model’s ability to make profits in real trading.

2. You can assess how your trading strategy will be impacted by trends, volatility, and liquidity conditions.

3. It helps gain more confidence if done after backtesting

A disadvantage of forward testing is that because it is on paper, no actual money is involved, and since you’re aware of that, your trading psychology or behaviour may be biased.

How to perform backtesting and forward testing using PHI 1?

You are aware by now that backtesting assesses your trading strategy for historical data, while forward testing further adds a layer of safety by testing in a simulated market environment.

Hence, a combination of both is key to developing confidence in your trade set-up.

Here’s how you can perform these tests with ease on PHI 1:

You can screen the security you want to trade with, and use our charting tool (forever free!) to ideate your strategy.

1. Next, using our Multi-Symbol Strategy Creator, you can either create your trading strategy in Code Mode or Form Mode (Don’t know coding? Here’s how you can still create your strategy)

2. You may then save your strategy and go to the “Backtest” option. Here, select the strategy you want to test, choose your instrument as well as market scenario.

3. Then, select your parameters such as capital, slippage costs,. and the risk controls you want to employ for the test.

4. Next, simply click “Run.” You can also bulk backtest on PHI 1 using enormous volumes of reliable data for different time intervals.

5. For forward testing or simulation, click the “Simulation” option on the left-hand side. On the dashboard, select your preferred options and run the forward test!

Here’s a video to help you with the process – Watch how to bulk backtest your trading strategy using PHI 1.

It is that simple! Besides this, PHI 1 also offers scenario grading. This is a disruptive, “patent pending” feature that grades your strategy for various market scenarios such as volatile, sideways, crash,.

Also, you get to access all these features on a single dashboard for free during the 14-day trial period and can choose from a wide range of subscription plans anytime.

Don’t trade without double-checking your trading strategy! Test and test again for a better trading experience!

Check out 3 trading strategies you can code and back test on PHI 1 right away!

Take your trading up a notch with PHI 1!

Is your trading strategy failing you?

“Losses are necessary, as long as they are associated with a technique to help you learn from them” – David Sikhosana

By this, David Sikhosana perhaps meant that there is no way we can completely avoid failure while trading. However, if we do not identify the reasons for failures and learn from them, it is a huge problem.

The crux of the matter is to figure out what went wrong with your trading strategy and why it failed.

Here are some reasons why your trading strategy may fail you repeatedly:

1. Having a poor risk/reward ratio

Many traders focus on multiple metrics in their trading strategy, but do not account for a good risk/reward ratio. The ratio suggests how much risk you’re willing to take to earn a unit of profit.

A lot of times, traders end up using strategies that involve taking a tremendous risk for miniscule profit. Risk/Reward ratios should approximately be 1:3, but this should be in tandem with other measures like win rate and should not be considered in isolation.

2. Ignoring the key aspect of drawdown

One of the biggest factors that affects trading success is the lack of knowledge about using drawdown. Understandably, one’s trading strategy aims to achieve greater returns at the lowest potential risk.

However, while trying to avoid drawdowns, one may end up with a curve fitted or over-fitted system (where your strategy is not fit for changing market behaviour).

You cannot completely avoid drawdowns, but you can definitely factor in parameters such as the time to recover from a drawdown for better trading performance.

Time to recover from a drawdown helps you understand how prolonged a drawdown can be, whether it is temporary or permanent.

3. Using too many indicators

Having too many indicators at once in your trading strategies, whether they are intraday trading strategies or option trading strategies, can lead to failure. Having an excessive number of indicators leads to over-analysing and decision paralysis.

Remember, more tools do not mean better trading. In fact, it is quite the opposite. Keep your trading system simple and stick to a few indicators you are comfortable with, to form an optimal strategy, not the perfect one!

4. Not accounting for slippages and transaction costs

Transaction costs like broker fees, exchanges fees, taxes, etc. involved in trading are usually excluded from a trading plan while estimating profitability. However, these costs can be substantial.

It is also important to consider the effect of slippages, like the bid-ask spread when orders get filled. It helps to forecast these slippages as a percentage of the price of the security.

5. Over-fitting/ Using unreliable data while testing your trading strategy

Over-fitting in the trading context refers to adjusting your strategy too closely to a limited set of data. Over-fitting makes the strategy align so closely with the historical data that it ends up failing in other market conditions.

This is because past data does not perfectly determine future market behaviour. Over-fitting can give you false confidence while trading with your strategy. Instead, using extensive sets of reliable data and bulk backtesting can help you test your strategy for robustness.

Diagram

6. Trying to use your trading strategy universally

Do you have a trading strategy that has worked for you in one particular scenario in different markets or in different scenarios in the same market?

Well, don’t make the mistake of using it universally across markets, securities, and scenarios. No one strategy can win in all situations and markets.

Instead, consider scenario grading and backtesting for different markets to fine-tune your trading strategy each time you use it.

Many a time, you may not be able to ensure that all the above points are taken care of, simply because you do not have the tools and resources for the same.

With an automated trading platform like PHI 1, you can assess your trading strategy for multiple parameters.

Further, PHI 1 offers backtesting using reliable sets of data, so you can evaluate your trading strategy in a jiffy! Not just that, you can also grade your strategy in multiple market scenarios like crash, volatile, choppy, etc. so you are more confident of trading in live markets.

From screening to deployment, PHI 1 is a unified algo trading platform that allows you to focus on the real deal, saving time and money spent on using multiple tools. Further, you do not need to install or download anything. You can access it directly through your browser.

Try our all-in-one algo trading platform for free and browse through our multiple plans for more features!

Take your trading up a notch with PHI 1!

8 Metrics to effectively evaluate your trading strategy performance

When the author of Market Wizards, Jack Schwager, said, “The hard work in trading comes in the preparation. The actual process of trading, however, should be effortless,” he implied one should focus on how ready one is for the live market.

And by being ready, the most important thing, perhaps, is to have a trading strategy that can withstand the vagaries of the ever-changing markets.

In this context, it is important to quantitatively assess your trading strategy to ensure that it helps you achieve your goal, eliminate emotional biases, and objectively analyze your strategy.

There are multiple metrics traders use to evaluate their trading performance. Most of these parameters are not used in isolation, but in combination.

With little ado, let us look at the 8 key metrics you can use for trading strategy evaluation:

A) P/L Metrics

These metrics focus on the return on your trading capital achieved using your strategy.

1. Wins vs. Losses

The win/loss ratio refers to the ratio of the total number of winning trades to the number of losing trades. This ratio does not factor in the size of the win or loss.

Win/Loss Ratio = Number of Wins/Number of losses

Besides this ratio, it is important to also look at the size of win/ loss and assess the ratio in various market conditions to avoid biases during bull/bear markets.

It also makes sense to look at this ratio with the win-rate, which is the number of profitable trades out of the total number of trades.

A win/loss ratio above 1.0 or a win-rate above 50% is typically preferred.

2. Profit Factor

Profit factor (PF) is the ratio of gross profit to gross loss (inclusive of commissions) for a trading period. This parameter shows the amount of profit per unit of risk.

Typically, a PF of more than 1 is preferred. 

PF = Gross Profit/Gross Loss

3. Percentage Profitability

This metric denotes the probability of winning and is essentially the percentage of total trades that turned out to be profitable.

This parameter is calculated by dividing the number of profitable trades by the total number of trades for a specified period.

Percentage Profitability = Profitable Trades/Total Trades

B) Risk Metrics

While looking at returns is important, it is essential to consider risk in your trading performance analysis, i.e. understand the probability of your strategy losing money. Here are some metrics that can help you gauge risk.

4. Maximum Drawdown

Maximum drawdown represents the largest fall in the security price from the peak to a trough over a period. It shows the largest downside risk level or the worst-case scenario of your trading strategy.

Maximum Drawdown = (Trough value – Peak value) / Peak value

trading strategy
Max Drawdown Metric in PHI 1 Algo trading Platform

Usually, a low maximum drawdown is preferred; however, it must be noted that this metric only measures the size of the largest fall and not the frequency or period for which the strategy underperformed.

5. Annualized Volatility

Annualized Volatility refers to the standard deviation of the daily returns of your trading strategy in a year. Since volatility denotes risk levels, the higher the annualized volatility, the riskier the strategy.

C) Risk/ Reward Metrics

Given that both reward and risk are important elements to examine trading strategy performance, risk/reward ratios can help measure the potential profit of a trade relative to the risk taken. Some important ones are mentioned below:

6. Sharpe Ratio

Sharpe Ratio in PHI 1 Algo trading Platform
Sharpe Ratio in PHI 1 Algo trading Platform

This ratio measures the average of excess returns to standard deviation. Excess returns refer to your trade’s return minus the risk-free return.

The higher the Sharpe ratio, the better.

Sharpe Ratio = (Portfolio Return – Risk-free Return)/ Standard Deviation

7. Sortino Ratio
The Sharpe ratio penalizes a trader even with upward volatility or upside risk. The Sortino ratio measures returns adjusted for downside risk only.

Sortino Ratio = (Portfolio Return – Risk-free Return) / Annualized Volatility of Negative Returns.

8. Calmar Ratio

Calmar Ratio in PHI 1 Algo trading Platform
Calmar Ratio in PHI 1 Algo trading Platform

Calmar ratio measures the ability of your trading strategy to bounce back from extreme lows. Since it considers maximum drawdown, which denotes the worst-case scenario, Calmar ratio can be a stringent measure of trading performance.

Calmar Ratio = Average (Portfolio Return – Risk-free Return) / Maximum Drawdown

Besides using these metrics for trading performance analysis, it would also be wise to consider factors such as the total costs of trading inclusive of broking charges and taxes, the average holding period which denotes how long your trades last, exposure of your capital to a single trade, and also the number of trades per year, which evaluates the frequency of trading.

Trading performance analysis should also involve using all these metrics in various market scenarios such as trending, volatile, sideways; so you know that your trading strategy works in multiple situations and not just in select or historical scenarios.

Scenario based Grading in PHI 1 Algo Trading Platform
Scenario based Grading in PHI 1 Algo Trading Platform

PHI 1 offers the bulk backtesting feature to assess your trading strategy with respect to multiple metrics such as ROI and Sharpe Ratio on really large sets of data in a snap.

Also, our grading process grades the risk/return metrics of your strategies in varied market scenarios. Our aim is to ensure that market scenarios should not decide how good your strategy is.

That said, would we ask you to use multiple tools for trading performance analysis? Hell, no!

PHI 1 can give all of this and more on a single, unified platform. Go check it out for free!

You may check out some additional metrics to assess trading strategies here – https://www.youtube.com/watch?v=ku6slcFtpOc

Tagged : / / / / /