Replies

thebeinvest
24 Aug 2023, 08:27

RE: RE: RE: BACKTESTING AND OPTIMIZATION FAILURE IN VERSION 4.8.21

dave.anderson.consulting said: 

thebeinvest said: 

Spotware said: 

Dear traders,

Can you please provide us with exact steps on how to reproduce this problem?

Best regards,

cTrader Team

                           double TrailingStopPips = (result * AjstSLM2);                                                                                  var newStopLoss = pos.TradeType == TradeType.Buy ? Symbol.Bid - Symbol.PipSize * TrailingStopPips : Symbol.Ask + Symbol.PipSize * TrailingStopPips;                                                                                  var StopLoss = ModifyPosition(pos, newStopLoss, pos.TakeProfit, true);                                                      if (StopLoss.Error == ErrorCode.InvalidStopLossTakeProfit && (Account.Equity >= (Account.Balance * 1.01)) )                            ClosePosition(pos);


if I simply put "FALSE", deactivating the modify position, it doesn't give the error anymore, the error is in the position modification.


If I do a ModifyPosition and change StopLoss only once, the cbot doesn't crash, however, if I activate HasTrailingStop (true), then yes, it's crashing.

Again, in other versions this did not happen.

I've done the test by changing all trailingStop methods and all give the same error.

In summary, if I deactivate HasTrailing Stop (false) it works, if I activate it, it gives an error. And again... in the other versions, this didn't happen.

in backtesting, I activated the visual mode, and believe me, in visual mode I have no problem with backtesting, but without visual mode and also in optimization it has a problem, that is, I cannot perform optimization, nor backtesting without visual mode.

I have just tested it on ctrader version 4.7.13 and confirmed that backtesting works normally even without visual mode activated.

Thus confirming that version 4.8.21 brought this error bug.

Please... help me take this message to the developers, it will help a lot of people.

the algorithm is correct, however, with the new update it is giving this error.

Even without Trailing Stop it crashes on optimization. In one of my cBots I have no trailing stop and no ModifyPosition. Even that cBot crashes the same way.

Thanks for sharing buddy!

One more case and example that YES, there is a problem in this version.

Let's wait for the return of the team @Spotware

Thanks!


@thebeinvest

thebeinvest
23 Aug 2023, 22:12

RE: RE: RE: BACKTESTING AND OPTIMIZATION FAILURE IN VERSION 4.8.21

Spotware said: 

thebeinvest said: 

Spotware said: 

Dear traders,

Can you please provide us with exact steps on how to reproduce this problem?

Best regards,

cTrader Team

                           double TrailingStopPips = (result * AjstSLM2);                                                                                  var newStopLoss = pos.TradeType == TradeType.Buy ? Symbol.Bid - Symbol.PipSize * TrailingStopPips : Symbol.Ask + Symbol.PipSize * TrailingStopPips;                                                                                  var StopLoss = ModifyPosition(pos, newStopLoss, pos.TakeProfit, true);                                                      if (StopLoss.Error == ErrorCode.InvalidStopLossTakeProfit && (Account.Equity >= (Account.Balance * 1.01)) )                            ClosePosition(pos);


if I simply put "FALSE", deactivating the modify position, it doesn't give the error anymore, the error is in the position modification.


If I do a ModifyPosition and change StopLoss only once, the cbot doesn't crash, however, if I activate HasTrailingStop (true), then yes, it's crashing.

Again, in other versions this did not happen.

I've done the test by changing all trailingStop methods and all give the same error.

In summary, if I deactivate HasTrailing Stop (false) it works, if I activate it, it gives an error. And again... in the other versions, this didn't happen.

in backtesting, I activated the visual mode, and believe me, in visual mode I have no problem with backtesting, but without visual mode and also in optimization it has a problem, that is, I cannot perform optimization, nor backtesting without visual mode.

I have just tested it on ctrader version 4.7.13 and confirmed that backtesting works normally even without visual mode activated.

Thus confirming that version 4.8.21 brought this error bug.

Please... help me take this message to the developers, it will help a lot of people.

the algorithm is correct, however, with the new update it is giving this error.

Dear trader,

Can you please provide us with the complete cBot code so that we can reproduce the problem?

Best regards,

cTrader Team

Hello!

No, unfortunately I can't share the full code.

But I think it's pretty clear here on the forum that a lot of people are having the same problem backtesting and optimizing with the new version.

And I made it clear where in my code it is generating an error, which is in TraillingStop, it is well explained in my answer above.

I believe that the programming team (Ctrader) must have a hundred example codes to simulate.

If several people are complaining about the same thing, and are having the same problem, it doesn't make sense to test only one code.

In fact, the version has problems, and they are impacting optimization adjustments, backtesting and negotiations.

I can a CopyTrader, and every month I redo the optimization of my Cbot, I see that next month not only me, but the people in my copy could be penalized for that.

And of course, I'll be informing everyone that the problem is in the new platform version and not in the Cbot itself, because I've already said it and I'll repeat it, it doesn't give an error in other Ctrader versions.

Thanks.


@thebeinvest

thebeinvest
23 Aug 2023, 02:04

RE: BACKTESTING AND OPTIMIZATION FAILURE IN VERSION 4.8.21

Spotware said: 

Dear traders,

Can you please provide us with exact steps on how to reproduce this problem?

Best regards,

cTrader Team

                           double TrailingStopPips = (result * AjstSLM2);     
                                                  
                           var newStopLoss = pos.TradeType == TradeType.Buy ? Symbol.Bid - Symbol.PipSize * TrailingStopPips : Symbol.Ask + Symbol.PipSize * TrailingStopPips;              
                                         
                           var StopLoss = ModifyPosition(pos, newStopLoss, pos.TakeProfit, true);
                           
                           if (StopLoss.Error == ErrorCode.InvalidStopLossTakeProfit && (Account.Equity >= (Account.Balance * 1.01)) )                            ClosePosition(pos);


if I simply put "FALSE", deactivating the modify position, it doesn't give the error anymore, the error is in the position modification.


If I do a ModifyPosition and change StopLoss only once, the cbot doesn't crash, however, if I activate HasTrailingStop (true), then yes, it's crashing.

Again, in other versions this did not happen.

I've done the test by changing all trailingStop methods and all give the same error.

In summary, if I deactivate HasTrailing Stop (false) it works, if I activate it, it gives an error. And again... in the other versions, this didn't happen.

in backtesting, I activated the visual mode, and believe me, in visual mode I have no problem with backtesting, but without visual mode and also in optimization it has a problem, that is, I cannot perform optimization, nor backtesting without visual mode.

I have just tested it on ctrader version 4.7.13 and confirmed that backtesting works normally even without visual mode activated.

Thus confirming that version 4.8.21 brought this error bug.

Please... help me take this message to the developers, it will help a lot of people.

the algorithm is correct, however, with the new update it is giving this error.


@thebeinvest

thebeinvest
21 Aug 2023, 08:51

RE: BACKTESTING AND OPTIMIZATION FAILURE IN VERSION 4.8.21

PhoenixCapital said: 

I am having a similar issue as well. The backtest just stops during a for loop after 50,000 entry. The new update is very buggy. I dont have an answer yet, but i will let you know when I do.

Thank you brother.

Indeed, after the last update these problems started.

I still haven't gotten a response either.

If you can, please let me know.


@thebeinvest

thebeinvest
16 Aug 2023, 02:32

RE: RE: RE: RE: crashed with error #24874110

thebeinvest said: 

thebeinvest said: 

thebeinvest said: 

thebeinvest said: 

I just did a test, and the problem no longer happens.

However, it is a protection function that I would like to continue using, I would like to return with it to the code.

Does anyone know if something is wrong?

This was in the code and was removed for the problem to disappear.

                            double TrailingStopPips = (result * AjstSLM2);                                                                                    var newStopLoss = pos.TradeType == TradeType.Buy ? Symbol.Bid - Symbol.PipSize * TrailingStopPips : Symbol.Ask + Symbol.PipSize * TrailingStopPips;                                                                                    var StopLoss = ModifyPosition(pos, newStopLoss, pos.TakeProfit, true);                                                        if (StopLoss.Error == ErrorCode.InvalidStopLossTakeProfit && (Account.Equity >= (Account.Balance * 1.01)) )                            ClosePosition(pos);

if I simply put "FALSE", deactivating the modify position, it doesn't give the error anymore, the error is in the position modification.

 

Can someone help me?

If I do a ModifyPosition and change StopLoss only once, the cbot doesn't crash, however, if I activate HasTrailingStop (true), then yes, it's crashing.

Again, in other versions this did not happen.

I've done the test by changing all trailingStop methods and all give the same error.

In summary, if I deactivate HasTrailing Stop (false) it works, if I activate it, it gives an error. And again... in the other versions, this didn't happen.

Guys, I performed more tests, and found something else..

I returned my code as it was before.

But in backtesting, I activated the visual mode, and believe me, in visual mode I have no problem with backtesting, but without visual mode and also in optimization it has a problem, that is, I cannot perform optimization, nor backtesting without visual mode.

I have just tested it on ctrader version 4.7.13 and confirmed that backtesting works normally even without visual mode activated.

Thus confirming that version 4.8.21 brought this error bug.

Please... help me get this message to the developers, it will hurt a lot of people.

the algorithm is correct, however, with the new update it is giving this error.


@thebeinvest

thebeinvest
16 Aug 2023, 02:24

RE: RE: RE: crashed with error #24874110

thebeinvest said: 

thebeinvest said: 

thebeinvest said: 

I just did a test, and the problem no longer happens.

However, it is a protection function that I would like to continue using, I would like to return with it to the code.

Does anyone know if something is wrong?

This was in the code and was removed for the problem to disappear.

                            double TrailingStopPips = (result * AjstSLM2);                                                                                    var newStopLoss = pos.TradeType == TradeType.Buy ? Symbol.Bid - Symbol.PipSize * TrailingStopPips : Symbol.Ask + Symbol.PipSize * TrailingStopPips;                                                                                    var StopLoss = ModifyPosition(pos, newStopLoss, pos.TakeProfit, true);                                                        if (StopLoss.Error == ErrorCode.InvalidStopLossTakeProfit && (Account.Equity >= (Account.Balance * 1.01)) )                            ClosePosition(pos);

if I simply put "FALSE", deactivating the modify position, it doesn't give the error anymore, the error is in the position modification.

 

Can someone help me?

If I do a ModifyPosition and change StopLoss only once, the cbot doesn't crash, however, if I activate HasTrailingStop (true), then yes, it's crashing.

Again, in other versions this did not happen.

I've done the test by changing all trailingStop methods and all give the same error.

In summary, if I deactivate HasTrailing Stop (false) it works, if I activate it, it gives an error. And again... in the other versions, this didn't happen.

Guys, I performed more tests, and found something else..

I returned my code as it was before.

But in backtesting, I activated the visual mode, and believe me, in visual mode I have no problem with backtesting, but without visual mode and also in optimization it has a problem, that is, I cannot perform optimization, nor backtesting without visual mode.


@thebeinvest

thebeinvest
16 Aug 2023, 02:06

RE: RE: crashed with error #24874110

thebeinvest said: 

thebeinvest said: 

I just did a test, and the problem no longer happens.

However, it is a protection function that I would like to continue using, I would like to return with it to the code.

Does anyone know if something is wrong?

This was in the code and was removed for the problem to disappear.

                            double TrailingStopPips = (result * AjstSLM2);                                                                                    var newStopLoss = pos.TradeType == TradeType.Buy ? Symbol.Bid - Symbol.PipSize * TrailingStopPips : Symbol.Ask + Symbol.PipSize * TrailingStopPips;                                                                                    var StopLoss = ModifyPosition(pos, newStopLoss, pos.TakeProfit, true);                                                        if (StopLoss.Error == ErrorCode.InvalidStopLossTakeProfit && (Account.Equity >= (Account.Balance * 1.01)) )                            ClosePosition(pos);

if I simply put "FALSE", deactivating the modify position, it doesn't give the error anymore, the error is in the position modification.

 

Can someone help me?

If I do a ModifyPosition and change StopLoss only once, the cbot doesn't crash, however, if I activate HasTrailingStop (true), then yes, it's crashing.

Again, in other versions this did not happen.

I've done the test by changing all trailingStop methods and all give the same error.

In summary, if I deactivate HasTrailing Stop (false) it works, if I activate it, it gives an error. And again... in the other versions, this didn't happen.


@thebeinvest

thebeinvest
16 Aug 2023, 01:58

RE: crashed with error #24874110

thebeinvest said: 

I just did a test, and the problem no longer happens.

However, it is a protection function that I would like to continue using, I would like to return with it to the code.

Does anyone know if something is wrong?

This was in the code and was removed for the problem to disappear.

                            double TrailingStopPips = (result * AjstSLM2);                                                                                    var newStopLoss = pos.TradeType == TradeType.Buy ? Symbol.Bid - Symbol.PipSize * TrailingStopPips : Symbol.Ask + Symbol.PipSize * TrailingStopPips;                                                                                    var StopLoss = ModifyPosition(pos, newStopLoss, pos.TakeProfit, true);                                                        if (StopLoss.Error == ErrorCode.InvalidStopLossTakeProfit && (Account.Equity >= (Account.Balance * 1.01)) )                            ClosePosition(pos);

if I simply put "FALSE", deactivating the modify position, it doesn't give the error anymore, the error is in the position modification.

 

Can someone help me?

If I do a ModifyPosition and change StopLoss only once, the cbot doesn't crash, however, if I activate HasTrailingStop (true), then yes, it's crashing.

Again, in other versions this did not happen.


@thebeinvest

thebeinvest
16 Aug 2023, 00:24 ( Updated at: 16 Aug 2023, 00:28 )

.


@thebeinvest

thebeinvest
16 Aug 2023, 00:13 ( Updated at: 16 Aug 2023, 00:42 )

I just did a test, and the problem no longer happens.

However, it is a protection function that I would like to continue using, I would like to return with it to the code.

Does anyone know if something is wrong?

This was in the code and was removed for the problem to disappear.

                            double TrailingStopPips = (result * AjstSLM2);     
                                                   
                            var newStopLoss = pos.TradeType == TradeType.Buy ? Symbol.Bid - Symbol.PipSize * TrailingStopPips : Symbol.Ask + Symbol.PipSize * TrailingStopPips;              
                                          
                            var StopLoss = ModifyPosition(pos, newStopLoss, pos.TakeProfit, true);
                            
                            if (StopLoss.Error == ErrorCode.InvalidStopLossTakeProfit && (Account.Equity >= (Account.Balance * 1.01)) )                            ClosePosition(pos);

if I simply put "FALSE", deactivating the modify position, it doesn't give the error anymore, the error is in the position modification.

 

Can someone help me?


@thebeinvest

thebeinvest
20 Apr 2023, 11:44

RE: RE:

algorithmic.trading.eu_gmail.com said:

thebeinvest said:

I'm trying to optimize a cBot in cTrader Desktop version 4.7.7, but it freezes and doesn't perform trades. On a VPS server with version 4.6.6 it is working, however, very slow because it is a server with low hardware.
On my normal PC, it was working normally in versions prior to optimization.

Hi,

Maybe you have the same problem as I had. Add some virtual RAM. Now my optimization is not freezing.

Check this post where cTrader team helped me with his problem.

 

 

 

Thanks for the recommendation, I changed the value here to +50% virtual memory.

But I'm also following the discussion in this other thread..

because the problem is more similar to mine.

 

 


@thebeinvest

thebeinvest
20 Apr 2023, 11:42

RE:

PanagiotisChar said:

Hi there,

Can you share your cBot code so that we can try it as well?

Aieden Technologies

Need help? Join us on Telegram

Need premium support? Trade with us

Unfortunately I can't upload my cBot code.. but thanks for the support.


@thebeinvest

thebeinvest
20 Apr 2023, 11:38 ( Updated at: 21 Dec 2023, 09:23 )

RE:

PanagiotisChar said:

Hi Daniel,

Check if this option is checked. If yes, uncheck it and try again.

Aieden Technologies

Need help? Join us on Telegram

Need premium support? Trade with us

 

By unchecking this option, I noticed that it was faster (normal, as it was before) but I still haven't concluded the optimization to find out if the trading data is really consistent with what I've been reporting.

But I already advance that what is the function of this checkbox? Will I check or uncheck it affect my optimization results?


@thebeinvest

thebeinvest
20 Apr 2023, 10:58 ( Updated at: 20 Apr 2023, 11:06 )

Olá, estou com o mesmo problema. Backtesting lento e otimização do cBot após a atualização do cTrader.

Abri outro tópico pois não tinha visto essa opção.

Também testarei o que Daniel disse sobre usar uma conta EURO apenas para testar e ver se melhora.


Em outras versões meu backtest cBot demorou cerca de 2 horas pelos parâmetros que selecionei, agora o tempo estimado/real passou para mais de 1 dia de espera.

Isso está realmente atrapalhando.

 

As soon as I manage to test the type of EURO/USD account that Daniel mentioned, I'll get back to you if it worked.

In my case, it's even worse, as in version 4.7.7 my cBot doesn't even run optimization on EURAUD asset, and on GBPAUD it only makes 3 trades and crashes.

In version 4.6.6 it is taking more than 1 day in the estimated time to finish the optimization, and previously it took a maximum of 2h.


@thebeinvest

thebeinvest
16 Dec 2022, 00:16

RE:

PanagiotisChar said:

Hi there,

Try this

(Bars.LastBar.Close - Bars.LastBar.Open) / Symbol.PipSize

Aieden Technologies

Need help? Join us on Telegram

Need premium support? Trade with us

 

Thanks for the answer. I love you.

This solved my problem.

I have another question in this context, see if you can help me.

I need this calculation below to be performed only once. I don't want this account running all the time.

That is, every time I open a position, I do this calculation and it is used as a variable in the program, and is no longer recalculated.

var cbodycandlePrevious = pos.TradeType == TradeType.Buy ?
                            ((Bars.Last(1).Open - Bars.Last(1).Close) / Symbol.PipSize)
                            : ((Bars.Last(1).Close - Bars.Last(1).Open) / Symbol.PipSize);


@thebeinvest