How to backtest price action?

How to backtest price action?

1 Like

Open Trading view > Strategy Tester > Build Strategy > Backtest


@jashjacob Can you please give the link? I am unable to locate strategy tester on tradingview.

1 Like

bro that is not my question…
i’m asking that how to backtest price action?
means there is so many things in PA like W pattern, M pattern, head& shoulder, etc.
I’m trading in all of those patterns and I mostly trade on logic behind those patterns like who is more stronger among buyers and sellers…
so i dont have any particular strategy rather i trade on logic…
So I’m confuse how to backtest, what to backtest on PA?
please help me anyone

Write the backtest code for those and test those patterns out. Or find similar codes available on TV already and use them for backtest.

1 Like

bro like i said …
i trade on logic behind those patterns///
so do i have to backtest those patterns particularly at a time? like only w pattern at once and then M pattern… and like this i have to backtest all of those patterns
are you want to say this?

1 Like

If you cannot code it, Yes you will have to manually backtest one by one ( or together if you can manage it - just put them in different tradelogs). Cannot skip back/forward test else you will never have enough confidence when things become tough. Or get overconfident and have more confidence than you should if you get lucky at start.

Make a plan + back test it bar by bar without looking at future bars. Its very tough to do - any change in plan and you will have to retest + you might have already seen history of scrip so there is bias.

If possible, Mixing PA test with some kind of mechanical backtest as base might be easier. Thats what worked for me anyway …

Once all done, real test begins when you forward test. Start with small capital until you have reasonable proof of success . Then scale up step by step. Good luck …

1 Like

I think no software cannot test price action patterns. You just have to search stock by stock to find patterns.

let me explain How i trade intraday?

one day before i specially look for double top, double bottom or head & shoulder…
then i see what is the trend… uptrend or downtrend or sideways

if uptrend, i look for continuation trade after retest or trend reversal with M pattern for short
if downtrend, i look for continuation trade after retest or trend reversal with W pattern for long
if sideways, i look for channel breakout or breakdown with restest

and i get 50% win rate on this trading style

now please help me how to backtest?

As i said, once you have a plan you will need to go bar by bar and simulate your plan over past data. Its easier to code if you can approximate it but if its pure discretion or not translatable into code then you have to do the work.

You will have to check what tool to use to do bar by bar backtesting. People used to use Amibroker a lot. but there probably are better/easier/free tools available. Trading view has bar replay, just tested and it seems to work nice atleast for single scrip.

Along with above, you can forward test with small quantity in real markets although this will take time and you wont have enough data for years …


Here is JKcem. I have been tracking this since last 2 weeks. Since crude is falling and rest cement stocks rallying, JK’s rally may be pending… You can test your style live in this stock. Rather than intraday, these patterns work well in positional. Invest at your own risk.

1 Like

Tnx bro got my answer :relaxed:

Tnx man🙏

You have to backtest the historical data that contains the previous price movements of the asset on the trading charts you wish to trade. You can take data for up to several weeks to be sure about the price movements.

Hi @paulsusanta056
If you have a specified set of patterns, you can backtest in Streak too. What pattern\condition are you looking for?

1 Like

Double top
Double bottom
Head & shoulder
Flag & pole

No amount of backtesting would work. Its the trader who makes the money not the strategy.

  • Its the trader who needs to decide to double down the position or to take just half the position.
  • When to trail the stop and when not to.
  • When to trade the patterns and when not to.
  • What to do when view goes wrong ?
  • How quick is the trader to take opposite positions in case his view has gone wrong so that even a losing trade is converted into a winning trade.

This may not be the answer you were looking for but still you should know these things. It might help you in future.

1 Like

There is no absolute one way to trade so while above statement can be true for someone, it can also be false for someone else ( like me).

I started with completely discretionary rules for many years, then moved to completely mechanical and that made the difference for me - from having all of the possible elements to narrowing it down and actually having a plan with edge. I likely will add some part discretionary systems in near future but from my experience ( and that of some people i know) -

  1. Starting with pure discretion does not work, perhaps you need to be a genius and emotionless. It can give you theories and ideas but no proof and certainty. More degrees of freedom that you add, especially without testing over large sample, more difficult it will be in figuring if it works or why it works. How do you know that your choice is adding to edge and not result of behavioral biases? How can you know whether result is due to skill or just luck? One big issue i had was that i kept tweaking the plan in an endless loop based on short term results - that is pointless work.

  2. Any new trader must become aware of the probabilistic nature of edges. I only fully figured that out once i actually had an edge ( ! ) and full automation allowed me to look at the results without too much emotional attachment. A discretionary trader probably can also do this, but emotions can be a heavy burden when you are in drawdown and facing a streak of losses. But you must go through with it and keep executing to experience how it all works. Just wins - losses = profit/loss

  3. So discretion or not, you must test. A backtest is only an indication of possible edge, real markets are tougher but if something does not work in backtest, it wont work if you trade it live.

  4. Just my answers. Its not set in stone. Maybe it will help op …

I take all trades with equal risk. It works. I have no idea which trade will work. Absolutely no idea.

In general, trailing does not work in intraday - perhaps due to high costs. But some types of conditional / passive trailing can work in certain cases. Ofc, HTF systems might have better luck.

I do have tested filters that remove low edge signals. But once a plan is set, i take all trades. This kind of thing is harder to do if sample size is small. There is always risk of over optimization here.

Nothing, stop gets hit.

There are some cases when a losing trade can give information and that might be useful in taking the next trade. Discretionary traders are more likely to be able to trade like this. But not every stop out is meaningful. And mindset of trying to win back losses is dangerous.

Just take your trades, manage risk and let it work out. Even here we do have uncertainty of markets changing behaviour. That is part of life, hence you must control risk and diversify.

Good luck …

1 Like

So your edge is in intraday or positional ?

1 Like