What is the max size of the backtest log and can it be increased?

Created at 29 Oct 2018, 00:30
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!
lec0456's avatar

lec0456

Joined 14.11.2012

What is the max size of the backtest log and can it be increased?
29 Oct 2018, 00:30


What is the max size of the backtest log and can it be increased?


@lec0456
Replies

PanagiotisCharalampous
29 Oct 2018, 11:34

Hi lec0456,

The limit is ten thousand rows. If you need more, you can consider using a custom file and log your information there.

Best Regards,

Panagiotis


@PanagiotisCharalampous

lec0456
29 Oct 2018, 13:37

how can I output the log to a file? Do you have an example?


@lec0456

... Deleted by UFO ...

PanagiotisCharalampous
29 Oct 2018, 14:07

Hi lec0456,

Note that I am referring to replacing the Print function and writing to a text file instead. See below an example

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

namespace cAlgo.Robots
{
    [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.FileSystem)]
    public class NewcBot : Robot
    {
        private string fiName;
        private StreamWriter _fileWriter;
        protected override void OnStart()
        {
            _fileWriter = new StreamWriter("c:\\Users\\pcharalampous.CTRADER\\Documents\\log.txt");
            // Put your initialization logic here
        }

        protected override void OnTick()
        {
            _fileWriter.WriteLine(Symbol.Bid);
        }

        protected override void OnStop()
        {
            _fileWriter.Close();
        }
    }
}

 

Best Regards,

Panagiotis


@PanagiotisCharalampous