Topics
13 Dec 2021, 18:31
 1147
 3
07 Oct 2021, 11:15
 1
 956
 1
20 Nov 2017, 11:43
 0
 1932
 4
15 Aug 2017, 22:13
 2604
 2
16 May 2017, 14:17
 7417
 23
Replies

andi21
30 May 2017, 11:49

Hi Spotware,

thanks for your reply.

To answer your question: no, i do not use Tasks or Timers.

These problems never occured earlier and i have been backtesting since the last several months. They just occured since last update.


@andi21

andi21
30 May 2017, 11:22

I have further info to my .NET Framework:

It is the version 4.7.02046


@andi21

andi21
29 May 2017, 20:09

Ok, i collected some info from eventlog from 4 crashes:

1.

Origin: .NET Runtime
Event-ID: 1023
Anwendung: cAlgo.exe
Frameworkversion: v4.0.30319
Beschreibung: Der Prozess wurde aufgrund eines internen Fehlers in der .NET-Laufzeit beendet. bei IP 00007FFF41C7C9A0 (00007FFF41C70000) mit Exitcode 80131506.

Origin: Application Error
Event-ID: 1000
Name der fehlerhaften Anwendung: cAlgo.exe, Version: 2.1.65534.35103, Zeitstempel: 0x59257f12
Name des fehlerhaften Moduls: clr.dll, Version: 4.7.2098.0, Zeitstempel: 0x59028c32
Ausnahmecode: 0xc0000005
Fehleroffset: 0x000000000000c9a0
ID des fehlerhaften Prozesses: 0x19e8
Startzeit der fehlerhaften Anwendung: 0x01d2d7af10c5a9af
Pfad der fehlerhaften Anwendung: C:\Users\andil\AppData\Local\Apps\2.0\A52ET0QJ.GQV\99T62NK0.4J2\fxpr..algo_37dabdf737419672_0002.0001_48273facb61e5ec3\cAlgo.exe
Pfad des fehlerhaften Moduls: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll
Berichtskennung: 92aa2179-260b-475a-a237-03b5129f2c85
Vollständiger Name des fehlerhaften Pakets: 
Anwendungs-ID, die relativ zum fehlerhaften Paket ist: 

---------------------------

2.

Origin: .NET Runtime
Event-ID: 1026
Anwendung: cAlgo.exe
Frameworkversion: v4.0.30319
Beschreibung: Der Prozess wurde aufgrund einer unbehandelten Ausnahme beendet.
Ausnahmeinformationen: System.AccessViolationException
   bei PipsRunnerSAndRLib.OrderHandling.CloseAndUpdateSL()
   bei PipsRunnerSAndRLib.OrderHandling.OnTick()
   bei cAlgo.PipsRunnerSAndR.OnTick()
   bei Frontend.CrossDomain.Wrapper.cBot.CBotWrapper.SafeExecute(System.String, System.Action, Boolean)
   bei Frontend.CrossDomain.Wrapper.cBot.CBotWrapper.Tick()
   bei Frontend.CrossDomain.Backtesting.Backtester.Tick(Frontend.CrossDomain.TicksGenerating.Tick)
   bei Frontend.CrossDomain.Backtesting.Backtester.Execute()
   bei Frontend.CrossDomain.Optimization.BacktestingRunner.Backtest(Frontend.CrossDomain.Optimization.BacktesterParameters)
   bei Frontend.CrossDomain.Optimization.Genetic.SinthesisService.Backtest(Frontend.CrossDomain.Optimization.BacktesterParameters)
   bei Frontend.CrossDomain.Optimization.Genetic.SinthesisService+<>c__DisplayClass18_0.<GetActions>b__0()
   bei Frontend.CrossDomain.Optimization.BackgroundWorker.ProcessQueue(System.Object)
   bei System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   bei System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   bei System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
   bei System.Threading.ThreadHelper.ThreadStart(System.Object)

Origin: Application Error
Event-ID: 1000
Name der fehlerhaften Anwendung: cAlgo.exe, Version: 2.1.65534.35103, Zeitstempel: 0x59257f12
Name des fehlerhaften Moduls: unknown, Version: 0.0.0.0, Zeitstempel: 0x00000000
Ausnahmecode: 0xc0000005
Fehleroffset: 0x00007ffee5e4d63b
ID des fehlerhaften Prozesses: 0x2540
Startzeit der fehlerhaften Anwendung: 0x01d2d7aef99c9bb7
Pfad der fehlerhaften Anwendung: C:\Users\andil\AppData\Local\Apps\2.0\A52ET0QJ.GQV\99T62NK0.4J2\fxpr..algo_37dabdf737419672_0002.0001_48273facb61e5ec3\cAlgo.exe
Pfad des fehlerhaften Moduls: unknown
Berichtskennung: 432127ac-7922-455b-b2a2-c7ea8a87b282
Vollständiger Name des fehlerhaften Pakets: 
Anwendungs-ID, die relativ zum fehlerhaften Paket ist: 

---------------------------

3.

Origin: .NET Runtime
Event-ID: 1026
Anwendung: cAlgo.exe
Frameworkversion: v4.0.30319
Beschreibung: Der Prozess wurde aufgrund einer unbehandelten Ausnahme beendet.
Ausnahmeinformationen: System.AccessViolationException
   bei PipsRunnerSAndRLib.OrderHandling.CloseAndUpdateSL()
   bei PipsRunnerSAndRLib.OrderHandling.OnTick()
   bei cAlgo.PipsRunnerSAndR.OnTick()
   bei Frontend.CrossDomain.Wrapper.cBot.CBotWrapper.SafeExecute(System.String, System.Action, Boolean)
   bei Frontend.CrossDomain.Wrapper.cBot.CBotWrapper.Tick()
   bei Frontend.CrossDomain.Backtesting.Backtester.Tick(Frontend.CrossDomain.TicksGenerating.Tick)
   bei Frontend.CrossDomain.Backtesting.Backtester.Execute()
   bei Frontend.CrossDomain.Optimization.BacktestingRunner.Backtest(Frontend.CrossDomain.Optimization.BacktesterParameters)
   bei Frontend.CrossDomain.Optimization.Genetic.SinthesisService.Backtest(Frontend.CrossDomain.Optimization.BacktesterParameters)
   bei Frontend.CrossDomain.Optimization.Genetic.SinthesisService+<>c__DisplayClass18_0.<GetActions>b__0()
   bei Frontend.CrossDomain.Optimization.BackgroundWorker.ProcessQueue(System.Object)
   bei System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   bei System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   bei System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
   bei System.Threading.ThreadHelper.ThreadStart(System.Object)

Origin: Application Error
Event-ID: 1000
Name der fehlerhaften Anwendung: cAlgo.exe, Version: 2.1.65534.35103, Zeitstempel: 0x59257f12
Name des fehlerhaften Moduls: unknown, Version: 0.0.0.0, Zeitstempel: 0x00000000
Ausnahmecode: 0xc0000005
Fehleroffset: 0x00007ffee5e5d65c
ID des fehlerhaften Prozesses: 0xcc8
Startzeit der fehlerhaften Anwendung: 0x01d2d7af2f2af478
Pfad der fehlerhaften Anwendung: C:\Users\andil\AppData\Local\Apps\2.0\A52ET0QJ.GQV\99T62NK0.4J2\fxpr..algo_37dabdf737419672_0002.0001_48273facb61e5ec3\cAlgo.exe
Pfad des fehlerhaften Moduls: unknown
Berichtskennung: 7e9b5e0a-941b-49ba-88b5-1754f16578b3
Vollständiger Name des fehlerhaften Pakets: 
Anwendungs-ID, die relativ zum fehlerhaften Paket ist: 

---------------------------

4.

Origin: .NET Runtime
Event-ID: 1026
Anwendung: cAlgo.exe
Frameworkversion: v4.0.30319
Beschreibung: Der Prozess wurde aufgrund einer unbehandelten Ausnahme beendet.
Ausnahmeinformationen: System.AccessViolationException
   bei PipsRunnerSAndRLib.OrderHandling+<EnumerateHistoryOfSpecificRejectionBackwardsForBuyAndSell>d__63.MoveNext()
   bei System.Collections.Generic.List`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]..ctor(System.Collections.Generic.IEnumerable`1<System.__Canon>)
   bei System.Linq.Enumerable.ToList[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](System.Collections.Generic.IEnumerable`1<System.__Canon>)
   bei PipsRunnerSAndRLib.OrderHandling.OpenPositions()
   bei PipsRunnerSAndRLib.OrderHandling.OnTick()
   bei cAlgo.PipsRunnerSAndR.OnTick()
   bei Frontend.CrossDomain.Wrapper.cBot.CBotWrapper.SafeExecute(System.String, System.Action, Boolean)
   bei Frontend.CrossDomain.Wrapper.cBot.CBotWrapper.Tick()
   bei Frontend.CrossDomain.Backtesting.Backtester.Tick(Frontend.CrossDomain.TicksGenerating.Tick)
   bei Frontend.CrossDomain.Backtesting.Backtester.Execute()
   bei Frontend.CrossDomain.Optimization.BacktestingRunner.Backtest(Frontend.CrossDomain.Optimization.BacktesterParameters)
   bei Frontend.CrossDomain.Optimization.Genetic.SinthesisService.Backtest(Frontend.CrossDomain.Optimization.BacktesterParameters)
   bei Frontend.CrossDomain.Optimization.Genetic.SinthesisService+<>c__DisplayClass18_0.<GetActions>b__0()
   bei Frontend.CrossDomain.Optimization.BackgroundWorker.ProcessQueue(System.Object)
   bei System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   bei System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   bei System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
   bei System.Threading.ThreadHelper.ThreadStart(System.Object)

Origin: Application Error
Event-ID: 1000
Name der fehlerhaften Anwendung: cAlgo.exe, Version: 2.1.65534.35103, Zeitstempel: 0x59257f12
Name des fehlerhaften Moduls: unknown, Version: 0.0.0.0, Zeitstempel: 0x00000000
Ausnahmecode: 0xc0000005
Fehleroffset: 0x000000000ee54da0
ID des fehlerhaften Prozesses: 0x1ad4
Startzeit der fehlerhaften Anwendung: 0x01d2d7aeeaaef9f5
Pfad der fehlerhaften Anwendung: C:\Users\andil\AppData\Local\Apps\2.0\A52ET0QJ.GQV\99T62NK0.4J2\fxpr..algo_37dabdf737419672_0002.0001_48273facb61e5ec3\cAlgo.exe
Pfad des fehlerhaften Moduls: unknown
Berichtskennung: 78725cab-ebd6-46f7-b295-2a26376f156c
Vollständiger Name des fehlerhaften Pakets: 
Anwendungs-ID, die relativ zum fehlerhaften Paket ist: 

 

Hope this helps.


@andi21

andi21
29 May 2017, 19:25 ( Updated at: 21 Dec 2023, 09:20 )

It is this kind of error message (only of course which texts/titles for cAlgo):


@andi21

andi21
24 May 2017, 10:33

@Spotware:

I have a suggestion for this to be implemented the easiest way with the least effort:

just remember / persist the state of an bot-instance-play-button on hard disk. So if a user clicks on play of a bot instance the state "1" for bot-instance X is persisted. If the user clicks on stop of a bot instance the state "0" for bot-instance X is persisted. And if cAlgo starts it looks for the states and if it has states and they are also set to 1, then it just activates the bots.

It is even not necessary to display a message or leave an info about this behaviour, because if somebody starts a bot then he wants to run it until he stops it again - no matter if there was a server crash etc..

Thanks in advance.

Best Regards,

andi21


@andi21

andi21
23 May 2017, 15:26

Is there any Update on this very important feature? Thanks in advance.
@andi21

andi21
19 May 2017, 15:26

RE:

andi21 said:

Hi Spotware,

Yes - and if i set the performance slider in optimization to 100% it uses all cores and runs 16 bots / runs in parallel, shouldn't it be possible / use the full about 6,25% of each bot on each core?

Sorry for the double-post - a 404 error occured after sending the first post and i created a second one, but the first one was also created although an error occured.


@andi21

andi21
19 May 2017, 15:24

Hi Spotware,

Yes - and if i set the performance slider in optimization to 100% it uses all cores and runs 16 bots / runs in parallel, shouldn't it be possible / use the full about 6,25% of each bot on each core?


@andi21

andi21
19 May 2017, 15:21

Hi Spotware,

100% processor utilization can occur only for algogrithms that are fully parallelizable

Yes - and i think that should be the case if i set the performance slider to 100% in optimization and so there are 16 bot instances / runs in parallel running, isn't it?


@andi21

andi21
18 May 2017, 17:06

RE:

andi21 said:

Hi Spotware,

thank you.

I don't know how that can be, but to be sure i compiled and tried another run with your CPUIntensiveBot-Sample. And it is using all cores correctly like before and also it is using 100% now.

But that means the following i think:

- if cBot X has intensive code in OnTick, then 100% can be used (like in the CPUIntensiveBot-Sample with the two nested fors)

- if cBot X has "normal" code (for the cpu), then only 25% are used - but in this case the OnTick-Method from the bot has to be called in a more cpu-Intensive way from cAlgo-Internals, so that the cpu can use 100%, so Trades can be sure their optimization runs in full speed (all cores - which works great through the slider - and also at 100% - which does not work 100% i think).

Seeing forward for your response and thanks.

And furthermore:

- if i use only a fix parameter for the double Parameter for example 0, then only 7 % is used, but that is fine, because only one bot so one core will be instantiated by cAlgo-Optimizer

- if i use a range of for example -0.5 till 1.5 then there are 20 Possiblities, so enough that 16 bot instance can be created to use all cores


@andi21

andi21
18 May 2017, 16:59

Hi Spotware,

thank you.

I don't know how that can be, but to be sure i compiled and tried another run with your CPUIntensiveBot-Sample. And it is using all cores correctly like before and also it is using 100% now.

But that means the following i think:

- if cBot X has intensive code in OnTick, then 100% can be used (like in the CPUIntensiveBot-Sample with the two nested fors)

- if cBot X has "normal" code (for the cpu), then only 25% are used - but in this case the OnTick-Method from the bot has to be called in a more cpu-Intensive way from cAlgo-Internals, so that the cpu can use 100%, so Trades can be sure their optimization runs in full speed (all cores - which works great through the slider - and also at 100% - which does not work 100% i think).

Seeing forward for your response and thanks.


@andi21

andi21
18 May 2017, 16:41

Hi Spotware, yes, that is why all 16 cores are used correctly.
@andi21

andi21
18 May 2017, 16:33

Hi Spotware, i have just tried it. It behaves the same - unfortunately also no more than 25%.
@andi21

andi21
18 May 2017, 16:00

RE:

Spotware said:

Hi andi21,

Can you send us a cBot that we could run and reproduce the problem?

Hi Spotware,

as an example i have used this bot: /algos/cbots/show/3

 

If you have further questions, please don't hesitate to contact me.

Thanks in advance.

Best Regards,

andi21


@andi21

andi21
17 May 2017, 22:54

RE:

kricka said:

It's a very interesting question sent to the Spotware Team. The program utilizes 4 core 100% but only 25% of a 16 core CPU.

I have also made a very simple quick & dirty (could be much better i know, but it is q&d) sample console app to prove the situation:

using System;
using System.Threading.Tasks;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine(Environment.ProcessorCount);

            if (true) // set to false for single core use
            {
                int zzz = Environment.ProcessorCount;
                zzz = 4; // Comment this out to use all processors
                Action[] z = new Action[zzz];
                for (int xx = 0; xx < zzz; xx++)
                {
                    z[xx] = Set;
                }
                Parallel.Invoke(z);
            }
            else
            {
                Set();
            }

            Console.ReadKey();
        }

        private static void Set()
        {
            long x = 5;
            for (long i = 0; i < 12147483647; i++)
            {
                if (x == 4)
                {
                    throw new Exception();
                }
                else
                {
                    x++;
                }
            }
        }
    }
}

The program proved me (like i said in my first post, that it is neither a problem of my bot code, because i also tested another simple sample bot, nor it is a problem of my new pc, because bench of cpu-z also uses 100%), that 100% are possible without any problem:

-> if i use 1 core (if (false)) -> 7% are used (100 % / 16 cores = about 7%)
-> if i use processorcount (comment out the zzz = 4;) -> 100% are used
-> if i use FIX 4 cores (using zzz = 4): 25% are used ((100% / 16 cores) * 4 cores = about 25% -> like in calgo

so everything should be fine, but probably there is a problem in limiting the actual workload (see my post /forum/calgo-support/11535#7).

So all 16 cores are used, but the workload is only limited to 4 so the work of 4 is divided on 16 cores instead of a workload of 16 that is divided on 16 cores.


@andi21

andi21
17 May 2017, 19:45

RE:

andi21 said:

Please, Spotware - have you got any advice for this problem for me?

Is it possible that the work is correctly separated to be processed on each core (that works good), but the actual workload so the passes / bots which run in parallel in optimization is limited to 4 bots / workloads etc.?

Why do i have this idea?

Because on my other pc which has 4 cores it works over all cores and with 100%.

But on my new pc it works also over all 16 cores BUT only with 25% which would be 4 cores / bots / workloads.

Could that be the problem?

Has anyone else encountered this problem on a pc with 8 or 16 or more cores?


@andi21

andi21
17 May 2017, 19:35

Please, Spotware - have you got any advice for this problem for me?


@andi21

andi21
16 May 2017, 17:20

Hi Spotware,

I have just tried one other SampleBot here from Bots-Section - it is the same problem (cpu consumption only at about 25%, but all cores are used correctly). So we can be sure that it does not depend on the code of my bot. It is something out of my scope.

Do you possibly have another idea?


@andi21

andi21
16 May 2017, 14:43

Hi Spotware,

i am refering to optimization (not backtesting - i know that in backtesting it only runs one bot instance and hence one core/main thread), so multiple bots run in parallel.

Like i said all cores are used, so that is fine. But overall it does not consume 100%, but only around 25%.

Hope you can help me with this.

Thanks.


@andi21

andi21
20 Apr 2017, 02:17

RE:

andi21 said:

@Spotware:

Is there any Update on this feature? This is very important, because traders need to rely on the bots that they are running also after a restart.

Thanks in advance.

Here is also a link to the feature:

http://vote.spotware.com/forums/229166-ideas-and-suggestions-for-ctrader-and-calgo/suggestions/5743773-auto-restart-play-run-option-after-shutdown


@andi21