Click here to Login








Adaptive Strategy Indicator

by QuantShare, 3936 days ago
Share |






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.
Buy = PatternPerf(event1, 10, 1000);

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.


Share This ->
Share |


You have to log in to bookmark this object
What is this?
Additional Information




Type: Trading Indicator

Object ID: 1316


Country:
All

Market: All

Style:
Technical Analysis

Reviews
You must log in first

Join now
and get instant access for free to the trading software, the Sharing server and the Social network website.
Click here


Related objects

Empty

Number of reviews
Click to add a review
Average rate
Click to rate this item
Number of times this object was downloaded
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

Technical Analysis


Fundamental Analysis



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
Click to add a review
Average rate
Click to rate this item
Number of times this object was downloaded
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






QuantShare
Product
QuantShare
Features
Create an account
Affiliate Program
Support
Contact Us
Trading Forum
How-to Lessons
Manual
Company
About Us
Privacy
Terms of Use

Copyright © 2024 QuantShare.com
Social Media
Follow us on Facebook
Twitter Follow us on Twitter
Google+
Follow us on Google+
RSS Trading Items



Trading financial instruments, including foreign exchange on margin, carries a high level of risk and is not suitable for all investors. The high degree of leverage can work against you as well as for you. Before deciding to invest in financial instruments or foreign exchange you should carefully consider your investment objectives, level of experience, and risk appetite. The possibility exists that you could sustain a loss of some or all of your initial investment and therefore you should not invest money that you cannot afford to lose. You should be aware of all the risks associated with trading and seek advice from an independent financial advisor if you have any doubts.