Algorithm Execution Logic

Estimated reading time: 1 min

Algorithm Template

Every algorithm should have this basic form:
Note for Python users: Because the Machina Engine code base is written in C# your Python script needs to import a C# connector clr and specifically reference the C# modules that are required for script execution.

Algorithm Preparation

When executed, an algorithm first does preparation work before consuming data:

  1. import modules (and reference C# modules in the case of Python)
  2. Instantiate the MEAlgorithm and name this algorithm instance (e.g. QuickSMA)
  3. Initialize parameters such as
  • indicators
  • exchange account information
  • instrument(s) to be traded
  1. fetch candle data

Question: modules in C#? instruments or symbols?

Importing modules

The minimum required modules for executing an algorithm are the following:
Was this article helpful?
Dislike 0
Views: 19