Topics
05 Feb 2025, 10:21
 166
 1
25 Feb 2019, 15:39
 1281
 2
29 Jan 2019, 19:08
 5664
 14
24 Mar 2018, 09:56
 1
 930
 1
17 Jan 2017, 14:20
 2020
 3
Replies

FMogyi
27 Jan 2017, 14:29

Thanks


@FMogyi

FMogyi
26 Jan 2017, 15:20

Sorry! Not the journal!

The cBot log file need for me!


@FMogyi

FMogyi
26 Jan 2017, 15:02

Hi,

If you use more cBots simultaneously  you should use Label parameter (means cBot ID) when managing your positions and orders.

Here is an example for closing:

//
            var positions = Positions.FindAll(Label, Symbol);  // cBot gets own positions only. 

            foreach (var position in positions)
            {
                TradeResult result = ClosePosition(position);
                if (!result.IsSuccessful)
                {
                    Print("*** ClosePos Err: {0} {1} {2} {3}", position.Id, position.Label, position.TradeType, result.Error);
                    error++;
                }
                else if (debug)
                    Print("--> {0} ClosePosition Ok.", position.Id);

            }
        }

Best Regards


@FMogyi

FMogyi
19 Jan 2017, 13:52

Hi, thanks, your answer but I think your advice  is wrong. bAuth  is initialised bool variables at OnStart  and bWeekend  gets value at every OnBar function.

The cBot runs for an hours  well for a  while. The OnTick function was called  well more hundreds or more thousands  times before the  problem occurs.


@FMogyi

FMogyi
16 Jan 2017, 17:29

What do you mean it slow? Backtesting is a very slow process. But much faster then the forward tests.


@FMogyi

FMogyi
02 Mar 2016, 20:17 ( Updated at: 04 Mar 2016, 12:06 )

This post was removed by moderator because it duplicates another post. /forum/calgo-support/8466?page=1#2


@FMogyi