How to get Historical data for backtesting

Created at 16 Aug 2018, 16:42
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!
CT

ctid386599

Joined 26.03.2018

How to get Historical data for backtesting
16 Aug 2018, 16:42


Hi,

Im back testing my custom renko however i would like that if im backtesting say between 5/5/2018- 5/8/2018, then I would like to use data from say 5/4/2018, one month in advance to create renko.

 

thank you


@ctid386599
Replies

PanagiotisCharalampous
16 Aug 2018, 16:50

Hi ctid386599,

It is not clear to us what do you need.

  1. What is custom renko? A cBot or an indicator? Can you post the code?
  2. Why do you need data from earlier periods and how are these data related to the cBot/Indicator?  

If you give us some more information on what you are trying to do then we might be able to help you.

Best Regards,

Panagiotis


@PanagiotisCharalampous

ctid386599
16 Aug 2018, 21:43

RE:

Hi Panagiotis,

I have  renko indicator  and a cbot  gets the renko  blocks.
If i want to run my bot between a given  time interval, the blocks are formed between that time interval.
it means at time =0, there is no brick yet. I would like to have bricks from  say 1 month earlier
 

 


@ctid386599

PanagiotisCharalampous
17 Aug 2018, 09:40

Hi ctid386599,

Data for indicators is loaded for periods before the backtesting starts therefore you should not worry about this. You should havemany bricks created on starting your cBot. See example below.

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

namespace cAlgo.Robots
{
    [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class NewcBot : Robot
    {
        private Renko _renko;

        protected override void OnStart()
        {
            _renko = Indicators.GetIndicator<Renko>(10, 100, 3, "SeaGreen", "Tomato");
            Print(_renko.Close.Count);
        }
        protected override void OnBar()
        {       
         
        }
        protected override void OnStop()
        {
            // Put your deinitialization logic here
        }
    }
}

Best Regards,

Panagiotis


@PanagiotisCharalampous