Free course
Model a Quantitative Trading Strategy in R
Start Free Course10 Hours6 Videos74 Exercises5,268 Learners5400 XP
Create Your Free Account
or
By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.Loved by learners at thousands of companies
Course Description
R is widely used by analysts and traders around the world to develop quantitative trading strategies that can be executed manually or through program trading. This is an introductory course for beginners in R to get familiar with quantitative trading strategies and coding technical indicators in R. You will learn technical terms associated with trading strategies, work with data.tables in R, and manipulate the input data to create trading signals and profit-and-loss columns. You will also learn about optimizing parameters to be able to maximize profits. This course is for everyone interested in getting started with algorithmic trading. No prior knowledge is required!
- 1
Introduction to R for trading
FreeThis chapter equips you with basic programming skills in R before proceeding to strategy writing. This chapter covers reading a data.table, creating new columns in the table, calculating returns by different methods, loop functions, conditional functions, and plotting of datasets.
Read file: read.csv()100 xpGet a glimpse of your data100 xpTypes, Classes and Dimensions of Objects in R100 xpExtract data frame cell value50 xpExtract value of consecutive cells in a column50 xpFunction c()100 xpCreate a column using function c()100 xpVector Operations50 xpCalculate returns: Get started100 xpUsing the diff() function50 xpCalculate returns: Using c() and diff() together50 xpCalculate returns: For the second row100 xpCalculate returns: the general formula50 xpCalculate returns: vector division100 xpCalculate returns: for-loop100 xpCalculate log returns100 xpPlotting and interpreting charts50 xpPlot the Returns100 xpConditional Statements50 xp - 2
Code a basic trading strategy
FreeIn this chapter, you’ll learn how to write a simple strategy based on stock price movements, learn how to generate trading signals and how to determine the trading quantity and price to place orders. Finally, learn to assess your strategy based on the accrued profit and loss. Use R as a statistical tool to write your first fully functional programming code that performs these tasks automatically.
Introduction50 xpUsing the current position counter50 xpGenerate trading signal (1)50 xpGenerate trading signal (2)50 xpGenerating trading signal in actual table50 xpOutput Variables50 xpTrading quantity & traded lots50 xpCalculate trading profit50 xpMark to market50 xpCoding the strategy in R50 xpLoad the data set100 xpPlot the data100 xpInitialize output variables100 xpRows and iterations50 xpDefine & initialize counters100 xpThe for-loop100 xpThe if condition for signal generation100 xpThe if condition for buy or sell100 xpUpdate columns in case of buy100 xpUpdate columns in case of sell100 xpLast scenario: no change in trading position100 xpFormula for calculating the trading profit50 xpFormula for calculating the mark to market50 xpCalculate profit and mark to market100 xpCalculate traded lots100 xpPrint profit & traded lots100 xpRun the complete code and report the results50 xp - 3
Create a technical indicator
FreeApply the knowledge you’ve learned to create a more sophisticated trading strategy based on point and figure charting. By the end of this chapter, you will appreciate the complexities involved in creating quantitative trading strategies and will be equipped with the skills to write your own trading strategies in R.
Review of previous chapter50 xpIntroduction to a new strategy50 xpParameters and indicators in the new strategy50 xpCalculate box size in prices50 xpCalculate reversal size in prices50 xpLoad and plot the dataset100 xpInitialize parameters100 xpSignal Generation Logic50 xpPractice benchmark calculation 150 xpPractice signal generation 150 xpPractice benchmark calculation 250 xpPractice signal generation 250 xpLogic for generating trading signal of buy50 xpConditions for buying50 xpConditions for selling50 xpCoding the strategy in R50 xpInitialize bench counter100 xpInitiate the for loop100 xpFor loop: if condition for buy100 xpFor loop: if condition for sell100 xpFor loop: scenario of no change100 xpReview of the condition for changing benchmark50 xpFormula for changing benchmark50 xpFor loop: updating the counter 'bench'100 xpCalculate the trade profit and the mark to market100 xpMold your for-loop in a function100 xpRun the final code50 xpOptimize the input parameters50 xp

Quantinsti Faculty
QuantInsti is one of Asia's pioneer Algorithm Trading Research and Training Institutes focused on preparing financial market professionals for the contemporary field of Algorithmic and High Frequency Trading. QuantInsti institute developed the curriculum for the Asia's first Executive Program in Algorithmic Trading (E-PAT) in 2009. As an initiative by financial markets professionals with stellar academic and professional credentials, the program aims to fulfill the pressing demands for highly specialized skill sets of a potentially lucrative domain. QuantInsti opened the doors to global participants in 2012 by introducing virtual classrooms for its flagship E-PAT course and have seen participation from all inhabited continents since then.
What do other learners have to say?
Join over 11 million learners and start Model a Quantitative Trading Strategy in R today!
Create Your Free Account
or
By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.