Click here to Login








Chi Squared Indicator

by Brian Brown, 3998 days ago
Share |






The Chi-Squared is a widely used statistical hypothesis test to determine whether observed results are significantly different from expected results or not.

In trading, we can use the Chi-Squared test to determine how meaningful or statistically significant the performance that follows a specific pattern is.

Let us for example say that our pattern, which is the crossover between the price and its moving average, produces a positive return average over the next one-bar.
We would like to test whether this has occurred by chance or not.

Here, we can use the Chi-Squared test to determine the confidence level (that the return following our pattern is positive). The higher the confidence level, the less likely our result occurred by change.

How to use The Chi-Squared function in a chart:

a = cross(close, sma(10));
b = ChiSquared(a, 0, 1);
plot(b, "");

Parameters of the "ChiSquared" indicator:
1: Pattern to test
2: Threshold. The pattern is compared with this threshold. Example: cross(close, sma(10)) > 0 or Not
3: The number of bars to calculate the future performance. Set 1 to calculate the next bar's performance.

In a trading system, you can type the following formula to buy on crossover only when the Chi-Squared result based on previous crossovers is high (less likely that it was occurred by change):

a = cross(close, sma(10));
chi = ChiSquared(a, 0, 1);
chi = chi[1]; // We reference the previous chi result here because the calculation uses one bar in the future

buy = a and chi > 5;

Or you can purchase on crossover while ranking stocks based on their Chi-Squared result:

a = cross(close, sma(10));
chi = ChiSquared(a, 0, 1);
chi = chi[1];
SetSimLongRank(chi);

buy = a;



Share This ->
Share |


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




Type: Trading Indicator

Object ID: 1387


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

Custom Shortcuts - Move a Chart to Display the Last Quotes/Data

Export Trading Orders from a Portfolio to a File

Backtesting Your Trading Systems: Symbol Segmentation

Update Chart Layout based on Active Time Frame

Presentation of QuantShare's new Real Time Version

Charting, Backtesting and Trading using Fundamental Data

Different Ticker Symbols for Each Data Source

How to Automatically Import Local Data Into QuantShare

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.