Bug with break in datetime continuity during backtesting

Created at 12 Jan 2021, 17:11
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!
CA

cAlgoBuddy

Joined 12.11.2020

Bug with break in datetime continuity during backtesting
12 Jan 2021, 17:11


Hello,

I get an erroneous trade result in my Spotware cTrader as well as the Pepperstone cTrader during backtesting:

Start date: 1/OCT/2016 End date 31/OCT/2016

The selected trade breaks the Date/Time continuity.

Pepperstone:

Spotware

 

Pepperstone: The event log shows the following, that the position with ID 4 was actually opened on 17/OCT and not on 10/OCT. There is a positive outcome, while the result above shows a big error.

Spotware, position ID 6, same outcome

 

Could you please look into that?

Regards,

Ioannis


@cAlgoBuddy
Replies

PanagiotisCharalampous
13 Jan 2021, 07:50

Hi johnmadenis,

I did not understand what is the problem. Can you please explain?

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

cAlgoBuddy
13 Jan 2021, 09:24

RE:

PanagiotisCharalampous said:

Hi johnmadenis,

I did not understand what is the problem. Can you please explain?

Best Regards,

Panagiotis 

Join us on Telegram

Hello Panagiotis,

There is a difference on the position between the Events log and the History. For reference please look the 1st and 3rd attached pictures. (Pepperstone cTrader)

At the Events tab, the flow of events is correct. Position with ID3 is opened on 12 OCT, position with ID4 is opened on 17 OCT and position with ID5 is opened on 19 OCT.

The logical continuity of time is correct.

At the History tab, position with ID 3 is opened on 12 OCT, position with id 4 is shown to have been opened on 10 OCT (how is this even possible? to have a position opened in the past?) and position with ID 5 is opened on the 19 OCT.

The flow of time is not correct. Furthermore, in the events we can see that position 4 had a positive outcome (Take profit Hit, log entry 13), while in the positions tab the trade appears to have a huge loss.

The exact same behavior can be seen in pictures 2 and 4 (Spotware cTrader) with position with ID 6

I hope I explained everything better.


@cAlgoBuddy

PanagiotisCharalampous
13 Jan 2021, 09:35

Hi johnmadenis,

The ID in the History tab is not the position ID but the Historical Trade ID. Hence the values you compare are not related. A position can have more than one historical trades. The historical trade id is determined by the closing price and not the entry time.

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous