R Plot histogram density with normal distribution - Matlab, R project and Python | futures io social day trading
futures io futures trading

R Plot histogram density with normal distribution
Updated: Views / Replies:1,368 / 4
Created: by Big Mike Attachments:5

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you dont need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

Thread Tools Search this Thread

R Plot histogram density with normal distribution

  #1 (permalink)
Site Administrator
Manta, Ecuador
Futures Experience: Advanced
Platform: My own custom solution
Favorite Futures: E-mini ES S&P 500
Big Mike's Avatar
Posts: 46,335 since Jun 2009
Thanks: 29,444 given, 83,933 received

R Plot histogram density with normal distribution

Hi guys,

Attached is code for R to plot a histogram density and overlay a normal distribution. There is also a rug at the bottom. I've added plots for the current ticker price and the mean as well, and the standard deviation is shaded.

Forgive the crudeness of my code, I am battling two fronts here -- one, programming in R for only a few days, and two, my absolutely terrible math skills.

Sample charts:

USO (crude) for last 3 years

Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).

SPY for the last 3 months

Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).

FB since inception

Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).

F for the last 5 years

Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).

Please contribute any enhancements or bug fixes.


Due to time constraints, please do not PM me if your question can be resolved or answered on the forum.

Need help?
1) Stop changing things. No new indicators, charts, or methods. Be consistent with what is in front of you first.
2) Start a journal and post to it daily with the trades you made to show your strengths and weaknesses.
3) Set goals for yourself to reach daily. Make them about how you trade, not how much money you make.
4) Accept responsibility for your actions. Stop looking elsewhere to explain away poor performance.
5) Where to start as a trader? Watch this webinar and read this thread for hundreds of questions and answers.
Help using the forum? Watch this video to learn general tips on using the site.

If you want
to support our community, become an Elite Member.

Attached Files
Register to download File Type: r init.R (1.6 KB, 63 views)
Reply With Quote
The following 7 users say Thank You to Big Mike for this post:
  #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.

  #3 (permalink)
Elite Member
Paris, France
Futures Experience: Intermediate
Platform: MT4, Amibroker, Custom
Favorite Futures: EUR/USD
Posts: 44 since Jan 2012
Thanks: 5 given, 26 received

Hi, I have terrible math skill also.
What is the density ?
Also, what does these chart represent and how are they usefull to the trade decision ?

thanks !

Reply With Quote
  #4 (permalink)
Trading Apprentice
New York, New York, USA
Futures Experience: Intermediate
Platform: Trader Workstation, OTC
Broker/Data: Interactive Brokers
Favorite Futures: FX, credit
Posts: 1 since Apr 2014
Thanks: 0 given, 1 received

I short, the area under the density function with base [a,b] gives you the probability of getting into interval [a,b]... For a more detailed definition and description of the density of a continuous distribution, please search for "Probability density function" in Wikipedia.

Reply With Quote
The following user says Thank You to staassis for this post:
  #5 (permalink)
Trading Apprentice
Futures Experience: Advanced
Platform: NT
Favorite Futures: ES 6E
Posts: 5 since Jun 2012
Thanks: 0 given, 0 received

I think, You must use daily returns instead absolute values.

Reply With Quote


futures io > > > > R Plot histogram density with normal distribution

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Upcoming Webinars and Events (4:30PM ET unless noted)

Wyckoff Hunting for Great Risk/Reward Ratio w/Gary Fullett

Elite only

Digging into the Details of iSystems w/Stage 5 & iSystems

Jun 5

Similar Threads
Thread Thread Starter Forum Replies Last Post
Accumulation/Distribution Indicator? hector24 NinjaTrader 6 March 28th, 2017 07:57 AM
Wealth distribution curve in the U.S. Cloudy News and Current Events 1 August 22nd, 2013 03:46 PM
Value chart e normal distribution Mauro_60 NinjaTrader Programming 3 October 23rd, 2011 11:35 AM
Where can I find a Volume Distribution Indicator for NT7? Malvolio NinjaTrader 9 January 3rd, 2011 04:58 PM
Frequency distribution guidance request - help ! Eric j Traders Hideout 9 June 19th, 2010 10:30 AM

All times are GMT -4. The time now is 11:21 AM.

Copyright © 2018 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
All information is for educational use only and is not investment advice.
There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
no new posts
Page generated 2018-05-21 in 0.09 seconds with 20 queries on phoenix via your IP