PanagiotisCharalampous's avatar
PanagiotisCharalampous
26 follower(s) 0 following 1006 subscription(s)
Replies

PanagiotisCharalampous
23 Apr 2024, 06:14

Hi there,

Here is the privacy policy you agree to when you decide to create a cTrader ID and a cTrader account.

https://www.spotware.com/privacy-policy

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
23 Apr 2024, 06:09

Hi there,

Symbols are offered by brokers. Please talk to your broker regarding this matter.

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
23 Apr 2024, 06:05

RE: RE: RE: RE: RE: Backtesting on Multi Timeframe

sebastien.t said: 

Hi Panagiotis,

I tried to use your workaround but it doesn't really work for 2 reasons :

1/ if I want to backtest the bot that I use on Live market I can't change a lot of code and so I have to keep using the same functions. It seems that even if the history date are loaded (I can see see it if I check the date with Bars[0]), I can't recall that data with the MarketData.GetBars

2/ To run the Backtest I have to choose 1 timeframe (let s say H1) but in my bot I need check the historical data of the H4 and the Daily. And so even if I start the backtest to beofre my “real” backtesting date to load the data, it loads only the data for H1 and not for H4/Daily.

Here is my code

 

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using cAlgo.API;

using cAlgo.API.Collections;

using cAlgo.API.Indicators;

using cAlgo.API.Internals;


 

namespace cAlgo.Robots

{

[Robot(AccessRights = AccessRights.None)]

public class EasyHistoLoad : Robot

{

 

[Parameter("Backtest On/Off", Group = "BackTest", DefaultValue = false)]

public bool BackTest { get; set; }


 

[Parameter("Backtest Date", Group = "BackTest", DefaultValue = "2024/03/01 01:00:00")]

public string BackTestDate { get; set; }


 

protected override void OnStart()

{

// To learn more about cTrader Automate visit our Help Center:

// https://help.ctrader.com/ctrader-automate


 

// Print(Bars.Count());

DateTime time_to_test = Bars[Bars.Count()-5].OpenTime.AddDays(-15);

// Print(time_to_test);

// Get m1 Bars

 

if(BackTest && Bars.Last().OpenTime>DateTime.Parse(BackTestDate)){


 

Bars _OfTimeFrameBars = MarketData.GetBars(TimeFrame.Minute, SymbolName);

var LastOpenTimeLoaded = _OfTimeFrameBars.OpenTimes[0];

 

Print("Bars[0].OpenTime " + Bars[0].OpenTime+ " _OfTimeFrameBars.OpenTimes[0] "+ _OfTimeFrameBars.OpenTimes[0] + " time_to_test "+ time_to_test);

if (_OfTimeFrameBars.OpenTimes[0] > time_to_test){

Print("_OfTimeFrameBars is not using Bars history already loaded");


 

}


 

}

}


 

protected override void OnBarClosed()

{

DateTime time_to_test = Bars[Bars.Count()-5].OpenTime.AddDays(-15);

 

if(BackTest && Bars.Last().OpenTime>DateTime.Parse(BackTestDate)){


 

Bars _OfTimeFrameBars = MarketData.GetBars(TimeFrame.Minute, SymbolName);

var LastOpenTimeLoaded = _OfTimeFrameBars.OpenTimes[0];

 

 

Print("Bars[0].OpenTime " + Bars[0].OpenTime+ " _OfTimeFrameBars.OpenTimes[0] "+ _OfTimeFrameBars.OpenTimes[0] + " time_to_test "+ time_to_test);

if (_OfTimeFrameBars.OpenTimes[0] > time_to_test){

 

Print("_OfTimeFrameBars is not using Bars history already loaded");

 

}


 

 

}

}


 

protected override void OnStop()

{

// Handle cBot stop here

}

}

}

 

 

 

 

 

 

 

sebastien.t said: 

Thank s for your answer, that seems a very nice option!

 

PanagiotisCharalampous said: 

sebastien.t said: 

Good day,

thank you for your answer. 

Do you have a workaround? 

The idea of my code/bot is to check some data in the past for the H4 to know if I am bullish or bearish and the to deep dive in the 1 minute chart. 

Basically I have to go 60 bars on the timeframe and then go to the m1. Let s say I want to backtest from the 1st february, I check the H4 10 days before (60*4/24), that should be around mid of January and then I check some data on that date on the m1.

So most of the time I need to LoadMoreHistory on the m1.

Thank you

Seb

PanagiotisCharalampous said: 

Hi there,

Your problem is here

           while (_OfTimeFrameBars.OpenTimes[0] > time_to_test){               var numberOfLoadedBars = _OfTimeFrameBars.LoadMoreHistory();

LoadMoreHistory does not work in backtesting therefore your code enters an infinite loop.

Best regards,

Panagiotis

 

Hi Seb,

The workaround I use is to start the backtesting at earlier dates so that all the necessary information is loaded, while skipping all trading operations until a custom defined date. So I have a set of parameters like this

which replace the backtesting start date and I move my backtesting start date as far in the past as I want.

Best regards,

Panagiotis

 

 

Hi Seb,

  1. I did not understand what the problem is here, sorry
  2. You should retrieve the data on start, before the if condition. That's the whole point of the workaround
        protected override void OnStart()

        {
            // To learn more about cTrader Automate visit our Help Center:

            // https://help.ctrader.com/ctrader-automate

            // Print(Bars.Count());

            DateTime time_to_test = Bars[Bars.Count() - 5].OpenTime.AddDays(-15);
            
            Bars _OfTimeFrameBars = MarketData.GetBars(TimeFrame.Minute, SymbolName);

            Print("Bars[0].OpenTime " + Bars[0].OpenTime + " _OfTimeFrameBars.OpenTimes[0] " + _OfTimeFrameBars.OpenTimes[0] + " time_to_test " + time_to_test);

            // Print(time_to_test);

            // Get m1 Bars

            if (BackTest && Bars.Last().OpenTime > DateTime.Parse(BackTestDate))
            {
                

                var LastOpenTimeLoaded = _OfTimeFrameBars.OpenTimes[0];

                if (_OfTimeFrameBars.OpenTimes[0] > time_to_test)
                {
                    Print("_OfTimeFrameBars is not using Bars history already loaded");
                }
            }
        }

@PanagiotisCharalampous

PanagiotisCharalampous
23 Apr 2024, 05:52

Hi there,

This feature is not available in cTrader for Mac at the moment. It will be added in a future release.

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
23 Apr 2024, 05:51

Hi there,

This message does not seem to be relevant to cTrader.

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
23 Apr 2024, 05:50

RE: RE: layout deckstop cTrader

mefrancesco1 said: 

PanagiotisCharalampous said: 

Hi there,

You can use this button to adjust your layout.

Best regards,

Panagiotis

Thank a lot, but doesn't work. If I try to select cT Mac… it is not possible.

You are clicking on the wrong button


@PanagiotisCharalampous

PanagiotisCharalampous
23 Apr 2024, 05:48

Hi there,

You should contact your broker regarding execution issues.

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
22 Apr 2024, 10:49

RE: RE: RE: RE: Indicators reload multiple times?

matcwhite said: 

PanagiotisCharalampous said: 

Hi Mat,

Unfortunately the link you provided is not accessible.

Best regards,

Panagiotis

Can someone advise the best way I can upload my video? I tried file.io but it timed out and deleted before anyone could look at it!

Thanks,

Mat

TinyTake is a good option

https://www.tinytake.com/record-capture


@PanagiotisCharalampous

PanagiotisCharalampous
22 Apr 2024, 10:48

Hi eynt,

No there is no such option at the moment.

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
22 Apr 2024, 08:55

Hi there,

You should talk to your broker about this.

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
22 Apr 2024, 08:54

Hi there,

Bu definition no, since it is impossible to simulate latency, slippage and other conditions that affect live trading.

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
22 Apr 2024, 08:53

RE: RE: Backtesting on Multi Timeframe

sebastien.t said: 

Good day,

thank you for your answer. 

Do you have a workaround? 

The idea of my code/bot is to check some data in the past for the H4 to know if I am bullish or bearish and the to deep dive in the 1 minute chart. 

Basically I have to go 60 bars on the timeframe and then go to the m1. Let s say I want to backtest from the 1st february, I check the H4 10 days before (60*4/24), that should be around mid of January and then I check some data on that date on the m1.

So most of the time I need to LoadMoreHistory on the m1.

Thank you

Seb

PanagiotisCharalampous said: 

Hi there,

Your problem is here

           while (_OfTimeFrameBars.OpenTimes[0] > time_to_test){               var numberOfLoadedBars = _OfTimeFrameBars.LoadMoreHistory();

LoadMoreHistory does not work in backtesting therefore your code enters an infinite loop.

Best regards,

Panagiotis

 

Hi Seb,

The workaround I use is to start the backtesting at earlier dates so that all the necessary information is loaded, while skipping all trading operations until a custom defined date. So I have a set of parameters like this

which replace the backtesting start date and I move my backtesting start date as far in the past as I want.

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
22 Apr 2024, 06:28

Hi there,

You can access open positions through the Positions collection.

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
22 Apr 2024, 06:25

RE: Cannot Ctrader Copy cannot copy

alnaffay2000 said: 

Whenever im trying to copy wiggle strategy on c trader in pepperstone im getting the error the following is not allowed. Please contact your broker for more info

im using  ctrader with pepperstone. 


 

Peppestone does not offer cTrader Copy


@PanagiotisCharalampous

PanagiotisCharalampous
22 Apr 2024, 06:25

Hi there,

These features are not available yet in cTrader for Mac. They will be added in future updates.

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
22 Apr 2024, 06:23

RE: RE: Column is missing on export

eynt said: 

The issue is still unsolved

An update has not been released yet.


@PanagiotisCharalampous

PanagiotisCharalampous
22 Apr 2024, 06:22

Hi there,

You can use this button to adjust your layout.

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
22 Apr 2024, 06:20

RE: RE: RE: RE: Error Exception #3B086C2C in cTrader 4.8.904.0

ajaycc3 said: 

Hi Panagiotis,

When is the next release? As this works fine for windows? Just issues with mac.

 

 

PanagiotisCharalampous said: 

ajaycc3 said: 

Hi Panagiotis,

Any update on this?

 

PanagiotisCharalampous said: 

Hi there,

Can you please share with us the source code of the cBot?

Best regards,

Panagiotis

 

Hi there,

We will fix it in an upcoming release.

Best regards,

Panagiotis

 

We do not have a date for it unfortunately.


@PanagiotisCharalampous

PanagiotisCharalampous
22 Apr 2024, 06:19

Hi there,

It looks like a liquidity issue. You should talk to your broker about this.

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
22 Apr 2024, 06:18

Hi there,

Your problem is here

           while (_OfTimeFrameBars.OpenTimes[0] > time_to_test){
               var numberOfLoadedBars = _OfTimeFrameBars.LoadMoreHistory();

LoadMoreHistory does not work in backtesting therefore your code enters an infinite loop.

Best regards,

Panagiotis


@PanagiotisCharalampous