Pyne code is a language with Python syntax for programming trading indicators and strategies. This book takes you from programming basics to building your own indicator and testing a strategy on historical data.

You write and run the programs in PyneIDE, then examine their results on a chart. PyneCore handles the candle-by-candle processing in the background.

Who is this book for?

If you are new to programming, you can learn the programming basics you need here, along with how to read charts. The examples give you a foundation for creating indicators and trading strategies.

The screenshots show the IDE’s English labels. The instructions use those same labels and explain what they mean. Variable names and displayed labels in the examples are also in English.

What do you need to know before starting?

The book assumes two things:

  • You can create a folder, open and save a file, and copy and paste text. We explain how to set up PyneIDE and use it step by step.
  • You know addition, subtraction, multiplication, and division, and can work with decimals. The examples also use simple averages and percentage changes; we explain the formulas.

What helps if you already know it?

Charts will be easier to interpret if you have seen a price chart before and know what a candle and a timeframe are. For strategies, it helps to be familiar with buying, selling, positions, and commissions. The book explains these terms too, so you can start without any trading experience.

Recognizing the editor’s labels also helps. We explain the names and meanings of the actions as you use them.

What is not required?

You do not need to know Pine Script, Python, or any other programming language. We learn Pyne code directly, starting with variables and function calls. We also explain the Python syntax needed for each example.

You do not need experience with Visual Studio Code or an existing indicator or trading strategy. You build your own programs in the book. We practice with sample data; you do not need to trade real money or open a brokerage account.

Additional learning resources

If you want to review any of the basics, you can use these resources. You do not need to work through them before starting the book.

The book’s section on candle data explains the open, high, low, and close. You can also look up unfamiliar terms in the glossary later.

How to use this book

  1. Read the task and look at the expected result.
  2. Follow the steps in your own PyneIDE project.
  3. Before making a change, try to predict what will happen.
  4. Run the program again and compare the result with your prediction.
  5. Complete the exercise at the end of the chapter. Open the solution only afterward.

Example files

Download the book’s example files

The package contains the book’s complete programs. PyneIDE creates the demo data they use when you create the project. It is an artificial price series made for learning.

Chapters