Calgo Bug.

Created at 27 May 2019, 17:16
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!
TradeMingZhi's avatar

TradeMingZhi

Joined 05.02.2019

Calgo Bug.
27 May 2019, 17:16


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

namespace cAlgo.Robots
{
    [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class NewcBot : Robot
    {
        [Parameter("Variable Test", DefaultValue = 0.8, MinValue = -4.8, MaxValue = 1.6, Step = 0.2)]
        public double VariableTest { get; set; }

        public double BlankVar;

        protected override void OnStart()
        {
        // VariableTest Changes its value when it shouldn't
            BlankVar = Math.Exp(VariableTest);
            Stop();
            
        }

        protected override void OnTick()
        {
            // Put your core logic here
        }

        protected override void OnStop()
        {
            // Put your deinitialization logic here
        }
    }
}

Can someone explain how and why its assigning that value?


@TradeMingZhi
Replies

TradeMingZhi
27 May 2019, 17:49

This tilted me for good 2-3 hours now im almost certain its not my fault.

Try running that optimisation, and some parameters will have -0.0000000001 for no reason

I can't declare parameters readonly, also using static does not help.


@TradeMingZhi

TradeMingZhi
27 May 2019, 17:51

.


@TradeMingZhi

PanagiotisCharalampous
27 May 2019, 17:52

Hi wisegprs,

We will check this but it seems to be just a rounding issue. I don't think it will affect your results.

Best Regards,

Panagiotis


@PanagiotisCharalampous

TradeMingZhi
27 May 2019, 17:54

RE:

Panagiotis Charalampous said:

Hi wisegprs,

We will check this but it seems to be just a rounding issue. I don't think it will affect your results.

Best Regards,

Panagiotis

Yeah I can run that fine, just minor inconvienece for saving parameters also I like to have things perfect =)


@TradeMingZhi

TradeMingZhi
28 May 2019, 16:00

RE:

Panagiotis Charalampous said:

Hi wisegprs,

We will check this but it seems to be just a rounding issue. I don't think it will affect your results.

Best Regards,

Panagiotis

So was It my fault?


@TradeMingZhi