RSI Cbot

15 USD  Payment method:  Direct Payment
Open

Hi,

In this Cbot when the RSI last value pass 70 or drop below 30 it open or close the the trade, I need to change it to when the candle stick is closed and then if the RSI value is over 70 or under 30 it open or close the trade.

Also the TP and SL is not working ,

Thanks



using System;
using System.Linq;
using cAlgo.API;
using cAlgo.API.Indicators;
using cAlgo.API.Internals;
using cAlgo.Indicators;

namespace cAlgo.Robots
{
    [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class SampleRSIRobot : Robot
    {
        [Parameter("Source")]
        public DataSeries Source { get; set; }

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

        [Parameter("Stop Loss (pips)", DefaultValue = 100, MinValue = 1)]
        public int StopLoss { get; set; }

        [Parameter("Take Profit (pips)", DefaultValue = 100, MinValue = 1)]
        public int TakeProfit { get; set; }

        [Parameter("Volume", DefaultValue = 10000, MinValue = 1000)]
        public int Volume { 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", Symbol, tradeType))
                ClosePosition(position);
        }

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

            if (position == null)
                ExecuteMarketOrder(tradeType, Symbol, Volume, "SampleRSI");
        }
    }
}

Hi there,

We can help you with your project. You can contact us at contact@clickalgo.com for more information.

Best Regards,

Donald

Hello!
My name is Mike from 4xdev. I am a member of the 4xdev development company, specialized in creating trading tools:
custom indicators, EAs, scripts, bots, alerts, cAlgo, cBots, etc.

We have a great experience in a —ĀTrader platforms.
Our clients are satisfied with the quality of our work and repeatedly contact us after completing an order to optimize their own cAlgos.
You can see reviews of us at forexpeacearmy.com and trustpilot.com, and our website 4xdev.com.

We can help you with your project. Please let me know if you are interested (support@4xdev.com).
WhatsApp: +380508146716
Skype: live:.cid.285d85434983f29e
Telegram: https://t.me/Forexdev

We offer the rate in the amount of $40 per hour, including the work of our programmers and QA-engineer.
The cost starts from $150 on average.

Looking forward to hearing from you.

Hi,

   hope you doing well. I'll develop RSI based EA/indicator for you at your affordability. would you like to have a connection with me. Feel free to contact me. we can have a discussion.

Regards

Nabeel

Email: privateforexdna@gmail.com

Fiverr: