Search

# Simple Moving Average cBot

This basic starter kit for algo developers uses an open-source cTrader Simple Moving Average trading system to open and close trades based on two SMA indicators crossing. A simple moving average (SMA) is an arithmetic moving average calculated by adding recent prices and then dividing that figure by the number of time periods in the calculation average. This trading robot uses two SMA indicators to open and close trades.

*This product is for educational purposes only *
Type: cBot code for developers
Current version: 1.0
Requires: Windows 7, 10, 11
Updated: Friday, 28 July 2023

Need a broker?  Open a risk-free demo account

£0.00

Single payment, 1-year free support

A simple moving average (SMA) is a commonly used technical indicator in financial analysis that helps smooth out price data over a specified period. It is a straightforward calculation that provides traders and analysts with insights into the general direction and momentum of a price trend.

To calculate a simple moving average, you take the sum of a specific number of price data points and divide it by the number of periods used. The result is a single data point that represents the average price over that period. As new data becomes available, the oldest data point is dropped, and the newest data point is included in the calculation.

A basic Simple Moving Average trading strategy works by automatically submitting orders when the fast-moving average crosses the slow-moving average, this cTrader cBot will open and close trades based on these two indicators crossing above and below each other. Such a trading robot typically operates based on predefined rules and parameters, including specific SMA periods and thresholds for generating buy or sell signals. Here's a simplified example of how an SMA trading robot might work:

## How Does the cBot Open & Close Trades?

1. Signal Generation: The trading robot continuously monitors the price data of a particular asset or security. When the fast SMA crosses above the slow SMA, it generates a buy signal, indicating a potential uptrend. Conversely, when the fast SMA crosses below the slow SMA, it generates a sell signal, indicating a potential downtrend.

3. Risk Management: The trading robot typically incorporates risk management measures, such as stop-loss orders or position sizing, to limit potential losses and manage overall portfolio risk.

You can add additional risk management and other trade rules yourself or by contacting our development team.

The goal of an SMA trading robot is to automate the trading process and remove emotional bias from decision-making and by relying on predefined rules and objective indicators like SMA crossovers, the robot seeks to take advantage of potential trends and generate profits based on the chosen trading strategy. Research the internet for ideas on how to trade this strategy and the settings to use.

SMA cBot is provided with full source code by Spotware.com

## How to Attach Indicator to Chart

You do not need to attach the Parabolic SAR indicator to your chart when you run the cBot, but it is a good idea to visually see the indicator to check your trade rules for opening and closing trades and any risk management.

## How To View The Source Code

To view the source code for this cBot, you will first need to make sure you have downloaded and installed cTrader Desktop, you can also scroll to the bottom of this page for instructions on how to install the cBot. Once installed you will have the cTrader application open, next you need to navigate to the Automate application and click on the name of the cBot, the source should show in the right-hand window.

If you need more help watch a video tutorial on how to use cTrader Automate.

In this instructional guide, we aim to assist you in acquiring the necessary skills to engage in market trading through automated trading strategies (cBots) using the cTrader Desktop trading platform. By the conclusion of this tutorial, you will gain the confidence to employ a cTrader cBot alongside the Algo application of cTrader, enabling you to automatically execute and handle your market orders. This course is designed to familiarize novice traders with the fundamental principles of algorithmic trading utilizing the cTrader platform.

## Learn Microsoft C# for Algo Trading

A significant number of traders venture into algorithmic trading with the misconception that they have discovered a foolproof strategy that guarantees effortless wealth. However, this notion is far from reality. It is crucial to read this article, as it can save you valuable time and money.

## How To Install & Remove

First, make sure you have the cTrader trading platform installed and then simply unzip the file and double-click on it to automatically install it onto the platform.

## Any Questions?

If you have any questions, please first search our coding help forum for the answer, if you cannot find it, post a new question.