Topics

Forum Topics not found

Replies

TzvetomirTerziysky
21 Feb 2020, 14:37

RE: RE: RE: New API 3.7: Backtest and Optimization are working OK.

@asencanada

Hi Asen thank you for the offer. I am constantly developing and improving my strategy and I will be interested to look at it. Can you please send the code to tt2002@abv.bg ?

I would be glad to share some of my trend ones if you are interested.


@TzvetomirTerziysky

TzvetomirTerziysky
19 Feb 2020, 16:45

RE: New API 3.7: Backtest and Optimization are working OK.

mparama said:

Dear Panagiotis,

I have tested BackTest  in Beta and it seems working even faster then version 3.6.

I have tested as well the optimization with MultiTimeframe and everything seems working OK.

Thank you very much to you and all the staff of Spotware for the efforts to give us always a better service.

 

Regards

Can you please share how you define the MultiTime frame?

My Bars are empty in Optimisation if they are different time frame( and throw Null Exception), while the work perfectly fine under BackTesting


@TzvetomirTerziysky

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

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

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

TzvetomirTerziysky
17 Feb 2020, 11:15

RE:

Are using Multi Time Frames? Optimisation is crashing on it:

 


@TzvetomirTerziysky

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

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

TzvetomirTerziysky
08 Feb 2020, 09:14

MultiFrame is crashing the Optimisation in 3.7 even though continues to work in backtesting.

@Panagiotis Charalampous Any ideas when this is going to be fixed.?

Or at least any workaround?

P.S.I have raised that issue on 05.02.2020


@TzvetomirTerziysky

TzvetomirTerziysky
06 Feb 2020, 19:04 ( Updated at: 21 Dec 2023, 09:21 )

RE:

Nobody said:

Hello,

when i run my cbot on backtest or live there is no problem, all run fine.

 

But when i run it on optimization, tests passes but there is no result found as shown on picture below...how is it possible ?

 

I have raised that yesterday: 

The issue will appear at least when one uses multi timeframe. I am waiting for an update

 


@TzvetomirTerziysky

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

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