CPU usage

Created at 22 Aug 2014, 18:05
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!
RK

rkokerti

Joined 28.06.2012

CPU usage
22 Aug 2014, 18:05


Hi All,

Are you not experienced CPU usage problem nowadays? cAlgo use unusually large CPU on my computer, but I didn't change anything.

Thanks


@rkokerti
Replies

Spotware
25 Aug 2014, 10:25

We optimized the CPU usage in cAlgo version 1.24. Can you reproduce this issue using Spotware cAlgo? 


@Spotware

rkokerti
25 Aug 2014, 12:01 ( Updated at: 21 Dec 2023, 09:20 )

I tested (ver.1.24.102 / ver. 1.23.22) with the absolute same setup (24 instances, same indicators).

You can see the result below. I think, the new version will solve my CPU issue.

Thanks for your help!

 


@rkokerti

rkokerti
25 Aug 2014, 12:35

Two other question. What is less memory / CPU consumig?

1,

    if(criterias)
    {
        XY[index] =  MarketSeries.Close[index];
    }
    else
    {
        XY[index] = double.NaN;    
    }

or

    RefreshData()
    if(criterias)
    {
        XY[index] = MarketSeries.Close[index];
    }

2,

    if(criterias)
    {
        XY[index] =  MarketSeries.Close[index];
    }
    else
    {
        XY[index] = double.NaN;    
    }

or

    if(criterias)
    {
        ChartObjects.DrawText("XY"+index.ToString(),"XY",index,MarketSeries.Close[index],VerticalAlignment.Center,HorizontalAlignment.Center,Colors.Yellow);
    }
    else
    {
        ChartObjects.RemoveObject("XY"+index.ToString());
    }

Thanks in advance!


@rkokerti

Spotware
25 Aug 2014, 14:48

RE:

rkokerti said:

Two other question. What is less memory / CPU consumig?

1,

    if(criterias)
    {
        XY[index] =  MarketSeries.Close[index];
    }
    else
    {
        XY[index] = double.NaN;    
    }

or

    RefreshData()
    if(criterias)
    {
        XY[index] = MarketSeries.Close[index];
    }

2,

    if(criterias)
    {
        XY[index] =  MarketSeries.Close[index];
    }
    else
    {
        XY[index] = double.NaN;    
    }

or

    if(criterias)
    {
        ChartObjects.DrawText("XY"+index.ToString(),"XY",index,MarketSeries.Close[index],VerticalAlignment.Center,HorizontalAlignment.Center,Colors.Yellow);
    }
    else
    {
        ChartObjects.RemoveObject("XY"+index.ToString());
    }

Thanks in advance!

Unfortunately, we don't have such information.


@Spotware

rkokerti
25 Aug 2014, 17:22

I'm sorry, but not you are the developer of cAlgo?

Who can tell me, what is the best solution for Indicator optimization?


@rkokerti

Spotware
25 Aug 2014, 17:50

RE:

rkokerti said:

I'm sorry, but not you are the developer of cAlgo?

Who can tell me, what is the best solution for Indicator optimization?

All above examples should not cause high CPU loading. We can recommend you to profile your indicator using performance profilers.


@Spotware

rkokerti
27 Aug 2014, 17:41 ( Updated at: 21 Dec 2023, 09:20 )

Today I received and install the new version of cAlgo. The ver. Nr. is 1.24.102 for both cAlgo software. 

The CPU usage now worse than previously. FxPro use 6 times more CPU than Spotware cAlgo with same setup.

Please help me, because FxPro cAlgo crashes!

 

 


@rkokerti

Balena
27 Aug 2014, 18:53

I'm having the same issue after installing the new update... something is not right for sure


@Balena

Balena
28 Aug 2014, 06:31

I'm also using FxPro...  seeing smae problems as rkokerti


@Balena

Spotware
28 Aug 2014, 11:04

Dear Traders,

Do you still observe the issue?


@Spotware

rkokerti
28 Aug 2014, 11:30 ( Updated at: 21 Dec 2023, 09:20 )

This is my new measurement result. I received a new update or bugfix last night...


@rkokerti

rkokerti
28 Aug 2014, 12:04 ( Updated at: 21 Dec 2023, 09:20 )

...and sometimes this happens. Crashes :(


@rkokerti

Balena
28 Aug 2014, 21:54

yes, still seeing increased usage...


@Balena

rkokerti
29 Aug 2014, 16:58 ( Updated at: 21 Dec 2023, 09:20 )

Please do something with cAlgo, always crashes...


@rkokerti

Spotware
29 Aug 2014, 17:05 ( Updated at: 21 Dec 2023, 09:20 )

RE:

rkokerti said:

Please do something with cAlgo, always crashes...

If it is possible, please send code of your cBot to engage@spotware.com. We will use it for troubleshooting purposes only.


@Spotware

rkokerti
29 Aug 2014, 17:20

I just use Custom Indicators...  but they have worked well so far. In any case, I send to.

 


@rkokerti

Balena
02 Sep 2014, 22:15

Any word on this? 


@Balena

Spotware
03 Sep 2014, 11:52

We plan to optimize CPU usage in next release.


@Spotware

rkokerti
03 Sep 2014, 12:59

What is the expected release date? Because very cumbersome to use the software now.


@rkokerti

rkokerti
03 Sep 2014, 14:43

RE:

rkokerti said:

What is the expected release date? Because very cumbersome to use the software now.

I have a question in this connection. Why Spotware working properly while FxPro not? Same version number, same setup, but working differently. Can not be that, the problem is at on the broker side?


@rkokerti

AlexanderRC
03 Sep 2014, 16:05 ( Updated at: 21 Dec 2023, 09:20 )

RE: RE:

rkokerti said:

rkokerti said:

What is the expected release date? Because very cumbersome to use the software now.

I have a question in this connection. Why Spotware working properly while FxPro not? Same version number, same setup, but working differently. Can not be that, the problem is at on the broker side?

Check digital signature on cTrader.exe/cAlgo.exe and look for its date. The version may be the same but the actual builds may be different. To find the actual .exe you are executing, use the Image Path Name in Windows Task Manager or Open File Location context menu command for the process.


@AlexanderRC

Spotware
03 Sep 2014, 17:00

Our tests show that there is no any significant difference between CPU consumption in cAlgo 1.23 and latest cAlgo 1.24. Probably performance issues that you observe do not relate to the latest update.

We deployed latest version to all our brokers. Different CPU consumption for different brokers could be caused because of different price feeds. For example, if broker provides ticks more frequently your indicators and cBots will require more CPU resources to handle all incoming ticks.


@Spotware

Balena
03 Sep 2014, 23:06

RE:

tSpotware said:

Our tests show that there is no any significant difference between CPU consumption in cAlgo 1.23 and latest cAlgo 1.24. Probably performance issues that you observe do not relate to the latest update.

We deployed latest version to all our brokers. Different CPU consumption for different brokers could be caused because of different price feeds. For example, if broker provides ticks more frequently your indicators and cBots will require more CPU resources to handle all incoming ticks.

there is a problem for sure... it's not the bots... i see same cpu issue running 1hr as I do running 1 tick


@Balena

rkokerti
04 Sep 2014, 15:19

Gentlemen!

I'm sorry to say this, but I'm a trader (user) here and now. I don't know what is the reason that I can not use cAlgo as intended.

Please do something to cAlgo working properly. A few minutes ago, when European Central Bank published Minimum Bid Rate, and therefore volatility sharp increased in the market, the cAlgo was absolutely useless.

So, Please do something!

 


@rkokerti

rkokerti
08 Sep 2014, 20:21 ( Updated at: 21 Dec 2023, 09:20 )

Any update on this?

 


@rkokerti

rkokerti
09 Sep 2014, 12:43

Dear Developers,

I continued the analysis of my indicator, to find the reason of huge CPU consumption.

I think I found the reason. If I remove the attached part of the code, then CPU consumption greatly reduced. 

    ATRValue = Math.Round(atr.Result[index] *10000 *(Symbol.PipValue / Symbol.PipSize));
    PosPerc = Math.Round((ATRValue / Account.Equity *100),1);
    ChartObjects.DrawText("ATR",ATRValue.ToString() + " $" + "=" + PosPerc.ToString() + " %",index+2,MarketSeries.Close[index],VerticalAlignment.Center,HorizontalAlignment.Right,Colors.MediumSpringGreen);

Unfortunately, I need this code snippet, because this is the part of my Risk Management. 

Another observation is that if there is no open position then CPU consumption low, otherwise very high.

There is something proposal how to solve this problem?

 

 


@rkokerti

Spotware
09 Sep 2014, 14:15

RE:

rkokerti said:

Dear Developers,

I continued the analysis of my indicator, to find the reason of huge CPU consumption.

I think I found the reason. If I remove the attached part of the code, then CPU consumption greatly reduced. 

    ATRValue = Math.Round(atr.Result[index] *10000 *(Symbol.PipValue / Symbol.PipSize));
    PosPerc = Math.Round((ATRValue / Account.Equity *100),1);
    ChartObjects.DrawText("ATR",ATRValue.ToString() + " $" + "=" + PosPerc.ToString() + " %",index+2,MarketSeries.Close[index],VerticalAlignment.Center,HorizontalAlignment.Right,Colors.MediumSpringGreen);

Unfortunately, I need this code snippet, because this is the part of my Risk Management. 

Another observation is that if there is no open position then CPU consumption low, otherwise very high.

There is something proposal how to solve this problem?

 

 

Instead of calculating those values on every tick (in OnCalculate method) we can recommend you to use OnTimer event. You put this code to OnTimer handler and try to adjust the timer interval.


@Spotware

rkokerti
09 Sep 2014, 15:13

It doesn't help.... :(

    protected override void Initialize()
    {
    atr = Indicators.AverageTrueRange(5,MovingAverageType.Exponential);

    Timer.Start(5);        
    }
//----------------------------------------------------------------- 
    protected override void OnTimer()
    {
    int index = MarketSeries.Close.Count-1;    
    
//    ATRValue = Math.Round(atr.Result[index] *10000 *(Symbol.PipValue / Symbol.PipSize));
//    PosPerc = Math.Round((ATRValue / Account.Equity *100),1);
//    ChartObjects.DrawText("ATR",ATRValue.ToString() + " $" + "=" + PosPerc.ToString() + " %",index+2,MarketSeries.Close[index],VerticalAlignment.Center,HorizontalAlignment.Right,Colors.MediumSpringGreen);
    }

 


@rkokerti

rkokerti
09 Sep 2014, 15:15

RE:

rkokerti said:

It doesn't help.... :(

    protected override void Initialize()
    {
    atr = Indicators.AverageTrueRange(5,MovingAverageType.Exponential);

    Timer.Start(5);        
    }
//----------------------------------------------------------------- 
    protected override void OnTimer()
    {
    int index = MarketSeries.Close.Count-1;    
    
    ATRValue = Math.Round(atr.Result[index] *10000 *(Symbol.PipValue / Symbol.PipSize));
    PosPerc = Math.Round((ATRValue / Account.Equity *100),1);
    ChartObjects.DrawText("ATR",ATRValue.ToString() + " $" + "=" + PosPerc.ToString() + " %",index+2,MarketSeries.Close[index],VerticalAlignment.Center,HorizontalAlignment.Right,Colors.MediumSpringGreen);
    }

 

 


@rkokerti

... Deleted by UFO ...