How do you get icons over candles on a Renko chart when there's more than one candle at the same time?

Created at 17 Mar 2022, 11:10
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
FI

firemyst

Joined 26.03.2019

How do you get icons over candles on a Renko chart when there's more than one candle at the same time?
17 Mar 2022, 11:10


How does one get an icon over each bar on a Renko chart when more than one Renko bar occurs on the same chart time?

Example:

 

This is the code I have which obviously doesn't work. Also using the Server.Time in place of the "index" in the Chart.DrawIcon method doesn't work either.

 

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

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

        protected override void Initialize()
        {
        }

        public override void Calculate(int index)
        {
            Chart.DrawIcon("EC" + Symbol.Name + Bars.TimeFrame.Name + index.ToString(), ChartIconType.DownArrow, index, Bars.HighPrices.Last(0) + (5 * Symbol.PipSize), Color.Lavender);

        }

    }
}

 

Thank you.


@firemyst
Replies

amusleh
18 Mar 2022, 08:30

Hi,

The bar index should work fine, if it's not then it's a bug.

Can you tell me which broker you are using? which Renko chart? I will try to reproduce it.


@amusleh

firemyst
18 Mar 2022, 09:00

RE:

amusleh said:

Hi,

The bar index should work fine, if it's not then it's a bug.

Can you tell me which broker you are using? which Renko chart? I will try to reproduce it.

 

Great. You have the code and screen capture above.

 

Broker is Pepperstone.

Renko chart is Re5.

Chart is NAS100. Date/time on the screen capture. But just in case, time in UTC + 8 is Mar 17th from 04:43 - 04:54

 

Thank you.


@firemyst

amusleh
18 Mar 2022, 09:44

RE: RE:

firemyst said:

Great. You have the code and screen capture above.

 

Broker is Pepperstone.

Renko chart is Re5.

Chart is NAS100. Date/time on the screen capture. But just in case, time in UTC + 8 is Mar 17th from 04:43 - 04:54

 

Thank you.

Hi,

We were able to reproduce the issue, it's a bug and we will fix it.

Thanks for reporting.


@amusleh