Skip to main content
HomeR

Financial Trading in R

This course covers the basics of financial trading and how to use quantstrat to build signal-based trading strategies.

Start Course for Free
5 hours20 videos65 exercises21,826 learnersTrophyStatement of Accomplishment

Create Your Free Account

GoogleLinkedInFacebook

or

By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.
Group

Training 2 or more people?

Try DataCamp for Business

Loved by learners at thousands of companies


Course Description

This course will cover the basics on financial trading and will give you an overview of how to use quantstrat to build signal-based trading strategies in R. It will teach you how to set up a quantstrat strategy, apply transformations of market data called indicators, create signals based on the interactions of those indicators, and even simulate orders. Lastly, it will explain how to analyze your results both from statistical and visual perspectives.
For Business

Training 2 or more people?

Get your team access to the full DataCamp platform, including all the features.
DataCamp for BusinessFor a bespoke solution book a demo.

In the following Tracks

Applied Finance in R

Go To Track

Quantitative Analyst in R

Go To Track
  1. 1

    Trading basics

    Free

    In this chapter, you will learn the definition of trading, the philosophies of trading, and the pitfalls that exist in trading. This chapter covers both momentum and oscillation trading, along with some phrases to identify these types of philosophies. You will learn about overfitting and how to avoid it, obtaining and plotting financial data, and using a well-known indicator in trading.

    Play Chapter Now
    Why do people trade?
    50 xp
    Identifying types of trading philosophies - I
    50 xp
    Identifying types of trading philosophies - II
    50 xp
    Identifying types of trading philosophies - III
    50 xp
    Pitfalls of various trading systems
    50 xp
    How to prevent overfitting
    50 xp
    Getting financial data
    50 xp
    Plotting financial data
    100 xp
    Adding indicators to financial data
    50 xp
    Adding a moving average to financial data
    100 xp
  2. 2

    A boilerplate for quantstrat strategies

    Before building a strategy, the quantstrat package requires you to initialize some settings. In this chapter you will learn how this is done. You will cover a series of functions that deal with initializing a time zone, currency, the instruments you'll be working with, along with quantstrat's various frameworks that will allow it to perform analytics. Once this is done, you will have the knowledge to set up a quantstrat initialization file, and know how to change it.

    Play Chapter Now
  3. 3

    Indicators

    Indicators are crucial for your trading strategy. They are transformations of market data that allow a clearer understanding of its overall behavior, usually in exchange for lagging the market behavior. Here, you will be working with both trend types of indicators as well as oscillation indicators. You will also learn how to use pre-programmed indicators available in other libraries as well as implement one of your own.

    Play Chapter Now
  4. 4

    Signals

    When constructing a quantstrat strategy, you want to see how the market interacts with indicators and how indicators interact with each other. In this chapter you'll learn how indicators can generate signals in quantstrat. Signals are interactions of market data with indicators, or indicators with other indicators. There are four types of signals in quantstrat: sigComparison, sigCrossover, sigThreshold, and sigFormula. By the end of this chapter, you'll know all about these signals, what they do, and how to use them.

    Play Chapter Now
  5. 5

    Rules

    In this chapter, you'll learn how to shape your trading transaction once you decide to execute on a signal. This chapter will cover a basic primer on rules, and how to enter and exit positions. You'll also learn how to send inputs to order-sizing functions. By the end of this chapter, you'll learn the gist of how rules function, and where you can continue learning about them.

    Play Chapter Now
  6. 6

    Analyzing results

    After a quantstrat strategy has been constructed, it's vital to know how to actually analyze the strategy's performance. This chapter details just that. You will learn how to read vital trade statistics, and view the performance of your trading strategy over time. You will also learn how to get a reward to risk ratio called the Sharpe ratio in two different ways. This is the last chapter.

    Play Chapter Now
For Business

Training 2 or more people?

Get your team access to the full DataCamp platform, including all the features.

In the following Tracks

Applied Finance in R

Go To Track

Quantitative Analyst in R

Go To Track

datasets

SPY data from 2000 through 2016

collaborators

Collaborator's avatar
Lore Dirick
Ilya Kipnis HeadshotIlya Kipnis

Professional Quantitative Analyst and R programmer

Ilya Kipnis is a professional quantitative analyst and R programmer. He received his M.S. degree in statistics in 2010 from Rutgers University, and has worked in the financial industry for several years. He is also a co-author in the book "Introduction to Quantitative Trading With R", and an internationally read quantitative research blogger. His work can be found at QuantStrat TradeR.
See More

What do other learners have to say?

Join over 15 million learners and start Financial Trading in R today!

Create Your Free Account

GoogleLinkedInFacebook

or

By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.