#twitter-follow { border: 0;position: fixed; top: 240px; left:0;} #live-support { border: 0;position: fixed; top: 370px; left:0;} #knowledge-base { border: 0;position: fixed; top: 170px; left:0;}

by QuantShare, 3994 days ago

Do you want to know how an asset performed in the past following a specific pattern or event?

Now, you can with the new trading indicator (PatternPerf) I am presenting here. It is the perfect indicator for creating adaptive strategy. Why? Because on each trading bar, this indicator tells you how the asset performed in the past for the current pattern or event.

Let us take an example: say you want to enter long a stock if its price is above the 25-bar moving average and enter short a stock if its price is below the same moving average. Besides this simply rule, you want to enter long or short only if past trades were profitable. This is called an adaptive trading strategy because the buy and short rules adapt to past market conditions. You will enter long or short a trade only if you are certain that the buy or short rule performed well in the past.

This function looks like the buy indicator (Buy Indicator) but it is not exactly the same. The "BuyInd" function returns past performance of a specific rule you define, while "PatternPerf" function returns past performance of an event that is happening now (current bar).

It should be easier to understand with an example. Let us define a specific event based on the relative strength indicator. The event can take three different values:
0: Stock is oversold
1: Stock is overbought
2: Stock is neither oversold nor overbought

r = rsi(14);
event1 = iff(r < 30, 0, iff(r > 70, 1, 2)); // Event1 = 0, 1 or 2
c = PatternPerf(event1, 10, 1000);

On bar X, if RSI state is equal to 1 (Overbought) then "PatternPerf" will return the average performance of all trades that are taken when the stock enters the overbought area. Each trade is closed after 10 days (2nd parameter) and only trades that happened in the past 1000 trading bars are considered (3rd parameter).

Note that trades are entered on next bar's open and closed after X days on next bar's open too.

What is this?

 Type: Trading Indicator Object ID: 1316 Country: All Market: All Style: Technical Analysis

 Related objects Empty
Number of reviews
Average rate
Click to rate this item
Number of rates the current object received
Report an object
if you can't run it for example or if it contains errors
Click to report this object

 Random Blog Posts How to Switch On/Off Trading Rules in Your Stock Trading System Backtesting a Strategy Based on Bond and Stock Index ETFs 4 Links to Download Free Historical Stock Prices Data by Date Quantitative Analysis: Price Channels How to Download Trading Data for Certain Securities Only Learn How to Create Your Own Technical Analysis Indicators How to Pick the Best Trend Indicators Update Chart Layout based on Active Ticker Symbol - Part 2 Show All

Number of reviews
Average rate
Click to rate this item
Number of rates the current object received
Report an object
if you can't run it for example or if it contains errors
Click to report this object