How do I restart optimization?

Created at 05 Feb 2020, 12:18
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!
VI

victor.major

Joined 20.11.2019

How do I restart optimization?
05 Feb 2020, 12:18


cTrader updated itself to 3.7, but I had optimization running on 3.6. When it restarted optimization insists on resuming (as it should) but all the previously tested 574 runs show zero values and the optimizer does not progress. I am happy to restart the optimization instead of resume, but there does not seem to be a way to do that.

How do I clear the old data and start again?

 

V.


@victor.major
Replies

PanagiotisCharalampous
05 Feb 2020, 12:40

Hi Victor,

Can you post some screenshots as well for us to understand the issue?

Best Regards,

Panagiotis 

Join us on Telegram

 


@PanagiotisCharalampous

victor.major
05 Feb 2020, 14:19

RE:

Hi thank you for the reply.

 

This is what I see and cannot unsee - there is no way for me to restart or resume the optimization process:

 

 

PanagiotisCharalampous said:

Hi Victor,

Can you post some screenshots as well for us to understand the issue?

Best Regards,

Panagiotis 

Join us on Telegram

 

 


@victor.major

PanagiotisCharalampous
05 Feb 2020, 14:28

Hi Victor,

The optimization seems to have finished. What happens if you press the play button again? Did you check if there is an issue with the cBot? Did you try restarting cTrader? Can you share the cBot code?

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

victor.major
05 Feb 2020, 14:39 ( Updated at: 21 Dec 2023, 09:21 )

RE: RE:

1. Optimization may have indeed finished. The parameters are different across different runs, however I have no way of seeing which parameters are optimal as all the results are zeroed.

2. When I press "play" the optimizer quickly goes through the sequence of run numbers and stops at 574 and shows the screen above.

3. cBot runs well and two optimisations completed successfuly on 3.6

4. I restarted cTrader, once automatically during update, once manually. I also removed the cBot instance and assigned it again. No change.

5. cBot is closed source.

My guess is that this is some kind of cache issue. Can I manually scrub the optimizer cache and start again?

 

V.

 

victor.major said:

Hi thank you for the reply.

 

This is what I see and cannot unsee - there is no way for me to restart or resume the optimization process:

 

 

PanagiotisCharalampous said:

Hi Victor,

Can you post some screenshots as well for us to understand the issue?

Best Regards,

Panagiotis 

Join us on Telegram

 

 

 


@victor.major

TzvetomirTerziysky
05 Feb 2020, 16:11

RE:

The Optimisation is crashing even though exactly the same cBot works in Backtesting. For me the issue is in the time frame e.g. when I remove the timeframe description from the description of the indicator, Optimisation starts working e.g.

the code lines (in protected override void OnStart()) are:
            Bars M15 = MarketData.GetBars(TimeFrame.Minute15);
           _abd = Indicators.GetIndicator<abd>(M15, abd_Period, abd_Signal);

If I remove M15, the Optimisation starts working.


@TzvetomirTerziysky

PanagiotisCharalampous
05 Feb 2020, 16:13 ( Updated at: 21 Dec 2023, 09:21 )

RE: RE: RE:

victor.major said:

1. Optimization may have indeed finished. The parameters are different across different runs, however I have no way of seeing which parameters are optimal as all the results are zeroed.

2. When I press "play" the optimizer quickly goes through the sequence of run numbers and stops at 574 and shows the screen above.

3. cBot runs well and two optimisations completed successfuly on 3.6

4. I restarted cTrader, once automatically during update, once manually. I also removed the cBot instance and assigned it again. No change.

5. cBot is closed source.

My guess is that this is some kind of cache issue. Can I manually scrub the optimizer cache and start again?

 

V.

 

victor.major said:

Hi thank you for the reply.

 

This is what I see and cannot unsee - there is no way for me to restart or resume the optimization process:

 

 

PanagiotisCharalampous said:

Hi Victor,

Can you post some screenshots as well for us to understand the issue?

Best Regards,

Panagiotis 

Join us on Telegram

 

 

 

This is probably an issue with the cBot's code. Can you post the source code?

Best Regards,

Panagiotis 

Join us on Telegram

 

 


@PanagiotisCharalampous

PanagiotisCharalampous
05 Feb 2020, 16:14

RE: RE:

TzvetomirTerziysky said:

The Optimisation is crashing even though exactly the same cBot works in Backtesting. For me the issue is in the time frame e.g. when I remove the timeframe description from the description of the indicator, Optimisation starts working e.g.

the code lines (in protected override void OnStart()) are:
            Bars M15 = MarketData.GetBars(TimeFrame.Minute15);
           _abd = Indicators.GetIndicator<abd>(M15, abd_Period, abd_Signal);

If I remove M15, the Optimisation starts working.

 

Hi TzvetomirTerziysky,

Can you post the complete cBot code? 

Best Regards,

Panagiotis 

Join us on Telegram

 


@PanagiotisCharalampous

TzvetomirTerziysky
05 Feb 2020, 21:45

RE: RE: RE:

Run it under BackTesting and it works on 5min timeframe

Run it under Optimisation and it crashes with 

Crashed in OnStart with NullReferenceException: Object reference not set to an instance of an object.

using System;
using System.Linq;
using cAlgo.API;
using cAlgo.API.Indicators;
using cAlgo.API.Internals;
using cAlgo.Indicators;
using System.Diagnostics;
using System.IO;
using System.Resources;
using System.Threading.Tasks;
using System.Runtime.CompilerServices;

namespace cAlgo
{
    [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.FullAccess)]
    public class Dell_abd : Robot
    {

        private AverageTrueRange averageTrueRange;
        [Parameter(DefaultValue = 14)]
        public int Periods { get; set; }
        [Parameter(DefaultValue = 0.002)]
        public double ATRValue { get; set; }
        [Parameter("MA Type", DefaultValue = MovingAverageType.Exponential)]
        public MovingAverageType MAType { get; set; }

        public Bars M30;

        protected override void OnStart()
        {

            Bars M30 = MarketData.GetBars(TimeFrame.Minute30);

            ///testing Print("The current symbol has pip size of: {0}", Symbol.PipSize);

            averageTrueRange = null;
            averageTrueRange = Indicators.AverageTrueRange(M30, Periods, MAType);

            Print("The current symbol has pip size of: {0}", Symbol.PipSize);
        }
        protected override void OnBar()
        {

            if (averageTrueRange.Result.LastValue >= ATRValue)
            {
                Print("It works now");
            }
        }
    }
}
 


@TzvetomirTerziysky

victor.major
06 Feb 2020, 13:10 ( Updated at: 21 Dec 2023, 09:21 )

RE: RE: RE: RE:

The cBot is closed source so I cannot post the code.

Nevertheless the bug has been replicated by the cBot developer and I was informed that the error is with the cTrader. When will you be releasing an update? I am keen to resume my optimisations.

 

V.

 

PanagiotisCharalampous said:

victor.major said:

1. Optimization may have indeed finished. The parameters are different across different runs, however I have no way of seeing which parameters are optimal as all the results are zeroed.

2. When I press "play" the optimizer quickly goes through the sequence of run numbers and stops at 574 and shows the screen above.

3. cBot runs well and two optimisations completed successfuly on 3.6

4. I restarted cTrader, once automatically during update, once manually. I also removed the cBot instance and assigned it again. No change.

5. cBot is closed source.

My guess is that this is some kind of cache issue. Can I manually scrub the optimizer cache and start again?

 

V.

 

victor.major said:

Hi thank you for the reply.

 

This is what I see and cannot unsee - there is no way for me to restart or resume the optimization process:

 

 

PanagiotisCharalampous said:

Hi Victor,

Can you post some screenshots as well for us to understand the issue?

Best Regards,

Panagiotis 

Join us on Telegram

 

 

 

This is probably an issue with the cBot's code. Can you post the source code?

Best Regards,

Panagiotis 

Join us on Telegram

 

 

 


@victor.major

TzvetomirTerziysky
12 Feb 2020, 17:22

RE: It is still wildly crashing on the Multi-frame issue with NullRefferenceException on StartUp

PanagiotisCharalampous 

I have seen in other posts that you have provided a HotFix.

And I have tested it...

Apparently, it does NOT work on Optimisation with a multi-time frame cbot or at least does not work for me and my cBot is still crashing with the same message:

Crashed in OnStart with NullReferenceException: Object reference not set to an instance of an object.


@TzvetomirTerziysky

PanagiotisCharalampous
13 Feb 2020, 08:19

Hi TzvetomirTerziysky,

I tried the source code you provided in this thread and seems to be working fine. Can you please confirm that you are using Spotware cTrader Beta? If yes, can you please provide the source code that causes the problem?

Best Regards,

Panagiotis 

Join us on Telegram

 


@PanagiotisCharalampous

TzvetomirTerziysky
13 Feb 2020, 17:54 ( Updated at: 21 Dec 2023, 09:21 )

Error swept under the carpet in Beta Optimisation

Hi Panagiotis,

The provided code is throwing Null Exceptions on the Broker Software and surprisingly it does not run as expected even though it does not show the error in the Beta Optimisation

In order to make it more presentable, I have added a small trading action and run it on the Public Beta 3.7. freshly installed:

using System;
using System.Linq;
using cAlgo.API;
using cAlgo.API.Indicators;
using cAlgo.API.Internals;
using cAlgo.Indicators;
using System.Diagnostics;
using System.IO;
using System.Resources;
using System.Threading.Tasks;
using System.Runtime.CompilerServices;

namespace cAlgo
{
    [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.FullAccess)]
    public class Dell_abd : Robot
    {

        private AverageTrueRange averageTrueRange;
        [Parameter(DefaultValue = 14)]
        public int Periods { get; set; }
        [Parameter(DefaultValue = 0.002)]
        public double ATRValue { get; set; }
        [Parameter("MA Type", DefaultValue = MovingAverageType.Exponential)]
        public MovingAverageType MAType { get; set; }

        public Bars M30;

        protected override void OnStart()
        {

            Bars M30 = MarketData.GetBars(TimeFrame.Minute30);

            ///testing Print("The current symbol has pip size of: {0}", Symbol.PipSize);

            averageTrueRange = null;
            averageTrueRange = Indicators.AverageTrueRange(M30, Periods, MAType);

            Print("The current symbol has pip size of: {0}", Symbol.PipSize);
        }
        protected override void OnBar()
        {

            if (averageTrueRange.Result.LastValue >= ATRValue)
            {
                Print("It works now");
                ExecuteMarketOrder(TradeType.Buy, SymbolName, 1000, "cBot", 100, 3);
            }
        }
    }
}

If I run it in BackTesting I am getting some action (executed Market Orders):

But  if I run it in Optimisation with the same parameters, I do not get any results at all:

All Back Testing and Optimisation are done on Tick Data from the Server.

It is like you swept the error message under the carpet and pretend it does not exist...

But that does not solve the problem - multi time frames cBOTs are still not working in Optimisation, while they continue to work in BackTesting

 


@TzvetomirTerziysky

PanagiotisCharalampous
17 Feb 2020, 12:13

Hi TzvetomirTerziysky,

We put nothing under the carpet. This was never working in optimization. It was just not throwing an exception in v3.6. We restored this functionality in v3.7.

Best Regards,

Panagiotis 

Join us on Telegram

 


@PanagiotisCharalampous

TzvetomirTerziysky
17 Feb 2020, 13:06

RE:

PanagiotisCharalampous 

1. The above code works in BackTesting on broker's Softaware ,does NOT work in Optimisation AND trows an Null exception error!

2. The same code works in Backtesting on the Beta 3.7, does NOT work in Optimisation AND does NOT throw any error messages at all. Just quietly does nothing...

Regardless of how I (or you) qualify this, Multi Frame code do NOT currently work in Optimisation and that is a issue for me, which I expect you to fix as soon as possible or provide a workaround.

 


@TzvetomirTerziysky

PanagiotisCharalampous
17 Feb 2020, 14:00

Hi TzvetomirTerziysky,

As explained above the exception was added in 3.7. After receiving a lot of complaints from users, we have reverted to how it was working in v3.6. It was never working in optimization.

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

TzvetomirTerziysky
17 Feb 2020, 14:39

RE:

The above code used to work under Optimisation. I have done countless optimisations on these multi tme frame cbots. Now this does not work any more.

If you claim you reverted it to the previous state then it must start working again. 

But it doesn't. You will need to fix or really revert... 


@TzvetomirTerziysky

PanagiotisCharalampous
17 Feb 2020, 15:16

Hi TzvetomirTerziysky,

I will raise this issue to the development team to check again.

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

TzvetomirTerziysky
17 Feb 2020, 15:23

Thank you Panagiotis, 

All my strategies are multi time frame and optimision is crucial for them. 

Regards Tzvetomir 


@TzvetomirTerziysky

florent.herb
14 Mar 2022, 14:08

RE:

TzvetomirTerziysky said:

Thank you Panagiotis, 

All my strategies are multi time frame and optimision is crucial for them. 

Regards Tzvetomir 

Hi,

 

Has the issue been solved since then? I am encountering a similar issue.

 

Best Rgards to all :)

Florent


@florent.herb

PanagiotisCharalampous
14 Mar 2022, 14:45

Hi Florent,

This issue will be fixed in v4.2 of cTrader Desktop.

Best Regards,

Panagiotis 

Join us on Telegram and Facebook


@PanagiotisCharalampous

florent.herb
14 Mar 2022, 14:49

RE:

PanagiotisCharalampous said:

Hi Florent,

This issue will be fixed in v4.2 of cTrader Desktop.

Best Regards,

Panagiotis 

Join us on Telegram and Facebook

hi,

 

Thank you for your fast response. Do you have an idea on when it would be released? Thank you.


@florent.herb

florent.herb
14 Mar 2022, 14:57

RE: RE:

florent.herb said:

PanagiotisCharalampous said:

Hi Florent,

This issue will be fixed in v4.2 of cTrader Desktop.

Best Regards,

Panagiotis 

Join us on Telegram and Facebook

hi,

 

Thank you for your fast response. Do you have an idea on when it would be released? Thank you.

And also what is the issue? Is it multi frame optimisation ?


@florent.herb

PanagiotisCharalampous
14 Mar 2022, 15:03

Hi Florent,

We do not have at ETA but we are at the final stages of testing. The problem is with retrieving multitimeframe data during optimization.

Best Regards,

Panagiotis 

Join us on Telegram and Facebook


@PanagiotisCharalampous

florent.herb
14 Mar 2022, 15:04

RE:

PanagiotisCharalampous said:

Hi Florent,

We do not have at ETA but we are at the final stages of testing. The problem is with retrieving multitimeframe data during optimization.

Best Regards,

Panagiotis 

Join us on Telegram and Facebook

Thank you.


@florent.herb

florent.herb
14 Mar 2022, 15:08

RE: RE:

florent.herb said:

PanagiotisCharalampous said:

Hi Florent,

We do not have at ETA but we are at the final stages of testing. The problem is with retrieving multitimeframe data during optimization.

Best Regards,

Panagiotis 

Join us on Telegram and Facebook

Thank you.

I understand you don't have an ETA but are we dealing in weeks, months? During 2022 or the year after? If you have a (very) general idea let me (us) know. Keep up ;)

Best Regards


@florent.herb

PanagiotisCharalampous
14 Mar 2022, 15:41

Hi Florent,

The plan is to release it on Spotware Beta during the following weeks.

Best Regards,

Panagiotis 

Join us on Telegram and Facebook


@PanagiotisCharalampous

florent.herb
14 Mar 2022, 15:43

RE:

PanagiotisCharalampous said:

Hi Florent,

The plan is to release it on Spotware Beta during the following weeks.

Best Regards,

Panagiotis 

Join us on Telegram and Facebook

Thank you


@florent.herb

khaneki239
07 Jul 2022, 11:31 ( Updated at: 10 Jul 2022, 22:13 )

RE: RE:

I tried the source code you provided in this thread and seems to be working fine. Can you please confirm that you are using Spotware cTrader Beta? If yes, can you please provide the source code that causes the problem?

mobdro download
 

  get-vidmateapp.com


@khaneki239