Click here to Login








Market Rule based on the Crossover Between Stock Close prices and their Moving Average

by Tom Huggens, 4976 days ago
Share |






This composite is calculated based on a trading rule involving the popular technical indicator: the simple moving average.

Here is how this composite is calculated: (This item requires an indicator that can be downloaded here Buy Indicator)
- Create a simple trading rule that returns a signal if the stock close price crosses above its 10-Bar simple moving average
- Using the "Buy Indicator", calculates the average return of a strategy that buys the stock if the above rule is bullish (true) and sells it after 10 days. The strategy is performed using data of the last 60 bars (days, hours, minutes...)
- Compare the strategy average return to zero by returning one (TRUE) if this return is higher than zero (SIGNAL2)
- Calculate the percentage of stocks that have a positive SIGNAL2 value. This is the value returned by this composite.

A value above 50% indicates that the strategy that consists of buying stocks when their close price crosses above their 10-Bar simple moving average is profitable on average for all stocks in the universe (Or stocks referenced by the composite).
You can also directly calculate the composite in a trading strategy (without creating a new symbol - _STRA_SMA). The advantage of using this method is that you can optimize the different values and see whether the market rule you are creating is profitable or not.
Example:
rule1 = comp((BuyInd(cross(close, sma(10)), 10, 50) > 0) * 100, "avg", 1, close > 2);


Share This ->
Share |


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




Type: Composite Index

Object ID: 927


Country:
All

Market: Stock Market

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

Download Trading Data using the Post-Script

Download Trading Data using the Pre-Script

Download Trading Data using the URL-Script

Trading Items: Data Download using .Net Scripts

Adding Trading Indicators and Formulas to a Chart

How to Download and Use Fundamental Data

QuantShare Version 2.1.2 - Trading Software

Automated Parsing in QS Trading Software

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.