Category Trend  Published on 27/06/2015

RsiAtr

Description

Robot use the indicators RSI and ATR 

     RsiAtr (4 Aout 2014)
     version 1.2014.8.4.21h00
      Author : https://www.facebook.com/ab.hacid

Symbol                            =    GBPUSD
TimeFrame                        =    H4
Volume                            =    100000
Stop Loss                        =    51 pips
Take Profit                        =    153 pips                

RSI Source                        =    Close                    
RSI Period                        =   17
RSI Overbuy Ceil                =    70 //    Seuil d'oversell
RSI Oversell Ceil                =    30  //    Seuil d'overbuy
RSI Min/Max Period            =    70  //    Period during which calculates the minimum and maximum to detect the extent of the range
RSI Exceed MinMax                =    3                        //    Lag with the Minimum and Maximum to clore positions

ATR Period                        =    20
ATR MAType                        =    Wilder Smoothing

Results                =    entre le 01/01/2014 et 4/8/2014 a 21h00 gain de 6961 euros(+14%).
Net profit            =    6960.79 euros
Ending Equity        =    6993.51 euros
 -------------------------------------------------------------------------------
           Use in real trading at your own risk. leverage with a risk of loss greater than the capital invested.
 -------------------------------------------------------------------------------

The PipsATR indicator is here

Author : Abdallah HACID

Solution Visual studio


#region Licence
//The MIT License (MIT)
//Copyright (c) 2014 abdallah HACID, https://www.facebook.com/ab.hacid

//Permission is hereby granted, free of charge, to any person obtaining a copy of this software
//and associated documentation files (the "Software"), to deal in the Software without restriction,
//including without limitation the rights to use, copy, modify, merge, publish, distribute,
//sublicense, and/or sell copies of the Software, and to permit persons to whom the Software
//is furnished to do so, subject to the following conditions:

//The above copyright notice and this permission notice shall be included in all copies or
//substantial portions of the Software.

//THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
//BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
//NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
//DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
//OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

// Project Hosting for Open Source Software on Codeplex : https://calgobots.codeplex.com/
#endregion

#region cBot Infos
// -------------------------------------------------------------------------------
//
//		RsiAtr (4 Aout 2014)
//		version 1.2014.8.4.21h00
//		Author : https://www.facebook.com/ab.hacid
//
// -------------------------------------------------------------------------------
#endregion

#region cBot Parameters Comments
//
// Robot using the indicators RSI and ATR
//
//	
//			Symbol							=	GBPUSD
//			TimeFrame						=	H4
//			Volume							=	100000
//          Stop Loss						=	51 pips
//          Take Profit						=	153 pips				
//
//			RSI Source						=	Close					
//			RSI Period						=   17
//			RSI Overbuy Ceil				=	70						//	Seuil d'oversell
//			RSI Oversell Ceil				=	30						//	Seuil d'overbuy
//			RSI Min/Max Period				=	70						//	Period during which calculates the minimum and maximum to detect the extent of the range
//			RSI Exceed MinMax				=	3						//	Lag with the Minimum and Maximum to clore positions
//
//			ATR Period						=	20
//			ATR MAType						=	Wilder Smoothing
//
//	Results :
//          Results				=	entre le 01/01/2014 et 4/8/2014 a 21h00 gain de 6961 euros(+14%).
//			Net profit			=	6960.79 euros
//			Ending Equity		=	6993.51 euros
//
// -------------------------------------------------------------------------------
//			Use in real trading at your own risk. leverage with a risk of loss greater than the capital invested.
// -------------------------------------------------------------------------------
#endregion

#region advertisement
// -------------------------------------------------------------------------------
//			Trading using leverage carries a high degree of risk to your capital, and it is possible to lose more than
//			your initial investment. Only speculate with money you can afford to lose.
// -------------------------------------------------------------------------------
#endregion


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

namespace cAlgo.Robots
{
    [Robot(TimeZone = TimeZones.UTC)]
    public class RsiAtr : Robot
    {
        #region cBot parameters
        [Parameter("Volume", DefaultValue = 100000, MinValue = 0)]
        public int Volume { get; set; }

        [Parameter("Stop Loss", DefaultValue = 51)]
        public int StopLoss { get; set; }

        [Parameter("Take Profit", DefaultValue = 153)]
        public int TakeProfit { get; set; }

        [Parameter("RSI Source")]
        public DataSeries RsiSource { get; set; }
        // Close
        [Parameter("RSI Period", DefaultValue = 17, MinValue = 1)]
        public int RsiPeriod { get; set; }

        [Parameter("RSI Overbuy Ceil", DefaultValue = 65, MinValue = 0, MaxValue = 100)]
        public int rsiOverbuyCeil { get; set; }

        [Parameter("RSI Oversell Ceil", DefaultValue = 30, MinValue = 0, MaxValue = 100)]
        public int rsiOversellCeil { get; set; }

        [Parameter("RSI Exceed Ceil", DefaultValue = 3, MinValue = 0, MaxValue = 50)]
        public int rsiExceedCeil { get; set; }

        [Parameter("RSI MimMax Period", DefaultValue = 70, MinValue = 1)]
        public int rsiMinMaxPeriod { get; set; }

        [Parameter("ATR Period", DefaultValue = 20, MinValue = 1)]
        public int AtrPeriod { get; set; }

        [Parameter("ATR MAType", DefaultValue = 6)]
        public MovingAverageType AtrMaType { get; set; }
        // Wilder Smoothing
        #endregion

        private RelativeStrengthIndex rsi;
        private PipsATRIndicator pipsATR;

        // Prefix commands the robot passes
        private const string botPrefix = "RSI-ATR";
        // Label orders the robot passes
        private string botLabel;
        double minPipsATR;
        double maxPipsATR;
        double ceilSignalPipsATR;
        double minRSI;
        double maxRSI;

        protected override void OnStart()
        {
            botLabel = string.Format("{0}-{1} {2}", botPrefix, Symbol.Code, TimeFrame);
            rsi = Indicators.RelativeStrengthIndex(RsiSource, RsiPeriod);
            pipsATR = Indicators.GetIndicator<PipsATRIndicator>(TimeFrame, AtrPeriod, AtrMaType);

            minPipsATR = pipsATR.Result.Minimum(pipsATR.Result.Count);
            maxPipsATR = pipsATR.Result.Maximum(pipsATR.Result.Count);

        }

        protected override void OnTick()
        {
            if (Trade.IsExecuting)
                return;

            minPipsATR = Math.Min(minPipsATR, pipsATR.Result.LastValue);
            maxPipsATR = Math.Max(maxPipsATR, pipsATR.Result.LastValue);
            minRSI = rsi.Result.Minimum(rsiMinMaxPeriod);
            maxRSI = rsi.Result.Maximum(rsiMinMaxPeriod);
            ceilSignalPipsATR = minPipsATR + (maxPipsATR - minPipsATR) / 3;

            if (rsi.Result.LastValue < minRSI + rsiExceedCeil)
                this.closeAllSellPositions();
            else if (rsi.Result.LastValue > maxRSI - rsiExceedCeil)
                this.closeAllBuyPositions();

            // Do nothing if daily ATR > Max allowed
            if (pipsATR.Result.LastValue <= ceilSignalPipsATR)
            {
                if ((!(this.existBuyPositions())) && rsi.Result.HasCrossedAbove(rsiOversellCeil, 0))
                {
                    this.closeAllSellPositions();
                    ExecuteMarketOrder(TradeType.Buy, Symbol, Volume, this.botName(), StopLoss, TakeProfit);
                }
                else if (!(this.existSellPositions()) && rsi.Result.HasCrossedBelow(rsiOverbuyCeil, 0))
                {
                    this.closeAllBuyPositions();
                    ExecuteMarketOrder(TradeType.Sell, Symbol, Volume, this.botName(), StopLoss, TakeProfit);
                }
            }
        }

    }
}


AY
aysos75

Joined on 28.09.2013

  • Distribution: Free
  • Language: C#
  • Trading platform: cTrader Automate
  • File name: RsiAtr.algo
  • Rating: 5
  • Installs: 4024
  • Modified: 13/10/2021 09:54
Comments
Log in to add a comment.
AL
ali.mirzaei84631 · 1 year ago

tnx

BO
bojesim268 · 1 year ago

Awesome blog! Is your theme custom made or did you download it from somewhere? A design like yours with a few simple tweeks would really make my blog shine. Please let me know where you got your theme. Kudos Miss Samsung Fascinate6.7 powerstroke muffler delete

HE
heciraf296 · 1 year ago

This type of message always inspiring and I prefer to read quality content, so happy to find good place to many here in the post, the writing is just great, thanks for the post. merchant cash advance

KT
ktfaizan2 · 1 year ago

This article was written by a real thinking writer without a doubt. I agree many of the with the solid points made by the writer. I’ll be back day in and day for further new updates.Faizan

TI
tikobig768 · 1 year ago

Seduction approach in general is usually an total solution regarding losers, males and females exactly who maintain small self-esteem, people looking for work and also commercial travellers. Folks that will be in enormous requirement assist, with regard to recording the actual minds on the individuals they will usually needed will probably be overpowered if they the real reason for wander belonging to the so-called seduction method. Thus choose, as well as reveal the seduction strategy to your friends which you are aware of are generally enduring numerous encumbrance of their life. You’ll be able to completely end up being with superb help in fixing that miseries that belongs to them life. security company gauteng

TI
tikobig768 · 1 year ago

I really thank you for the valuable info on this great subject and look forward to more great posts. Thanks a lot for enjoying this beauty article with me. I am appreciating it very much! Looking forward to another great article. Good luck to the author! All the best! 축구중계

CO
cojem16070 · 1 year ago

\Exactly laqr,I think I¡Çm smarter than Obama too. and to prove it, I¡Çll put my college GPA and transcripts up against his any day. Microgold

TA
tariq254500 · 1 year ago

As I website possessor I believe the content matter here is rattling great , appreciate it for your hard work. You should keep it up forever! Best of luck. server sensasional

YI
yibemit512 · 1 year ago

very good distribute, we certainly really like this web site, keep on that Relaxing boat cruises

YI
yibemit512 · 1 year ago

i love bloghoping and i really love to comment on your blog. anti rungkat slot

NA
naveelansari525 · 1 year ago

Watch with blood pressure With this Health Monitor you can check your Oxygen blood meter anytime anywhere New Blood pressure monitor watch Best Blood Pressure Watch now FREE Shipping and save 60.For Explore more Please click here and visit us in our website for more details.

NA
naveelansari525 · 1 year ago

Winter is here, and it's time to keep yourself warm and cozy. What better way to do that than with a crackling fire fueled by premium firewood from Black Forest Firewood? We are a trusted supplier of firewood in Sydney, and we've been providing our customers with top-quality firewood for over 35 years.firewood suppliers

NA
naveelansari525 · 1 year ago

Our Home Page provides Division 2, Division 3, NAIA FCS Football Player Killed a platform to tell their story A scouting site for the sleepers of the 2023 NFL Draft.For Explore more Please click here and visit us in our website for more details.

NA
naveelansari525 · 1 year ago

When I originally commented I clicked the -Notify me when new comments are added- checkbox now each time a comment is added I am four emails using the same comment. Perhaps there is any way you are able to eliminate me from that service? Thanks!Visit Here

AB
abdullahjameel9137 · 1 year ago

I think this is a really good site. You definately have a fabulous grasp of the subject matter and explain it great. kolkata ff

NA
naeemali200611 · 1 year ago

I have read your blog it is very helpful for me. I want to say thanks to you. I have bookmark your site for future updates. Where to buy crafted carts online

NA
naeemali200611 · 1 year ago

I have read your blog it is very helpful for me. I want to say thanks to you. I have bookmark your site for future updates. Garden Ornaments

AB
abdullahjameel9137 · 1 year ago

We are one of the leaders in selling best iptv subscription services in us & Canada. That could be possible with the combination of fantastic tech support and quality streaming service to our clients. Further, the IPTV subscription packages are available from us at unbeatable prices.

GI
gijeci2531 · 1 year ago

Let's explore all the ways we can cook with canned sardines, mussels, squid, octopus, tuna saladrecipe and the like. We will dive into recipes to get you excited about eating wonderful canned seafood.

HA
hamzaseo4433 · 1 year ago

I came across your blog internet site on google and check a few of your earlier posts. Continue to keep up the extremely good operate. I just additional up your RSS feed to my Windows live messenger News Reader. Seeking toward reading much more from you afterwards!?- vape dubai

HA
hamzaseo4433 · 1 year ago

I came across your blog internet site on google and check a few of your earlier posts. Continue to keep up the extremely good operate. I just additional up your RSS feed to my Windows live messenger News Reader. Seeking toward reading much more from you afterwards!?-<a href="https://siprashop.com/product/thanos-5000-puffs/">THANOS 5000 PUFFS</a>

HA
hamzaseo4433 · 1 year ago

I came across your blog internet site on google and check a few of your earlier posts. Continue to keep up the extremely good operate. I just additional up your RSS feed to my Windows live messenger News Reader. Seeking toward reading much more from you afterwards!?- myle disposable

HA
hamzaseo4433 · 1 year ago

I came across your blog internet site on google and check a few of your earlier posts. Continue to keep up the extremely good operate. I just additional up your RSS feed to my Windows live messenger News Reader. Seeking toward reading much more from you afterwards!?- Disposable Vape

AB
abdulmoiznadeemqayum · 1 year ago

Your Premium clairvoyance awaits you to reveal the main lines of your emotional, financial and professional future. For more best blog open it voyance

HA
hamzaseo4433 · 1 year ago

This article is an appealing wealth of informative data that is interesting and well-written. I commend your hard work on this and thank you for this information. You’ve got what it takes to get attention. Fulham Decorating Services

HA
hamzaseo4433 · 1 year ago

This article is an appealing wealth of informative data that is interesting and well-written. I commend your hard work on this and thank you for this information. You’ve got what it takes to get attention. car accident injury compensation

AB
abdulmoiznadeemqayum · 1 year ago

Anything perceived as happening in the world need not be judged. You cannot have a better life or a worse life in form. You have no control over the world. There is great release in knowing this, giving you full permission to be happy. a course in miracles

HA
hamzaseo4433 · 1 year ago

This article is an appealing wealth of informative data that is interesting and well-written. I commend your hard work on this and thank you for this information. You’ve got what it takes to get attention. best hemp protein powder chocolate

ZU
zubairkhatri101 · 1 year ago

Heya I’m for the first time here. I came across this board and I find It truly useful & it helped me out a lot. I hope to give something back and help others like you aided me.Tour Jurmala - Kemeri

HA
hamzaseo4433 · 1 year ago

Thanks for taking the time to discuss this, I feel strongly about it and love learning more on this topic. If possible, as you gain expertise, would you mind updating your blog with extra information? It is extremely helpful for me. SEO 香港

SI
siddiquekhirt123 · 1 year ago

This is my first time visit here. From the tons of comments on your articles,I guess I am not only one having all the enjoyment right here!物理補習推薦

ZU
zubairkhatri101 · 1 year ago

Dokhan for all smoking requirements in vape kuwait fast vape delivey in فيب الكويت and vape liquids all world vape shipping.