Two isssues: could method return 2 or more values. Could a bot stop all the bots?

Created at 29 Oct 2018, 10:09
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!
alexander.n.fedorov's avatar

alexander.n.fedorov

Joined 02.01.2018

Two isssues: could method return 2 or more values. Could a bot stop all the bots?
29 Oct 2018, 10:09


Dear Panagiotis, hi!

Basically, I was trying to write a method which whould return for the Dictionary<double, int> .Could not

the othe question is if som cBot could stop all the rest

Regards, 

Sasha


@alexander.n.fedorov
Replies

PanagiotisCharalampous
29 Oct 2018, 11:47

Hi Sasha,

  1. You can use out keyword
  2. A cBot cannot stop other cBots, at least in a direct way. If you could explain what you are trying to do, I could suggest something.

Best Regards,

Panagiotis

 


@PanagiotisCharalampous

alexander.n.fedorov
29 Oct 2018, 12:36

RE:

Panagiotis Charalampous said:

Hi Sasha,

  1. You can use out keyword
  2. A cBot cannot stop other cBots, at least in a direct way. If you could explain what you are trying to do, I could suggest something.

Best Regards,

Panagiotis

 

I think that I will study the link. Thank you.

For the second one , I think, that one of the bots (special bot) when stopped with send and SQL message to change the flag to "stop"

Every other bot OnTick or OnBar will check the flag (through the SQL connection) and if the flag says "stop"  it will stop.

I was just hoping that it is in an API, where Account.Algos.Stop or smth like that

Thank you and regards
Sasha
By the way, how do you right SQL statement  in LINQ?


@alexander.n.fedorov

Shares4UsDevelopment
06 Nov 2018, 23:24

RE:

alexander.n.fedorov said:

Dear Panagiotis, hi!

Basically, I was trying to write a method which whould return for the Dictionary<double, int> .Could not

the othe question is if som cBot could stop all the rest

Regards, 

Sasha

The following will'return' 2 values from 1 method by using the explicit passing by reference:

  private void doSomething()
        {
            Double Jo = 0;
            int Ho = 0;
            Dicty(ref Jo, ref Ho);
            Print("Jo={0}, Ho={1}", Jo, Ho);
        }
        private void Dicty(ref double val1, ref int val2) {
            val1 = 1.1;
            val2 = 2;
        }

 


@Shares4UsDevelopment

Shares4UsDevelopment
06 Nov 2018, 23:24

RE:

alexander.n.fedorov said:

Dear Panagiotis, hi!

Basically, I was trying to write a method which whould return for the Dictionary<double, int> .Could not

the othe question is if som cBot could stop all the rest

Regards, 

Sasha

The following will'return' 2 values from 1 method by using the explicit passing by reference:

  private void doSomething()
        {
            Double Jo = 0;
            int Ho = 0;
            Dicty(ref Jo, ref Ho);
            Print("Jo={0}, Ho={1}", Jo, Ho);
        }
        private void Dicty(ref double val1, ref int val2) {
            val1 = 1.1;
            val2 = 2;
        }

 


@Shares4UsDevelopment

alexander.n.fedorov
07 Nov 2018, 07:26

RE: RE:

dhr.a.koning said:

alexander.n.fedorov said:

Dear Panagiotis, hi!

Basically, I was trying to write a method which whould return for the Dictionary<double, int> .Could not

the othe question is if som cBot could stop all the rest

Regards, 

Sasha

The following will'return' 2 values from 1 method by using the explicit passing by reference:

  private void doSomething()
        {
            Double Jo = 0;
            int Ho = 0;
            Dicty(ref Jo, ref Ho);
            Print("Jo={0}, Ho={1}", Jo, Ho);
        }
        private void Dicty(ref double val1, ref int val2) {
            val1 = 1.1;
            val2 = 2;
        }

dear dhr.a koning. Thank you

Regards, 

Sasha

 


@alexander.n.fedorov