Ivan
Ivan 's avatar

Info

Username:iForex2015
Name:Ivan
Member since: 17 Mar 2015

About

None

Signature

None

Last Algorithm Comments

@Break Out Candles:  23 Mar 2020, 19:14


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)             {             }         }     } }  

@Golden Dragon II:  16 Mar 2017, 18:27


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

@Golden Dragon II:  16 Mar 2017, 18:19


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. 

Last Forum Posts

@Custom MACD:  18 Jan 2022, 22:38


amusleh said:

IGForex said:

Hi,

Thank you for the code. It kinda works. Is there a way to show CustomMACD from the last index without stretching  or contracting?

Thank you
Regards
Ivan

Hi,

Not sure what do you mean, it's not stretching or contracting, usually a larger time frame bar contains multiple shorter time frame bars, that's why you see the same value for multiple bars.

Hi 

This is how it is showing on my system.

What I was asking was is it possible to show CustomMACD without stretching as seen in the first image I posted but without a gap between current time and CustomMACD end point. Every point of CustomMACD does not have to be aligned with the time/index, but only the end of it being aligned with last index.   

Thanks

@Custom MACD:  17 Jan 2022, 22:31


amusleh said:

Hi,

Each time frame uses different index, you can't use the current time frame bars index on another time frame.

You have to first get the other time frame bar index by using current time frame bar Open Time, try this:

using cAlgo.API;
using cAlgo.API.Internals;
using cAlgo.API.Indicators;

namespace cAlgo
{
    [Indicator(IsOverlay = false, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class CustomMACD : Indicator
    {
        public MacdCrossOver _macd;

        private Bars _bars;

        [Output("Histogram Up", PlotType = PlotType.Histogram, Color = Colors.DodgerBlue)]
        public IndicatorDataSeries HistogramPositive { get; set; }

        [Output("Histogram Down", PlotType = PlotType.Histogram, Color = Colors.DodgerBlue)]
        public IndicatorDataSeries HistogramNegative { get; set; }

        [Output("MACD", Color = Colors.DodgerBlue, LineStyle = LineStyle.Lines)]
        public IndicatorDataSeries MACD { get; set; }

        [Output("Signal", Color = Colors.Red, LineStyle = LineStyle.Lines)]
        public IndicatorDataSeries Signal { get; set; }

        [Parameter("Time Frame", DefaultValue = "Hour")]
        public TimeFrame tFrame { get; set; }

        protected override void Initialize()
        {
            _bars = MarketData.GetBars(tFrame);
            _macd = Indicators.MacdCrossOver(_bars.ClosePrices, 26, 12, 9);
        }

        public override void Calculate(int index)
        {
            var seriesIndex = _bars.OpenTimes.GetIndexByTime(Bars.OpenTimes[index]);

            if (_macd.Histogram[seriesIndex] > 0)
            {
                HistogramPositive[index] = _macd.Histogram[seriesIndex];
            }
            else if (_macd.Histogram[seriesIndex] < 0)
            {
                HistogramNegative[index] = _macd.Histogram[seriesIndex];
            }

            Signal[index] = _macd.Signal[seriesIndex];

            MACD[index] = _macd.MACD[seriesIndex];
        }
    }
}

Hi,

Thank you for the code. It kinda works. Is there a way to show CustomMACD from the last index without stretching  or contracting?

Thank you
Regards
Ivan

@Custom MACD:  16 Jan 2022, 18:45


Hello,

Below is a code for showing  MACD for custom TimeFrame.

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

namespace cAlgo
{
    [Indicator(IsOverlay = false, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class CustomMACD : Indicator
    {

        public MacdCrossOver MacdCrossOver;

        [Parameter()]

        MarketSeries series;


        [Output("Histogram Up", PlotType = PlotType.Histogram, Color = Colors.DodgerBlue)]
        public IndicatorDataSeries HistogramPositive { get; set; }

        [Output("Histogram Down", PlotType = PlotType.Histogram, Color = Colors.DodgerBlue)]
        public IndicatorDataSeries HistogramNegative { get; set; }

        [Output("MACD", Color = Colors.DodgerBlue, LineStyle = LineStyle.Lines)]
        public IndicatorDataSeries MACD { get; set; }

        [Output("Signal", Color = Colors.Red, LineStyle = LineStyle.Lines)]
        public IndicatorDataSeries Signal { get; set; }

        [Parameter("Time Frame", DefaultValue = "Hour")]
        public TimeFrame tFrame { get; set; }

        protected override void Initialize()
        {
            series = MarketData.GetSeries(tFrame);
            MacdCrossOver = Indicators.MacdCrossOver(series.Close, 26, 12, 9);

        }

        public override void Calculate(int index)
        {


            if (MacdCrossOver.Histogram[index] > 0)
            {
                HistogramPositive[index] = MacdCrossOver.Histogram[index];
            }

            else if (MacdCrossOver.Histogram[index] < 0)
            {
                HistogramNegative[index] = MacdCrossOver.Histogram[index];
            }



            Signal[index] = MacdCrossOver.Signal[index];

            MACD[index] = MacdCrossOver.MACD[index];

        }
    }
}

When I use this CustomMACD indicator with a time frame like m5 or m15 along with a default MACD indicator with a different time frame like m2, H1 or H4 , CustomMACD indicator is not aligning with present/current data. Here is an image of it.

As seen in the image, CustomMACD is showing near to 10/12/2022

This problem get worse if I scroll back for more past market data; in that case CustomMACD would be nowhere to be seen on screen.

Is there a way I can bring the CustomMACD to show near current date for example like 16/01/2022 in my case?

Thank you.

Regards
Ivan

@Market sentiment:  21 Jun 2021, 18:36


Symposium said:

IGForex said:

Hi Panagiotis, 
I think it is absurd calculation because ,10 ten lot sell position summing upto 100 lots will determmine market direction compared to 90 micro lot buy positions summing upto 0.9 lot. But still market sentiment will show up like 90% buying. Wouldn't you agree ? I say this because recently I noticed many symbol showing 90 + % open buy or sell positions and price goes opposite. THis is a useless feature or even misleading.

Thanks

IGForex, all data can be useful in these markets...... maybe look at sentiment when volumes are generally low (Asian, Early Monday, Late Friday Sessions) and you may notice the contrarians (or LP's) trading the opposite direction to market sentiment......

Possible strategy? Useful? Think about it........ Definetly not absurd.......

Thanks for the input. I tried as you suggested and its all 50-50. I realized it is not absurd. It s just an indicator and best option in front of me is to find a way to use it to my advantage.

@Market sentiment:  21 Jun 2021, 18:29


PanagiotisCharalampous said:

Hi 3047070,

It is neither absurd nor something intelligent. It is just a metric that says what it says. And what it says is that x% of traders believe that the market will go up and z% of traders believe that will go down. It is up to you to decide if this information is helpful for you or not and if you should consider it in any way. If you are not happy with this feature you can always use more advanced third part sentiment tools that consider volume of open positions as well.

Best Regards,

Panagiotis

I want to thank you for this most valuable information which I could not understand at first. It is neither absurd not intelligent, but just a metric. It took me a while and a lot of research and study to realize, all these indicators are just output shown based on current and/or past data. Beginner traders tend to hunt for that one perfect intelligent indicator that would show future results based on past data which simply does not exist. It s all about how do we interpret and use information to our advantage. 
Regards. 

@Change label or comment when modifying a positions:  13 Jan 2021, 06:26


Please make it possible to update label and/or comment on live positions and orders. It would help a lot.

@Login to different accounts from same broker:  13 Jan 2021, 06:19


It is possible to do so by enabling multiple profiles from Settings--> start up. 

I dont know since when was this available. 


Anyway big thanks 

@Market sentiment:  13 Feb 2020, 13:22


PanagiotisCharalampous said:

Hi Ivan,

We have restored this option in Spotware cTrader Beta. It will be pushed to brokers soon.

Best Regards,

Panagiotis 

Join us on Telegram

Thats great. Thanks for the message.

@Close All Positions - Close Filtered Positions:  12 Feb 2020, 18:52


catalin.rimaru said:

Add the option to close All Filtered Positions. 

Now, If I have 20 positions opened And I filter only the "EURUSD" ones or whatever filter I choose, the "Close All Positions" buton closes all 20 positions. I would like to Close All Filtered. 

thanks

A must have facility. 
I have closed positions accidentally thinking only filtered positions would be closed. 

@Market sentiment:  12 Feb 2020, 18:47


Hi Panagiotis ,

Is there a way to hide market sentiment without removing quick trade buttons ?

Notification Publishing copyrighted material is strictly prohibited. If you believe there is copyrighted material in this section you may use the Copyright Infringement Notification form to submit a claim.
free  22 Feb 2022
This indicator is an integration of two other indicators, viz Zigzag developed by Jiri and Andrew's Pitchfork indicators.   using cAlgo.API; using cAlgo.API.Internals; using cAlgo.API.Indicators; namespace cAlgo.Indicators { [Indicator(IsOverlay = true, AutoRescale = true, AccessRights = AccessRights.None)] public class AndrewsPitchforkZigZag : Indicator { #region Properties [Parameter()] public DataSeries High { get; set; } [Parameter()] public DataSeries Low { get; set; } [Parameter("Period", DefaultValue = 16, MinValue = 1)] public int Period { get; set; } [Output("ZigZagSeries", Color = Colors.Green, Thickness = 1, PlotType = PlotType.Line)] public IndicatorDataSeries ZigZagSeries { get; set; } [Parameter("Show Andrews Pitch Fork", DefaultValue = true)] public bool ShowAndrewsPitchFork { get; set; } #endregion #region Variables private double currentZigZagHigh = 0; private double currentZigZagLow = 0; private int lastSwingIndex = -1; private double lastSwingPrice = 0.0; private int trendDir = 0; private int CurrentBar = 0; #endregion protected override void Initialize() { } public override void Calculate(int index) { CurrentBar = High.Count; if (CurrentBar < 2) return; if (lastSwingPrice == 0.0) lastSwingPrice = Low[index] + (High[index] - Low[index]) / 2; bool isSwingHigh = High[index] == Functions.Maximum(High, Period); bool isSwingLow = Low[index] == Functions.Minimum(Low, Period); double saveValue = 0.0; bool addHigh = false; bool addLow = false; bool updateHigh = false; bool updateLow = false; if (trendDir == 1 && isSwingHigh && High[index] >= lastSwingPrice) { saveValue = High[index]; updateHigh = true; } else if (trendDir == -1 && isSwingLow && Low[index] <= lastSwingPrice) { saveValue = Low[index]; updateLow = true; } else if (trendDir <= 0 && isSwingHigh) { saveValue = High[index]; addHigh = true; trendDir = 1; } else if (trendDir >= 0 && isSwingLow) { saveValue = Low[index]; addLow = true; trendDir = -1; } if (addHigh || addLow || updateHigh || updateLow) { if (updateHigh && lastSwingIndex >= 0) { ZigZagSeries[lastSwingIndex] = double.NaN; } else if (updateLow && lastSwingIndex >= 0) { ZigZagSeries[lastSwingIndex] = double.NaN; } if (addHigh || updateHigh) { currentZigZagHigh = saveValue; ZigZagSeries[index] = currentZigZagHigh; } else if (addLow || updateLow) { currentZigZagLow = saveValue; ZigZagSeries[index] = currentZigZagLow; } lastSwingIndex = CurrentBar - 1; lastSwingPrice = saveValue; } if (ShowAndrewsPitchFork) DrawAndrewsPitchFork(index); } public void DrawAndrewsPitchFork(int index) { int barIndex1 = 0; int barIndex2 = 0; int barIndex3 = 0; int barIndex4 = 0; for (int i = index; i >= 0; i--) { if (ZigZagSeries[i] > 0) { if (barIndex4 == 0) { barIndex4 = i; } else if (barIndex3 == 0) { barIndex3 = i; } else if (barIndex2 == 0) { barIndex2 = i; } else if (barIndex1 == 0) { barIndex1 = i; break; } } } var y1 = ZigZagSeries[barIndex1]; var y2 = ZigZagSeries[barIndex2]; var y3 = ZigZagSeries[barIndex3]; var andrewsPitchfork = Chart.DrawAndrewsPitchfork("AndrewsPitchFork", barIndex1, y1, barIndex2, y2, barIndex3, y3, Color.Red); andrewsPitchfork.IsInteractive = true; } } }    
Warning! Executing cBots downloaded from this section may result in loss of funds. Use them at your own risk.

No uploaded.