Click here to Login





                                                   NORMDIST

  0

0
Frank
2011-07-20 06:29:27


Hello,

for calculating probabilities I would like to have something like the NormDist function from Excel within QuantShare.

How would I approach that within QuantShare?

Thanks for your support.

Frank



QuantShare
2011-07-20 06:49:42

  0

Best Answer
Hi Frank,

In "Tools -> Create Functions", you can add the following function:

#functions#
double NORMDIST(double x, double mean, double stddev, bool IsCumulative )
{
if ( IsCumulative )
{
double k = 2 / Math.Sqrt( 3.14159265 );
double z = ( x - mean ) / ( stddev * Math.Sqrt( 2 ) );
double q = k * ( z - Math.Pow(z, 3) / 3 + Math.Pow(z, 5) / 10 - Math.Pow(z, 7) / 42 + Math.Pow(z, 9) / 216
- Math.Pow(z, 11) / 1320 + Math.Pow(z, 13) / 9360 - Math.Pow(z, 15) / 75600 );
return ( 1 + q ) / 2;
}
else
{
return ( 1 / ( Math.Sqrt( 2 * 3.14159265 ) * stddev ) )
* Math.Exp( -Math.Pow(( x - mean ), 2) / ( 2 * Math.Pow(stddev, 2) ) );
}
}




No more messages
0




Reply:

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"










QuantShare

Trading Items
NORMDIST - Normal Probability Density Function
Advancing-Declining-Unchanged volume for NYSE, AMEX and NASDAQ
Technical indicators time series
Filter high and low spikes
ASX Historical data

How-to Lessons
How to display two stocks on the same chart
How to associate an index with a list of stocks
How to plot support and resistance lines automatically
How to display the bar index of a stock on a chart
How to rename a ticker symbol

Related Forum Threads
Same High Low in charts
Daily Beta Intraday
Open position profit/loss method in money manager
Permabear Sentiment Index
Add a strategy to Simulator

Blog Posts
Watch your support and resistance lines
Money Management: Optimize a trading system
Trend Following and Moving Averages
Transaction Costs
The average maximum drawdown metric









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 © 2025 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.