Skip to main content
HomeR

Course

Financial Trading in R

IntermediateSkill Level
4.8+
65 reviews
Updated 09/2024
This course covers the basics of financial trading and how to use quantstrat to build signal-based trading strategies.
Start Course for Free
RApplied Finance5 hr20 videos65 Exercises5,050 XP22,613Statement of Accomplishment

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

Group

Training 2 or more people?

Try DataCamp for Business

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.

Prerequisites

Intermediate R for Finance
1

Trading basics

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.
Start Chapter
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.
Start Chapter
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.
Start Chapter
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.
Start Chapter
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.
Start Chapter
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.
Start Chapter
Financial Trading in R
Course
Complete

Earn Statement of Accomplishment

Add this credential to your LinkedIn profile, resume, or CV
Share it on social media and in your performance review
Enroll Now

Don’t just take our word for it

*4.8
from 65 reviews
88%
9%
3%
0%
0%
  • Kameron
    13 hours ago

  • Takuya
    4 weeks ago

  • Zlatko
    6 weeks ago

  • Stanislau
    2 months ago

  • ANTONIO
    3 months ago

    Excellent course easy to understand and very useful.

  • Daniel
    3 months ago

    explained extremely well

Kameron

Zlatko

Stanislau

FAQs

What R package is used to build trading strategies in this course?

You use the quantstrat package to set up signal-based trading strategies, including defining indicators, creating signals, writing trading rules, and simulating orders.

Do I need prior trading experience to take this course?

No. Chapter 1 introduces trading basics including momentum and oscillation philosophies, common pitfalls, and overfitting before you begin building strategies in quantstrat.

What are the four types of signals covered in this course?

You learn sigComparison, sigCrossover, sigThreshold, and sigFormula, which define how market data interacts with indicators and how indicators interact with each other.

How is strategy performance evaluated?

Chapter 6 teaches you to read trade statistics, view performance over time, and calculate the Sharpe ratio, a key reward-to-risk metric, using two different methods.

How long is this course compared to other DataCamp courses?

It is larger than average with 6 chapters and 67 exercises. The median completion time is about 2.7 hours, covering trading basics through full strategy analysis.

Join over 19 million learners and start Financial Trading 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.

Grow your data skills with DataCamp for Mobile

Make progress on the go with our mobile courses and daily 5-minute coding challenges.