Category Range  Published on 16/06/2023

RSI cbot

Description

 

 

Make the most of your trading opportunities with Robot for cTrader!

The Robot is an automated system designed to give you an edge in the financial market. With its intelligent implementation of technical indicators such as the ATR, EMA and RSI, this robot identifies buying and selling opportunities with precision.

With its flexible configuration parameters, you can adjust trading volume, take profit and stop loss levels, and set a maximum spread to suit your trading strategy. In addition, you can manage risk with specific parameters, such as maximum risk per account and maximum drawdown.

Robot constantly monitors market conditions and automatically executes trades when predefined conditions are met. Whether you prefer to follow overbought and oversold signals from the RSI or take advantage of trends identified by the ATR and EMA, this robot can adapt to your trading approach.

The stop loss update feature helps you protect your profits and limit your losses by adjusting the stop loss levels of open positions. In addition, the robot makes sure that risk conditions are within the set limits before opening new positions.

With its ability to trade at specific times of the day, you can set your preferred time window to take advantage of trading opportunities in the market.

The Robot is a powerful tool that can help you automate your trading and maximize your profits while controlling risk. Take advantage of cTrader's advanced technology and take your trading strategy to the next level.

Don't waste any more time and start using the Robot in cTrader to make smarter and more profitable trading decisions. Download the robot now and discover the unlimited potential of automated trading!'

 

 


// -------------------------------------------------------------------------------------------------
//
//    This code is a cTrader Automate API example.
//
//    This cBot is intended to be used as a sample and does not guarantee any particular outcome or
//    profit of any kind. Use it at your own risk.
//    
//    All changes to this file might be lost on the next application update.
//    If you are going to modify this file please make a copy using the "Duplicate" command.
//
//    The "Sample RSI cBot" will create a buy order when the Relative Strength Index indicator crosses the  level 30, 
//    and a Sell order when the RSI indicator crosses the level 70. The order is closed be either a Stop Loss, defined in 
//    the "Stop Loss" parameter, or by the opposite RSI crossing signal (buy orders close when RSI crosses the 70 level 
//    and sell orders are closed when RSI crosses the 30 level). 
//
//    The cBot can generate only one Buy or Sell order at any given time.
//
// -------------------------------------------------------------------------------------------------

using cAlgo.API;
using cAlgo.API.Indicators;

namespace cAlgo
{
    [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class SampleRSIcBot : Robot
    {
        [Parameter("Quantity (Lots)", Group = "Volume", DefaultValue = 1, MinValue = 0.01, Step = 0.01)]
        public double Quantity { get; set; }

        [Parameter("Source", Group = "RSI")]
        public DataSeries Source { get; set; }

        [Parameter("Periods", Group = "RSI", DefaultValue = 14)]
        public int Periods { get; set; }

        private RelativeStrengthIndex rsi;

        protected override void OnStart()
        {
            rsi = Indicators.RelativeStrengthIndex(Source, Periods);
        }

        protected override void OnTick()
        {
            if (rsi.Result.LastValue < 30)
            {
                Close(TradeType.Sell);
                Open(TradeType.Buy);
            }
            else if (rsi.Result.LastValue > 70)
            {
                Close(TradeType.Buy);
                Open(TradeType.Sell);
            }
        }

        private void Close(TradeType tradeType)
        {
            foreach (var position in Positions.FindAll("SampleRSI", SymbolName, tradeType))
                ClosePosition(position);
        }

        private void Open(TradeType tradeType)
        {
            var position = Positions.Find("SampleRSI", SymbolName, tradeType);
            var volumeInUnits = Symbol.QuantityToVolumeInUnits(Quantity);

            if (position == null)
                ExecuteMarketOrder(tradeType, SymbolName, volumeInUnits, "SampleRSI");
        }
    }
}


X1
x1379

Joined on 26.08.2020

  • Distribution: Paid
  • Language: C#
  • Trading platform: cTrader Automate
  • File name: Sample RSI cBot.algo
  • Rating: 0
  • Installs: 127
  • Modified: 14/06/2023 22:54
Comments
Log in to add a comment.
No comments found.