<p><div><div><div><div data-width="100" data-show-faces="false" data-send="true" data-layout="button_count" data-height="21" data-href="https://www.r-bloggers.com/overcome-the-fear-of-programming/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="https://www.quantinsti.com/blog/overcome-fear-programming/"> R programming</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<p><img sizes="(max-width: 1200px) 100vw, 1200px" alt="" class="wp-image-8278" src="https://i0.wp.com/www.quantinsti.com/wp-content/uploads/2017/04/Overcome-the-fear-of-programming_1_1.jpg?w=450&ssl=1" data-recalc-dims="1"></p>
<p>By <a target="_blank" rel="nofollow" href="https://www.linkedin.com/in/milind-paradkar-b37292107/">Milind Paradkar</a></p>
<p>You say you never programmed in life before? Never heard of words like Classes and Objects, Dataframe, Methods, Inheritance, Loops? Are you fearful of programming, huh?</p>
<p>Don’t be! Programming can be fun, stimulating, and once you start and learn to program many of you would love spending hours programming different strategies; you would love to see your own codes run in the blink of an eye and would see how powerful these codes can be.</p>
<p>The <a target="_blank" rel="nofollow" href="https://www.quantinsti.com/epat/">Executive Programme in Algorithmic Trading (EPAT™)</a> course makes extensive use of Python and R programming language to teach strategies, backtesting, and their optimization. Let us take the help of R to demonstrate how you can overcome the fear of programming. Here are some suggestions for the newbie programmers.</p>
<h3><strong>1) Think and let the questions pop in your mind</strong></h3>
<p>As a newbie programmer when you have a task to code, even before you start on it, spend some time ideating on how you would like to solve it step-by-step. Simply let questions pop up in your mind, as many questions as your mind may throw up.</p>
<p><strong>Here are a few questions:</strong><br>
Is it possible to download stock price data in R from google finance?<br>
How to delete a column in R? How to compute an exponential moving average (EMA)?<br>
How do I draw a line chart in R? How to merge two data sets?<br>
Is it possible to save the results in an excel workbook using R?</p>
<h3><strong>2) Google the questions for answers</strong></h3>
<p>Use google search to see whether solutions exist for the questions that you have raised. Let us take the second question, how to delete a column in R? We posted the question in the google search, and as we can see from the screenshot below we have the solution in the very first result shown by google.</p>
<p><img sizes="(max-width: 445px) 100vw, 445px" alt="" class="wp-image-8282" src="https://i1.wp.com/www.quantinsti.com/wp-content/uploads/2017/04/FearofProgramming-Pic1.png?resize=445%2C376&ssl=1" data-recalc-dims="1"></p>
<p>R is an open-source project, and there are hundreds of articles, blogs, forums, tutorials, Youtube videos on the net and books which will help you overcome the fear of programming and transition you from a beginner to an intermediate level, and eventually to an expert if you aspire to.</p>
<p>The chart below shows the number of questions/threads posted by newbie and expert programmers on two popular websites. As you can see, R clearly tops the results with more than 10 thousand questions/threads.<br>
(Source: www.r4stats.com )</p>
<p><img sizes="(max-width: 501px) 100vw, 501px" alt="" class="wp-image-8284" src="https://i2.wp.com/www.quantinsti.com/wp-content/uploads/2017/04/FearofProgramming-Pic2.png?w=450&ssl=1" data-recalc-dims="1"></p>
<p><strong>Let us search in google whether QuantInsti™ has put up any programming material on R.</strong><br>
As you can see from the google results, QuantInsti™ has posted quality content on its website to help newbie programmers design and model quantitative trading strategies in R. You can read all the rich content posted regularly by QuantInsti™ here – https://www.quantinsti.com/blog</p>
<p><img sizes="(max-width: 471px) 100vw, 471px" alt="" class="wp-image-8288" src="https://i0.wp.com/www.quantinsti.com/wp-content/uploads/2017/04/FearofProgramming-Pic3.png?w=450&ssl=1" data-recalc-dims="1"></p>
<h3><strong>3) Use the print command in R</strong></h3>
<p>As a newbie programmer, don’t get intimidated when you come across complex looking codes on the internet. If you are unable to figure out what exactly the code does, just copy the code in R. You can use a simple “print” command to help understand the code’s working.</p>
<p>One can also use Ctrl+Enter to execute the code line-by-line and see the results in the console.</p>
<p>Let us take an example of an MACD trading strategy posted on QuantInsti’s blog.</p>
<blockquote data-secret="du8gQfwdAb" class="wp-embedded-content"><p><a target="_blank" rel="nofollow" href="https://www.quantinsti.com/blog/an-example-of-a-trading-strategy-coded-in-r/">An example of a trading strategy coded using Quantmod Package in R</a></p>
</blockquote>
<p><iframe title="“An example of a trading strategy coded using Quantmod Package in R” — " data-secret="du8gQfwdAb" width="450" class="wp-embedded-content" src="https://www.quantinsti.com/blog/an-example-of-a-trading-strategy-coded-in-r/embed/#?secret=du8gQfwdAb"></iframe></p>
<p><img sizes="(max-width: 612px) 100vw, 612px" alt="" class="wp-image-8290" src="https://i0.wp.com/www.quantinsti.com/wp-content/uploads/2017/04/FearofProgramming-Pic4.png?w=450&ssl=1" data-recalc-dims="1"></p>
<p>I am unsure of the working of commands at line 9 and line 11. So I simply inserted a <strong>print(head(returns))</strong> command at line 10 and one more at line 12. Thereafter I ran the code. Below is the result as shown in the console window of R.</p>
<p><img sizes="(max-width: 302px) 100vw, 302px" alt="" class="wp-image-8292" src="https://i0.wp.com/www.quantinsti.com/wp-content/uploads/2017/04/FearofProgramming-Pic5.png?resize=302%2C278&ssl=1" data-recalc-dims="1"></p>
<p>The returns = returns[‘2008-06-02/2015-09-22’] command simply trims the original NSEI.Close price returns series. The series was earlier starting from 2007-09-17. The series now starts from 2008-06-02 and ends at 2015-09-22.</p>
<h3><strong>4) Use help() and example() functions in R</strong></h3>
<p>One can also make use of the help() and example() functions in R to understand a code, and also learn new ways of coding. Continuing with the code above, I am unsure what the ROC function does at line 9 in the code.</p>
<p><img sizes="(max-width: 540px) 100vw, 540px" alt="" class="wp-image-8294" src="https://i1.wp.com/www.quantinsti.com/wp-content/uploads/2017/04/FearofProgramming-Pic6.png?w=450&ssl=1" data-recalc-dims="1"></p>
<p>I used the help(“ROC”) command, and R displays all the relevant information regarding the usage, arguments of the ROC function.</p>
<p><img sizes="(max-width: 676px) 100vw, 676px" alt="" class="wp-image-8296" src="https://i1.wp.com/www.quantinsti.com/wp-content/uploads/2017/04/FearofProgramming-Pic7.png?w=450&ssl=1" data-recalc-dims="1"></p>
<p>There are hundreds of add-on packages in R which makes programming easy and yet powerful.</p>
<p>Below is the link to view all the available packages in R:<br>
https://cran.r-project.org/web/packages/available_packages_by_name.html</p>
<h3><strong>5) Give time to programming</strong></h3>
<p>Programming can be a very rewarding experience, and we expect that you devote some time towards learning and honing your programming skills. Below is a word cloud of some essential characteristics a good programmer should possess. The best suggestion would be to just start programming!!</p>
<p><img sizes="(max-width: 438px) 100vw, 438px" alt="" class="wp-image-8298" src="https://i1.wp.com/www.quantinsti.com/wp-content/uploads/2017/04/FearofProgramming-Pic8.png?resize=438%2C222&ssl=1" data-recalc-dims="1"></p>
<h3><strong>Next Step</strong></h3>
<p>If you want to learn various aspects of <a target="_blank" rel="nofollow" href="https://www.quantinsti.com/">Algorithmic trading</a> then check out the <a target="_blank" rel="nofollow" href="https://www.quantinsti.com/epat/">Executive Programme in Algorithmic Trading (EPAT™)</a>. The course covers training modules like Statistics &amp; Econometrics, Financial Computing &amp; Technology, and Algorithmic &amp; Quantitative Trading. EPAT™ equips you with the required skill sets to be a successful trader. <a target="_blank" rel="nofollow" href="https://www.quantinsti.com/epat/">Enroll now</a>!</p>
<p>As a newbie programmer, you have just made a start. The faculty at QuantInsti™ will teach and guide you through different aspects of programming in R and Python. Over the course of the program, you will learn different data structures, classes and objects, functions, and many other aspects which will enable you to program algorithmic trading strategies in the most efficient and powerful way.</p>
<p>The post <a target="_blank" rel="nofollow" href="https://www.quantinsti.com/blog/overcome-fear-programming/">Overcome the Fear of Programming</a> appeared first on <a target="_blank" rel="nofollow" href="https://www.quantinsti.com/"></a>.</p>
<p>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="https://www.quantinsti.com/blog/overcome-fear-programming/"> R programming</a></strong>.</div>
<hr>
<a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a rel="nofollow" href="https://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a title="The R Project for Statistical Computing" rel="nofollow" href="https://www.r-project.org/">R</a> news and <a title="R tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/tutorial">tutorials</a> on topics such as: <a title="Data science" rel="nofollow" href="https://www.r-bloggers.com/search/data%20science">Data science</a>, <a title="Big Data" rel="nofollow" href="https://www.r-bloggers.com/search/Big%20Data">Big Data, <a title="R jobs" rel="nofollow" href="https://www.r-users.com/">R jobs</a>, visualization (<a title="ggplot and ggplot2 tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/ggplot2">ggplot2</a>, <a title="Boxplots using lattice and ggplot2 tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/boxplot">Boxplots</a>, <a title="Maps and gis" rel="nofollow" href="https://www.r-bloggers.com/search/map">maps</a>, <a title="Animation in R" rel="nofollow" href="https://www.r-bloggers.com/search/animation">animation</a>), programming (<a title="RStudio IDE for R" rel="nofollow" href="https://www.r-bloggers.com/search/RStudio">RStudio</a>, <a title="Sweave and literate programming" rel="nofollow" href="https://www.r-bloggers.com/search/sweave">Sweave</a>, <a title="LaTeX in R" rel="nofollow" href="https://www.r-bloggers.com/search/LaTeX">LaTeX</a>, <a title="SQL and databases" rel="nofollow" href="https://www.r-bloggers.com/search/SQL">SQL</a>, <a title="Eclipse IDE for R" rel="nofollow" href="https://www.r-bloggers.com/search/eclipse">Eclipse</a>, <a title="git and github, Version Control System" rel="nofollow" href="https://www.r-bloggers.com/search/git">git</a>, <a title="Large data in R using Hadoop" rel="nofollow" href="https://www.r-bloggers.com/search/hadoop">hadoop</a>, <a title="Web Scraping of google, facebook, yahoo, twitter and more using R" rel="nofollow" href="https://www.r-bloggers.com/search/Web+Scraping">Web Scraping</a>) statistics (<a title="Regressions and ANOVA analysis tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/regression">regression</a>, <a title="principal component analysis tutorial" rel="nofollow" href="https://www.r-bloggers.com/search/PCA">PCA</a>, <a title="Time series" rel="nofollow" href="https://www.r-bloggers.com/search/time+series">time series</a>, <a title="finance trading" rel="nofollow" href="https://www.r-bloggers.com/search/trading">trading</a>) and more...
<img height="1" alt="" width="1" src="http://feeds.feedburner.com/~r/RBloggers/~4/twXUYLUsZ8I"></a></div>