Information

Username: iForex2015
Member since: 17 Mar 2015
Last login: 02 Sep 2023
Status: Active

Activity

Where Created Comments
Algorithms 1 3
Forum Topics 20 19
Jobs 0 0

Last Algorithm Comments

IF
Ivan · 3 years ago

Changing candle color algorithmically is possible now .  

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

namespace cAlgo.Indicators
{
    [Indicator(IsOverlay = true, AccessRights = AccessRights.None)]
    public class BreakOutCandles : Indicator
    {

        [Parameter("How Many Break Out Bars", DefaultValue = 5)]
        public int HowManyBreakOutCandles { get; set; }

        [Parameter("Breakout up color", DefaultValue = "Green")]
        public string UpColor { get; set; }

        [Parameter("Breakout down color", DefaultValue = "Red")]
        public string DownColor { get; set; }

        [Parameter("Range color", DefaultValue = "LightGray")]
        public string RangeColor { get; set; }

        private Color color;

        protected override void Initialize()
        {

        }
        public override void Calculate(int index)
        {
            try
            {
                var open = MarketSeries.Open[index];
                var close = MarketSeries.Close[index];
                var high = MarketSeries.High[index];
                var low = MarketSeries.Low[index];

                var highest = MarketSeries.High[index - 1];
                var lowest = MarketSeries.Low[index - 1];
                for (int i = 2; i <= HowManyBreakOutCandles; i++)
                {
                    if (highest < MarketSeries.High[index - i])
                        highest = MarketSeries.High[index - i];
                    if (lowest > MarketSeries.Low[index - i])
                        lowest = MarketSeries.Low[index - i];
                }

                if (close > highest && close > open)
                    color = Color.FromName(UpColor);
                else if (close < lowest && close < open)
                    color = Color.FromName(DownColor);
                else if (close > open)
                    color = Color.FromName(RangeColor);
                else if (close <= open)
                    color = Color.FromName(RangeColor);
                Chart.SetBarColor(index, color);
            } catch (Exception)
            {
            }

        }
    }

}

 

IF
Ivan · 6 years ago

comment mistake edit:.....plunging of Swiss frank pairs on Jan-14-2015.....

:)

IF
Ivan · 6 years ago

Hi all, 

I back tested on XAUUSD - m5  and some other pairs, but finding the optimum params is really hard. Most of the time it is showing loss. Even if I find a set of params that shows profit, it shows loss on other periods with a max Draw down upto 97%. So it is a hit and miss thing but trading with real money on this seems gambling I prefer not to use. This is a 5 star rated bot and many people are commenting like its working perfect for them. Please share with us the best params you found out and the time period you got the profit. 

If you test any bot, dont forget to back test during the periods of the most important news like plunging of Swiss Frank on Jan-14-2015, Brexit, Trumps victory. The account is blown up with a max DD of 106%, 95% 113%. So I guess there is no money management strategy applied on this bot. 

nobulart Had worked had on this bot and I appreciate very much sharing this work with us. 

Thanks.