Information

Username: sascha.dawe
Member since: 11 Feb 2019
Last login: 11 Dec 2023
Status: Active

Activity

Where Created Comments
Algorithms 0 1
Forum Topics 11 13
Jobs 0 30

About

trader, programmer, contact at sascha.coding@gmail.com

Last Algorithm Comments

SA
sascha.dawe · 5 years ago

Hi Zaknafein,

Great work on this cbot. I have made a slight modification, so that when counting max positions, it only counts the open Gerbil positions. This allows you to open manual trades or run other cbots on the same account concurrently, if the max positions are set to one.

I would like to work on this with you further. If you are interested, please contact me via my email account.

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.GMTStandardTime, AccessRights = AccessRights.None)]
    public class Gerbil : Robot
    {
        [Parameter("Trade Start Hour", DefaultValue = 23, MinValue = 0, Step = 1)]
        public int TradeStart { get; set; }
        [Parameter("Trade End Hour", DefaultValue = 1, MinValue = 0, Step = 1)]
        public int TradeEnd { get; set; }
        [Parameter("Take Profit (Pips)", DefaultValue = 6, MinValue = 1, Step = 1)]
        public int TakeProfit { get; set; }
        [Parameter("Stop Loss (Pips)", DefaultValue = 150, MinValue = 1, Step = 1)]
        public int StopLoss { get; set; }
        [Parameter("Calculate Volume by Percentage?", DefaultValue = false)]
        public bool RiskPercent { get; set; }
        [Parameter("Quantity (%Risk or Lots)", DefaultValue = 0.01, MinValue = 0.01, Step = 0.01)]
        public double Quantity { get; set; }
        [Parameter("RSI Source")]
        public DataSeries RSISource { get; set; }
        [Parameter("RSI Period", DefaultValue = 7, MinValue = 1, Step = 1)]
        public int RSIPeriods { get; set; }
        [Parameter("RSI Overbought Level", DefaultValue = 80, MinValue = 1, Step = 1)]
        public int RSIOverB { get; set; }
        [Parameter("RSI Oversold Level", DefaultValue = 40, MinValue = 1, Step = 1)]
        public int RSIOverS { get; set; }
        [Parameter("ATR Periods", DefaultValue = 15, MinValue = 1, Step = 1)]
        public int ATRPeriods { get; set; }
        [Parameter("ATR From", DefaultValue = 10, MinValue = 1, Step = 1)]
        public int ATRFrom { get; set; }
        [Parameter("ATR To", DefaultValue = 100, MinValue = 1, Step = 1)]
        public int ATRTo { get; set; }
        [Parameter("Max Positions", DefaultValue = 1, MinValue = 1, Step = 1)]
        public int MaxPos { get; set; }
        [Parameter("Max DD Positions", DefaultValue = 0, MinValue = 0, Step = 1)]
        public int MaxDDPos { get; set; }
        [Parameter("KillHours", DefaultValue = 0, MinValue = 0, Step = 1)]
        public int KillHours { get; set; }

        private RelativeStrengthIndex rsi;
        private AverageTrueRange atr;
        private int DDPos = 0;

        protected override void OnStart()
        {
            rsi = Indicators.RelativeStrengthIndex(RSISource, RSIPeriods);
            atr = Indicators.AverageTrueRange(ATRPeriods, MovingAverageType.Simple);
        }

        protected override void OnBar()
        {
            if (Time.Hour >= TradeStart || Time.Hour < TradeEnd)
            {
                var atrVal = atr.Result.LastValue * 100000;
                if (atrVal > ATRFrom && atrVal < ATRTo)
                {
                    var positionsGerbil = Positions.FindAll("Gerbil", Symbol);
                    if (positionsGerbil.Length < MaxPos)
                    {
                        if (rsi.Result.LastValue < RSIOverS)
                        {
                            Open(TradeType.Buy);
                        }
                        else if (rsi.Result.LastValue > RSIOverB)
                        {
                            Open(TradeType.Sell);
                        }
                    }
                }
            }
            if (KillHours != 0)
            {

                foreach (var position in Positions.FindAll("Gerbil", Symbol))
                {
                    if (Time > position.EntryTime.AddMinutes(KillHours * 60))
                        ClosePosition(position);
                }
            }
        }


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

            ExecuteMarketOrder(tradeType, Symbol, volumeInUnits, "Gerbil", StopLoss, TakeProfit);
        }

        double CalculateVolume()
        {
            if (!RiskPercent)
            {
                return (Symbol.QuantityToVolumeInUnits(Quantity));
            }
            else
            {
                // Calculate the total risk allowed per trade.
                double riskPerTrade = (Account.Balance * Quantity) / 100;
                double totalSLPipValue = (StopLoss + Symbol.Spread) * Symbol.PipValue;
                double calculatedVolume = riskPerTrade / totalSLPipValue;

                double normalizedCalculatedVolume = Symbol.NormalizeVolumeInUnits(calculatedVolume, RoundingMode.ToNearest);
                return normalizedCalculatedVolume;
            }
        }


    }
}

Last Jobs Comments

SA
sascha.dawe · 2 years ago

Hi,

I can have a look at your errors. Send your source code to sascha.coding@gmail.com

Regards,

Sascha

SA
sascha.dawe · 3 years ago

Hi, 

I can help you with the pause button function. 

Contact sascha.coding@gmail.com

 

Regards, 

Sascha

SA
sascha.dawe · 3 years ago

Hi, 

I can review and fix your source code. 

Contact sascha.coding@gmail.com

Regards, 

Sascha

SA
sascha.dawe · 3 years ago

Hi,

 

I can help with your RSI bot. 

Please contact sascha.coding@gmail.com

 

Regards, 

Sascha

SA
sascha.dawe · 3 years ago

Hi, 

I can help you with your bot. 

Please send more details to sascha.coding@gmail.com

 

Regards,

Sascha

SA
sascha.dawe · 3 years ago

Hi, 

 

I can help you with your trade days and daily trade limits modification. 

 

Contact sascha.coding@gmail.com

Regards, 

Sascha

 

SA
sascha.dawe · 3 years ago

Hi,

I can help you with your equity control bot.

Please contact sascha.coding@gmail.com

 

Regards,

Sascha

SA
sascha.dawe · 3 years ago

Hi, 

 

I can help you with your Fibonacci bot. 

Please contact sascha.coding@gmail.com

Regards, 

Sascha

SA
sascha.dawe · 3 years ago

Hi, 

 

I can help you with your stochastic bot. 

Please contact sascha.coding@gmail.com

 

Regards, 

Sascha

SA
sascha.dawe · 3 years ago

Hi, 

I can help you with your bot. 

Contact sascha.coding@gmail.com

Regards, 

Sascha

SA
sascha.dawe · 3 years ago

Hi, 

I can help with this. 

Contact sascha.coding@gmail.com 

 

Regards,

Sascha

SA
sascha.dawe · 3 years ago

Hi, 

I can help you with your cbot.

Please contact sascha.coding@gmail.com

Sascha

SA
sascha.dawe · 3 years ago

Hi,

 

I can help you with your break out bot.

 

Please contact me at sascha.coding@gmail.com

 

Regards,

Sascha

SA
sascha.dawe · 4 years ago

Hi,

I can help you with your alarm notification.

Please send further details to sascha.coding@gmail.com

 

Regards,

Sascha

SA
sascha.dawe · 4 years ago

Hi, 

 

I can help you to add the lot size function. 

Please contact sascha.coding@gmail.com

SA
sascha.dawe · 4 years ago

Hi,

I can program this.

Contact sascha.coding@gmail.com

Regards,

Sascha

SA
sascha.dawe · 4 years ago

Hello,

I can help you with your break out bot .

Contact sascha.coding@gmail.com

Regards,

Sascha

SA
sascha.dawe · 4 years ago

Hi, 

I can help you with your ADX indicator.

sascha.coding@gmail.com 

SA
sascha.dawe · 4 years ago

Hi Jan,

I could have a look at your existing cbot template and make modifications if you like.

Regards, 

Sascha

sascha.coding@gmail.com

SA
sascha.dawe · 4 years ago

Hi Stuart,

 

I can help you with your strategy. What are you looking to add to your pivot point bot?

 

Contact sascha.coding@gmail.com 

 

Regards,

Sascha

SA
sascha.dawe · 4 years ago

Hi,

I can help you with the indicator. 

Contact sascha.coding@gmail.com 

SA
sascha.dawe · 4 years ago
Hi, I can implement these. Contact sascha.coding@gmail.com
SA
sascha.dawe · 4 years ago

Contact sascha.coding@gmail.com for help with this.

SA
sascha.dawe · 4 years ago
Hi, I can help you with the Renko bot. Contact sascha.coding@gmail.com
SA
sascha.dawe · 4 years ago
Hi, Contact sascha.coding@gmail.com to implement this bot.
SA
sascha.dawe · 4 years ago
Hi, I can do this indicator of you like. Contact sascha.coding@gmail.com
SA
sascha.dawe · 4 years ago
Hi, Contact sascha.coding@gmail.com if you want to change trailing stop.
SA
sascha.dawe · 4 years ago
Hi, I can make the changes for you. sascha.coding@gmail.com
SA
sascha.dawe · 4 years ago
Hi, I can create this for you. Please note, any Martingale strategy is extremely risky and will lead to 100% account loss eventually. Max limits are recommended. Contact, sascha.coding@gmail.com
SA
sascha.dawe · 4 years ago

Email sascha.coding@gmail.com to implement this idea.