Total of unrealized net

Created at 05 Sep 2022, 08:55
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!
GR

grandom

Joined 17.06.2022

Total of unrealized net
05 Sep 2022, 08:55


Greetings,

As shown below, in backtesting, the total of unrealized net gives wrong value sometimes, and correct value sometimes.

Producing such behavior is simply by choosing different end dates and check the number, while of course the cBot must have the ability to open multiple positions at the same time.
For easing things, when positions are too many just move to another date so you can manually check the value.

 


@grandom
Replies

PanagiotisCharalampous
05 Sep 2022, 11:40

Hi aranath,

Which cTrader version do you use?

Best Regards,

Panagiotis 

Join us on Telegram and Facebook


@PanagiotisCharalampous

grandom
05 Sep 2022, 11:43

RE:

PanagiotisCharalampous said:

Hi aranath,

Which cTrader version do you use?

Best Regards,

Panagiotis 

Join us on Telegram and Facebook

 

Latest versions in both spotware and fxpro, same bug in both. 

Not on my desktop atm, but spotware is 4.3.something and fxpro is 4.2.something


@grandom

PanagiotisCharalampous
05 Sep 2022, 12:28

Hi aranath,

Can you share some code that will allow us to reproduce this behavior?

Best Regards,

Panagiotis 

Join us on Telegram and Facebook


@PanagiotisCharalampous

grandom
05 Sep 2022, 13:09

RE:

PanagiotisCharalampous said:

Hi aranath,

Can you share some code that will allow us to reproduce this behavior?

Best Regards,

Panagiotis 

Join us on Telegram and Facebook

https://ctrader.guru/?repository=ema-power&category=cbots

Allow more than 1 trade, 5 or 10, the key thing is to have possibility to have multiple open positions at the end of a backtest.

Any cBot may have this possibility as long as no restriction is imposed on max number of positions allowed at any moment.


@grandom

PanagiotisCharalampous
05 Sep 2022, 15:46

Hi aranath,

Can you share parameters and dates? I have a hard time reproducing this.

Best Regards,

Panagiotis 

Join us on Telegram and Facebook


@PanagiotisCharalampous

grandom
05 Sep 2022, 15:53

RE:

PanagiotisCharalampous said:

Hi aranath,

Can you share parameters and dates? I have a hard time reproducing this.

Best Regards,

Panagiotis 

Join us on Telegram and Facebook

Sure but still at work atm when i get back will share them with you


@grandom

grandom
06 Sep 2022, 07:22 ( Updated at: 21 Dec 2023, 09:22 )

RE:

PanagiotisCharalampous said:

Hi aranath,

Can you share parameters and dates? I have a hard time reproducing this.

Best Regards,

Panagiotis 

Join us on Telegram and Facebook

Ok here we go.

The parameters are saved on file uploaded on https://drive.google.com/file/d/1wYawUXzcb9VP9-ZHp887SOM5kZU1PFQD/view?usp=sharing

and can be used on the cBot previously mentioned.

Backtest settings as shown in picture below

 

 

 

 

 

 

 

 

 

 

Backtest time frame: 5 min

Backtest start date: 8/3/2022

Examples of end dates that will generate positions of faulty unrealized net total:

14/03/2022
16/03/2022
18/03/2022
21/4/2022
22/4/2022
21/05/2022
31/07/2022

After cTrader team checks that, it will be necessary to check the same thing for the optimization engine, whether the unrealized net of open positions is faulty for optimization engine or not. If both engines share the same block of code responsible for the calculation of unrealized net, then such step won't be necessary, well the team knows better the whole picture and how such bug links to other components and the impact on other features, I think you get my point.


@grandom

PanagiotisCharalampous
06 Sep 2022, 09:00

Hi aranath,

Thank you, we will have a look at this.

Best Regards,

Panagiotis 

Join us on Telegram and Facebook


@PanagiotisCharalampous