Information

Username: drkhashix
Member since: 12 Feb 2023
Last login: 15 Oct 2024
Status: Active

Activity

Where Created Comments
Algorithms 26 20
Forum Topics 2 1
Jobs 0 1

About

Trader and developer of trading robots
Contact number: +989128702206
email : KHASHAYAR.NEZAMI@GMAIL.COM
DRKHASHIX@DRKHASHIX.COM
Instagram : KHASHAYARNEZAMI

Last Algorithm Comments

drkhashix's avatar
drkhashix · 6 months ago

Thank you very much, it would be better if you could make it a little more beautiful and add some themes

drkhashix's avatar
drkhashix · 6 months ago

I can solve the problem of the Nekert robot working on multiple currencies in two days. Anyone who wants to solve the problem, send a message. Also, it is better to open the transactions manually on a daily basis, and the robot should only do capital management. Anyone who wants to be a sponsor can contact me. email: khashayar.nezami@gmail.com

drkhashix's avatar
drkhashix · 7 months ago

This robot utilizes the cAlgo.API library for technical analysis and trade execution, without the need for popular libraries like Accord.NET or ML.NET. Its capabilities are limited to financial trading and risk management, relying on technical analysis indicators such as RSI and moving averages, along with the ability to assess candle power and divergences. It does not directly employ artificial intelligence algorithms such as machine learning and therefore does not make more advanced decisions. The robot does not learn or improve with experience but operates on fixed rules. It's named "AI Trader" with the expectation that, if artificial intelligence were present, it would trade similarly to this robot, yet in the hope of a future that may remain a dream.

drkhashix's avatar
drkhashix · 9 months ago

I have added a new update for this indicator, it also shows the time and spread, and you can specify the right position for the display, since there are no likes or thank in messages, I will work less on this indicator.

drkhashix's avatar
drkhashix · 10 months ago

I hope you can continue to work until the trading robot is in the support and resistance, it will do the transactions reveral in the zone and only when these areas are broken robot open breakout pos, I am not very familiar with the indicator algorithm. buo i hop you can do it.

using System;
using cAlgo.API;

namespace cAlgo.Robots
{
    [Robot("DRKHASHIX", AccessRights = AccessRights.None)]
    public class DRKHASHIX : Robot
    {
        [Parameter("Lot Size", Group = "Volume", DefaultValue = 0.01, MinValue = 0.00001, MaxValue = 100, Step = 0.00001)]
        public double LotSize { get; set; }

        [Parameter("Stop Loss (pips)", Group = "Risk Management", DefaultValue = 50, MinValue = 1)]
        public int StopLossInPips { get; set; }

        [Parameter("Take Profit (pips)", Group = "Risk Management", DefaultValue = 50, MinValue = 1)]
        public int TakeProfitInPips { get; set; }
        
        [Parameter("Period", DefaultValue = 10, MinValue = 3)]
        public int Period { get; set; }

        [Parameter("Buy", Group = "Colors", DefaultValue = "DodgerBlue")]
        public Color BuyColor { get; set; }

        [Parameter("Sell", Group = "Colors", DefaultValue = "Red")]
        public Color SellColor { get; set; }

        private const string Sign = "TBO";
        private TrendLevel LastBreakOutBuy { get; set; }
        private TrendLevel LastBreakOutSell { get; set; }
        private int LastIndex { get; set; }

        private bool isPositionOpen = false;
        
        protected override void OnStart()
        {
            LastBreakOutBuy = null;
            LastBreakOutSell = null;
            LastIndex = -1;
        }

        protected override void OnBar()
        {
            int index = MarketSeries.Close.Count - 1;
            int signal = SupportResistanceSignal(index);

            if (!isPositionOpen && signal != -1)
            {
                TradeType tradeType = (signal == 0) ? TradeType.Buy : TradeType.Sell;

                double volume = Symbol.NormalizeVolumeInUnits(Symbol.QuantityToVolumeInUnits(LotSize));

                var position = ExecuteMarketOrder(tradeType, Symbol, volume, "SupportResistanceBot", StopLossInPips, TakeProfitInPips);

                if (position != null)
                {
                    isPositionOpen = true;
                }
            }
        }

        protected override void OnPositionClosed(Position position)
        {
            isPositionOpen = false;
        }

        private int SupportResistanceSignal(int index)
        {
            if (index < Period) return -1;

            int A = index - Period;
            int B = index;

            if (LastBreakOutBuy == null)
            {
                if (ReadyResistance(index, Period))
                    LastBreakOutBuy = new TrendLevel
                    {
                        Name = string.Format("{0}-Buy-{1}", Sign, A),
                        IndexA = A,
                        IndexB = B,
                        Price = Bars.HighPrices[A]
                    };
            }

            if (LastBreakOutSell == null)
            {
                if (ReadySupport(index, Period))
                    LastBreakOutSell = new TrendLevel
                    {
                        Name = string.Format("{0}-Sell-{1}", Sign, A),
                        IndexA = A,
                        IndexB = B,
                        Price = Bars.LowPrices[A]
                    };
            }

            if (LastBreakOutBuy != null) LastBreakOutBuy.IndexB = B;
            if (LastBreakOutSell != null) LastBreakOutSell.IndexB = B;
            DrawTrendLevel(LastBreakOutBuy, BuyColor);
            DrawTrendLevel(LastBreakOutSell, SellColor);

            int signal = -1;

            if (LastIndex != index)
            {
                LastIndex = index;
                signal = OnBarforindicator(index);
            }

            return signal;
        }

        private int OnBarforindicator(int index)
        {
            int B = index - 1;
            int C = index - 2;

            int signal = -1;

            if (LastBreakOutBuy != null)
            {
                if (Bars.ClosePrices[B] > LastBreakOutBuy.Price)
                {
                    LastBreakOutBuy.IndexB = B;
                    DrawTrendLevel(LastBreakOutBuy, BuyColor);

                    if (LastBreakOutSell != null)
                    {
                        int vPeriod = LastBreakOutBuy.IndexB - LastBreakOutBuy.IndexA - 1;
                        int newindexA = C;

                        for (int i = 0; i < vPeriod; i++)
                        {
                            if (Bars.LowPrices[C - i] < Bars.LowPrices[newindexA]) newindexA = C - i;
                        }

                        if (Bars.LowPrices[newindexA] > LastBreakOutSell.Price)
                        {
                            LastBreakOutSell = new TrendLevel
                            {
                                Name = string.Format("{0}-Sell-{1}", Sign, newindexA),
                                IndexA = newindexA,
                                IndexB = index,
                                Price = Bars.LowPrices[newindexA]
                            };
                            DrawTrendLevel(LastBreakOutSell, SellColor);
                            signal = 1; // Sell signal
                        }
                    }
                    LastBreakOutBuy = null;
                }
            }

            if (LastBreakOutSell != null)
            {
                if (Bars.ClosePrices[B] < LastBreakOutSell.Price)
                {
                    LastBreakOutSell.IndexB = B;
                    DrawTrendLevel(LastBreakOutSell, SellColor);

                    if (LastBreakOutBuy != null)
                    {
                        int vPeriod = LastBreakOutSell.IndexB - LastBreakOutSell.IndexA - 1;
                        int newindexA = C;

                        for (int i = 0; i < vPeriod; i++)
                        {
                            if (Bars.HighPrices[C - i] > Bars.HighPrices[newindexA]) newindexA = C - i;
                        }

                        if (Bars.HighPrices[newindexA] < LastBreakOutBuy.Price)
                        {
                            LastBreakOutBuy = new TrendLevel
                            {
                                Name = string.Format("{0}-Buy-{1}", Sign, newindexA),
                                IndexA = newindexA,
                                IndexB = index,
                                Price = Bars.HighPrices[newindexA]
                            };
                            DrawTrendLevel(LastBreakOutBuy, BuyColor);
                            signal = 0; // Buy signal
                        }
                    }
                    LastBreakOutSell = null;
                }
            }

            return signal;
        }

        private void DrawTrendLevel(TrendLevel tLine, Color color)
        {
            if (tLine == null) return;
            Chart.DrawTrendLine(tLine.Name, tLine.IndexA, tLine.Price, tLine.IndexB, tLine.Price, color, 1);
        }

        private bool ReadyResistance(int index, int period)
        {
            bool result = true;
            for (int i = 0; i < period; i++)
            {
                if (Bars.ClosePrices[index - i] > Bars.HighPrices[index - period])
                {
                    result = false;
                    break;
                }
            }
            return result;
        }

        private bool ReadySupport(int index, int period)
        {
            bool result = true;
            for (int i = 0; i < period; i++)
            {
                if (Bars.ClosePrices[index - i] < Bars.LowPrices[index - period])
                {
                    result = false;
                    break;
                }
            }
            return result;
        }

        private class TrendLevel
        {
            public string Name { get; set; }
            public int IndexA { get; set; }
            public int IndexB { get; set; }
            public double Price { get; set; }
        }

    }
}

drkhashix's avatar
drkhashix · 10 months ago

It is an excellent card. It seems that this method is good for reveral transactions until breakout so that orders can be placed at those points.

drkhashix's avatar
drkhashix · 11 months ago

پارامتر های اخر رو خوب متوجه نشدم کد را ساده تر مینوشتی بهتر نبود 

drkhashix's avatar
drkhashix · 11 months ago

If you have an idea to update this robot, please provide and guide how to upgrade the robot

 

drkhashix's avatar
drkhashix · 1 year ago

Why do you love SMA so much?

drkhashix's avatar
drkhashix · 1 year ago

If anyone has an idea to improve the bot, please let me know in the messages

drkhashix's avatar
drkhashix · 1 year ago

parameter not bad: 3 50 3 1.5

In order, i.e. 3 candles in a row among the last 50 candles, if the size of those 3 candles is more than the average, a signal will be placed according to the formula 1.5

drkhashix's avatar
drkhashix · 1 year ago

"RSI should be set to 70 and 30, and they should be consistent with each other. The observation is that you have based the settings on past profitability, which might pose a problem in the future."

drkhashix's avatar
drkhashix · 1 year ago

Oh man, this is very complicated. Please explain a little more about the added lines and its usage

drkhashix's avatar
drkhashix · 1 year ago

For manual trading, it doesn't look bad by combining it with the smart money block order strategy, for example, when it gets saturated at the block order points and the candles change color at that point,and rsi say yes

can you see this image https://ibb.co/zXWrkR2

 but it's a pity that there is no smart money indicator in CTrader, 

drkhashix's avatar
drkhashix · 1 year ago

what is the signal code for this part of cod 

if (noc404Signal.LastValue == Up Arrow)
            {
                return 0;
            }

else if (noc404Signal.LastValue == Down Arrow)

drkhashix's avatar
drkhashix · 1 year ago
using System;
using cAlgo.API;
using cAlgo.API.Internals;
using cAlgo.API.Indicators;
using cAlgo.API.Requests;

namespace cAlgo.Robots
{
    [Robot("DRKHASHIX", AccessRights = AccessRights.None)]
    public class DRKHASHIX : Robot
    {
        [Parameter("Lot Size", Group = "Volume", DefaultValue = 0.01, MinValue = 0.00001, MaxValue = 100, Step = 0.00001)]
        public double LotSize { get; set; }

        [Parameter("Stop Loss (pips)", Group = "Risk Management", DefaultValue = 20, MinValue = 1)]
        public int StopLossInPips { get; set; }

        [Parameter("Take Profit (pips)", Group = "Risk Management", DefaultValue = 40, MinValue = 1)]
        public int TakeProfitInPips { get; set; }

        private bool isPositionOpen = false;
        private IndicatorDataSeries noc404Signal;

        protected override void OnStart()
        {

            noc404Signal = CreateDataSeries();


        }

        protected override void OnBar()
        {
            int signal = GetNOC404Signal();

            if (!isPositionOpen && signal != -1)
            {
                TradeType tradeType = (signal == 0) ? TradeType.Buy : TradeType.Sell;

                double volume = Symbol.NormalizeVolumeInUnits(Symbol.QuantityToVolumeInUnits(LotSize));

                var position = ExecuteMarketOrder(tradeType, Symbol, volume, "SupportResistanceBot", StopLossInPips, TakeProfitInPips);

                if (position != null)
                {
                    isPositionOpen = true;
                }
            }
        }

        protected override void OnPositionClosed(Position position)
        {
            isPositionOpen = false;
        }

        private int GetNOC404Signal()
        {
            int lastBarIndex = MarketSeries.Close.Count - 2;
            int prevBarIndex = lastBarIndex - 1;

            if (noc404Signal.LastValue == Up Arrow)
            {
                return 0;
            }

            else if (noc404Signal.LastValue == Down Arrow)
            {
                return 1;
            }

            return -1;
        }
    }
}
drkhashix's avatar
drkhashix · 1 year ago

can you buld robot buy this looks when 3 signal down the robot open one pos whit stoplos and tp

drkhashix's avatar
drkhashix · 1 year ago

can you do somthing to give signal for robot

drkhashix's avatar
drkhashix · 1 year ago

Hello world … I hope you enjoy the robot If you have any questions, I am here to answer your questions. drkhashix i love you all

drkhashix's avatar
drkhashix · 1 year ago

good morning

i want  to chose TradeType buy and sell sobody help plz

[Parameter]
public TradeType TradeType { get; set; }

how can emake this to work

or

bater chose pos bay sma for trent

Last Jobs Comments

drkhashix's avatar
drkhashix · 10 months ago
tell me your strategy Thomas