I would like to know if it's possible to backtest how high the price went once my signal is detected.
If you look at the screenshot you will see that the Long signal was generated @2757.25 and the max price for the day since the signal was @2762 before market reversed and this position would have been stopped.
So I want to know if I can calculate all previous days and see the different targets and how often they could have been hit.
Any idea if this is possible?
Hi,
this is possible thanks to the "Signal Statistic" token (SSTAT)
Basically, you just need to
1) create a custom indicator named "CI_ONE"equal to SSTAT using the option "Highest price until Next Signal" and then define a Signal in order to spot the end of the session :
The easiest RTL syntax for that signal wouyld be POS=1 with POS being setup as Bar until the end of the session or "TIME >= xxxx" oiif you work with Time Bar
2) then, in your backtest Entry rules, you just add "and SET(V#1,CI_ONE) and NOTE" with NOTE being defined as %V#1 (with V#1 number of digit set as equal to the Instrument one)
Next time you run your backtest, you will get in the report the highest swing until the end of the session
Btw, you don't really need a backtest if you just want to know how many time your target would have been reached (over the past 20 days for example)
Indeed, you can also plot directly the highest swing value on a chart, next to your signal - You just need to create a Custom indicator with the following syntax :
(YOUR_ENTRY_SIGNAL=TRUE)*SSTAT
with SSTAT defined as above
and if you want to know how many times a given target would have been reached, you can do also that with a simple indicator
Lets say your are looking for long trades and you have a 2 points target (and that you enter on the Close of the Signal bar)
Then the pourcentage of time you reach your target (for long trades) would be given by the following CI
CI_TWO defined as SUM(CI_WINNER_LONG/CI_NB_OF_LONG_TRADES,POS)
with CI_WINNER_LONG defined as (YOUR_ENTRY_SIGNAL=TRUE)*((SSTAT -CL)>2)
and CI_NB_OF_LONG_TRADES defined as (YOUR_ENTRY_SIGNAL=TRUE)
and POS set up as the number of bar since the start of data
Added on your chart, this indicator (CI_TWO) will chart the cumulative percentage of winning trade since the first day (of your chart)
IRT is very powerful for such signal analysis (without even running a backtest)... You can get any type of information (number of bars until your hit your target, your fixed stop, etc..)
Cheers
Eddy
Is there a way to evaluate which price was hit first after a signal (without backtesting)?
E.g. I have a signal at price 2700. Now I want to know if 2690 or 2710 was hit first, independent of time.
Thanks,
Alex
You might explore using Pivot Strategy Analysis for this: https://www.linnsoft.com/techind/pivotstrategyanalysis-rtx
With that, you can have a custom indicator for your entry price, and then specify 10 for profit and loss, and it will accumulate winners and losers (based on which was hit 1st).
But otherwise, I may be able to create a "Winner or Loser" result in Signal Statistics that would give a 1 (winner), -1 (loser), or 0 (hit neither) result based on which side it hit 1st after signal (I guess it would base this on the closing price of signal bar as entry).
Problem is that I don't want to fade/trend pivots/levels, what I want is: enter on signal, exit if price>=2710 (profit) or price<=2690 (loss).
I think the winner/loser signal would be helpful. Maybe add the option for direction (long/short), stop loss in ticks and target in ticks.
If you want to enter on the closing price of the signalled bar, you can create a custom indicator with this syntax...
CL * (SIGNAL = 1)
that will result in a non-zero value only on your signalled bars (the close of the bar) and PSA will only consider those bars with non-zero prices for trading. I setup a signal to just by 10th bar of each session (see below). Make sure to set the reset distance and frontrun wiggle to zero. Also set your target and stop appropriately, as well as "Nature" and "Trades from". I am limiting mine to "1 trade per period (period is daly)" but you might want to adjust that as well.
Perfect, thank you.