Turtle Trading System Source code

Source: Internet
Author: User

Turtle Trading System The Source Turtle trading system is relatively early trading system, is also a world-famous mechanical trading system, for the investors who want to learn the programmatic system trading is a good introductory learning material. A complete set of mechanical trading systems have clear and unique trading signals, such as two moving averages that make up a trading system, but it's better to say

The Turtle trading system is a relatively early trading system and a world-famous mechanical trading system, which is a good introductory learning material for investors who want to learn how to deal with programmatic systems.
A complete set of mechanical trading systems have clear and unique trading signals, such as two moving averages, which constitute a trading system, but it is better to say that it belongs to the category of technical indicators. While the complete trading system holds position (position) adjustment and risk control is the core of the trading system, and the turtle trading system is such a set of trading systems.

Introduction to the Turtle Trading system:

Trading signals: Turtle trading signal is actually very simple, when the price hit 20 or 50 days to buy, when the price hit 10 days or 20 days low on the sale, the time of the specific parameters users can adjust themselves.

Position management and Risk control strategy: The Turtle trading system is determined by the total capital risk percentage and the N volatility factor strategy to determine how much the trading position is, N determines when to add, how much, and uses 2N to determine the protective loss of the position. N adjusted once every 7 days (five trading day). This is the trading strategy of the Turtle trading system, which belongs to a complete set of trading systems. Below is the program code of the Turtle Trading system test version I wrote.

Buy (BB) is the number of stocks bought (with a total of up to 4), Sell () is the total number of shares sold. The total funds take 1 million as an example.

Turtle Trading System Revision:

The main improvement of this version is to use the statement directly on the n algorithm, because the first n of the SMA function is the PDN value is the 20th simple moving average of the turtle trading system, so it will cause error, and the improvement is more in line with the original intention. We say here N, PDN and so on, if you have not seen the law of turtles may not understand, so before you know the source code, you can first look at the Turtle law. The following is a revised version of the program:

(Editor: admin)

Turtle Trading System Source code

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.