Topics
27 Oct 2021, 09:22
 1
 879
 1
26 Oct 2021, 11:07
 1679
 10
03 May 2021, 10:41
 0
 1124
 2
09 Oct 2020, 22:26
 1679
 2
28 Apr 2020, 18:57
 1492
 2
Replies

hslagter
08 Dec 2022, 20:05

RE: Thanks

Spotware said:

Dear trader,

Can you please advise the version of cTrader you are using?

Best regards,

cTrader Team

I don´t know what you did, but it works fine now. I can have several brokers operating. Thanks.


@hslagter

hslagter
08 Dec 2022, 09:11

RE: cTrader I tried 4.5.1

Spotware said:

Dear trader,

Can you please advise the version of cTrader you are using?

Best regards,

cTrader Team

 


@hslagter

hslagter
07 Dec 2022, 17:33 ( Updated at: 07 Dec 2022, 17:35 )

RE:

Spotware said:

Dear trader,

Can you please advise the version of cTrader you are using?

Best regards,

cTrader Team

It works on version 4.4.19. I tried with "_bars=null;". Unfortunately no result.


@hslagter

hslagter
06 Dec 2022, 12:41 ( Updated at: 21 Dec 2023, 09:23 )

RE:

Spotware said:

Dear trader,

In order for us to investigate this further, please provide us with the cBot code and send us some troubleshooting information the next time this happens.

Best regards,

cTrader Team

Here is more information. I started the cBot with a memory usage of.... after half an hour this has increased to... See the screenshots. In the parameters you can disable the HMA, Stochastic, etc. after which the same test does not give a problem. I have modified the Windows swap file and in VMware the RAM memory, but I can't find a solution there. If I disable HMA etc., Histo_trend(TimeFrame timeframe), string HMA_trend(TimeFrame timeframe), etc. are no longer called. The same process in MQL5 is no problem. It is a version that I am editing, so there may be some beauty flaws or unnecessary assignments in it, which no longer have a function.

It works on version 4.4.19

Caption
Caption

@hslagter

hslagter
27 Oct 2021, 20:07

RE:

Thanks for your answer. I opened a thread on the forum suggestions section. I'm going to try your code. All the price movements, the indicators included, are translated in trendlines so you can see immediatly what the status is of the pair. I use to do it in MT5.

amusleh said:

Hi,

No, you can't get the angle from API, but you can calculate it if you want to:

        private double GetAngle(ChartTrendLine trendLine)
        {
            var x1 = Bars.OpenTimes.GetIndexByTime(trendLine.Time1);
            var x2= Bars.OpenTimes.GetIndexByTime(trendLine.Time2);

            double xDiff = x2 - x1;
            var yDiff = trendLine.Y2 - trendLine.Y1;

            return Math.Atan2(yDiff, xDiff) * 180.0 / Math.PI;
        }

The above method will return the angle of a trend line in Degree, it will not work properly if your trend line is drawn in future time, because it uses bar indices for x axis.

If you to get the angle from API then please open a thread on forum suggestions section.

 


@hslagter

hslagter
21 May 2021, 18:59

RE: I found it and I won't keep it for myself ;-).

hslagter said:

I am unable to get the Y value of an existing horizontal line. Drawing the line and immediately finding out the Y value is no problem. I want to be able to move a horizontal line and read the new value. I've tried with

Chart.ObjectHoverChanged + = OnChartObjectHoverChanged;

Chart.DragEnd + = OnDragEnd;

Chart.DragStart + = OnChartDragStart;

Chart.ObjectsSelectionChanged + = OnChartObjectsSelectionChanged;

I can get the name, comment, etc., but no Y value. A small example is sufficient.

        ChartHorizontalLine LowerLine;
        ChartHorizontalLine templine;

        protected override void OnStart()
        {
            LowerLine = Chart.DrawHorizontalLine("lowerline", Symbol.Bid, Color.Yellow, AlertLineThick, AlertLineStyle);
            LowerLine.IsInteractive = true;
        }

        protected override void OnTick()
        {
            templine = LowerLine;
            Chart.DrawStaticText("test", templine.Y.ToString("0.00000"), VerticalAlignment.Center, HorizontalAlignment.Center, Color.White);
        }
 


@hslagter