Replies

capanna.paolo
21 Oct 2022, 09:46 ( Updated at: 21 Oct 2022, 09:47 )

RE:

Hi jaydcrowe1989,

I had exactly the same issue, i let it run the whole night and in the morning i had my trade statistics...so it takes ages but in the end you get what you need.

(I was backtesting on 3 years)

I logged a ticket on the cTrader help portal but no answer so far after 3 days...

Cheers

 

jaydcrowe1989 said:

Hi,

Has anyone come across the issue where CTrader hangs and freezes for quite a while once a back test has completed? I am back testing a bot over the previous year?

Cheers,

Jay

 


@capanna.paolo

capanna.paolo
19 Oct 2022, 15:32 ( Updated at: 21 Dec 2023, 09:22 )

RE: RE:

Panagiotis,

I'm testing this bot on a 3 years window of time, on the 5min chart. In the end of the backtest i see the equity/balance curve, but the trading statistics are not loading, i've tried several times but cTrader get stuck.

Should i log a ticket to the customer support? 3years of data (ticks from server, not just open candle) shouldnt be too much at all...i should be able to test it on 10 years.

 

What do you think?

 

Thx

BR

 

capanna.paolo said:

Panagiotis,

Indeed, so stupid of me to not have seen before that the data source can be the tick data from server (i was using the candles option)

 

 

PanagiotisChar said:

Hi Paolo,

Make sure you are using tick data as a data source. OnTick() logic works correctly only on tick data.

Aieden Technologies

Need help? Join us on Telegram

Need premium support? Trade with us

 

 


@capanna.paolo

capanna.paolo
19 Oct 2022, 15:27

RE:

Panagiotis,

Indeed, so stupid of me to not have seen before that the data source can be the tick data from server (i was using the candles option)

 

 

PanagiotisChar said:

Hi Paolo,

Make sure you are using tick data as a data source. OnTick() logic works correctly only on tick data.

Aieden Technologies

Need help? Join us on Telegram

Need premium support? Trade with us

 


@capanna.paolo

capanna.paolo
19 Oct 2022, 11:08

RE:

Panagiotis,

 

I think the problem is that in the backtest ticks are not available.

So for a backtest on a 1min candle timeframe, if within the same candle the price trigger the condition to bring the stoploss to break even, cTrader doesn't recognize it. It is recognized only if it happen in one of the next candles.

Does it sounds logic to you?

 

Thx,

Br

 

PanagiotisChar said:

Hi Paolo,

If you share the complete cBot code, I am happy to have a look and let you know what is wrong with your code.

Aieden Technologies

Need help? Join us on Telegram

Need premium support? Trade with us

 

 


@capanna.paolo

capanna.paolo
06 Jul 2022, 08:14

RE:

I solved it with the function onTimer, thanks!

 

firemyst said:

If it doesn't matter, why not just look for the first OnTick that happens after your specified time and execute the order then? So instead of checking if the time matches exactly, just check if onTickTime >= your specified time and if so, execute your actions. If you want it limited to only occur within a few seconds after your specified time, then pseudo logic would be:

if (onTIckTime >= yourSpecifiedTime && onTickTime <= OnTickTime + numberOfAllowedSecondsAfter)

{

   // do what you have to do

}

 

If you do want it at the exact hour:minute:second and a tick doesn't come through, then there's nothing you can do as that's based on the market.

 


@capanna.paolo