Click here to Login

                                                   Adding Market Direction Filter to a Strategy


2016-08-15 08:49:04

Hi Folks,

I'm new to using quantshare and I'm trying to figure out how to add a filter for overall market direction to a trading strategy.

Essentially, I only want the strategy to take long entries when the S&P is trading above it's 50 period ma and short when the opposite is true.

Any assistance would be very helpful.

Thanks in advance!

2016-08-16 05:23:30


Hi Chris,

You can access an external symbol using GetSeries function.

spy1 = getseries("spy", close);
buy = spy1 > sma(spy1, 50);
short = spy1 < sma(spy1, 50);

Check this for more info on how to create trading systems:

2016-08-16 09:33:50


Thanks! Appreciate the link!

No more messages


No html code. URLs turn into links automatically.

Type in the trading objects you want to include: - Add Objects
To add a trading object in your message, type in the object name, select it and then click on "Add Objects"


Trading Items
Correlation Filter Money Management Strategy
Global Market Rotation Strategy V1.4
Global Market Rotation Strategy V1.1
Global Market Rotation Strategy V1.0
Market Breadth Indicator: Average On Balance Volume

How-to Lessons
How to filter stocks in a market composite
How to add future bars to plan for market scenarios
How to change volume bar colors when the price closes down
How to get fundamental data for U.S. Stocks
How to use the Fibonacci retracement drawing tool

Related Forum Threads
How to Turn any ordinary trading strategy into a profitable one
Place a profit stop through Money management strategy
filter formulas
Receate ETFReplay strategy
Advice on building a trading simulator strategy

Blog Posts
4 original breadth indicators you should consider in your market ...
6 techniques to improve the performance of your stock trading str...
Stock Market Prediction with QuantShare
How to Select the Best Market Indicator for your Trading System
4 Market Composite Indicators Based on Industry Data

Create an account
Affiliate Program
Contact Us
Trading Forum
How-to Lessons
About Us
Terms of Use

Copyright 2021
Social Media
Follow us on Facebook
Twitter Follow us on Twitter
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.