GetSymbol Problem

Xammo since: 23 Jun 2021;

  25 Oct 2022, 12:41
GetSymbol Problem

Hi

cTrader 4.4.15  - the following code

using cAlgo.API;
using cAlgo.API.Internals;

namespace cAlgo.Robots
{
    [Robot(AccessRights = AccessRights.FullAccess)]
    public class ALL_SYMBOL_INFO : Robot
    {
        protected override void OnStart()
        {
            foreach (string sym in Symbols)
            {
                Print(sym);

                Symbol symbol = Symbols.GetSymbol(sym);
            }
        }
    }
}

Gives this...

25/10/2022 09:31:17.009 | CBot instance [ALL_SYMBOL_INFO, AUDCAD, h1] started.
25/10/2022 09:31:17.634 | XAGEUR
25/10/2022 09:31:17.712 | XAGUSD
25/10/2022 09:31:17.900 | Failed to get symbol 'XAGUSD': Symbol not found or has no quotes.
25/10/2022 09:31:17.900 | XAUEUR
25/10/2022 09:31:18.118 | Failed to get symbol 'XAUEUR': Symbol not found or has no quotes.
25/10/2022 09:31:18.118 | XAUUSD
25/10/2022 09:31:18.322 | Failed to get symbol 'XAUUSD': Symbol not found or has no quotes.
25/10/2022 09:31:18.322 | XPDUSD
25/10/2022 09:31:18.525 | Failed to get symbol 'XPDUSD': Symbol not found or has no quotes.
25/10/2022 09:31:18.525 | XPTUSD
25/10/2022 09:31:18.743 | Failed to get symbol 'XPTUSD': Symbol not found or has no quotes.
25/10/2022 09:31:18.743 | XAUCHF
25/10/2022 09:31:18.947 | Failed to get symbol 'XAUCHF': Symbol not found or has no quotes.
25/10/2022 09:31:18.947 | XAUGBP
25/10/2022 09:31:19.165 | Failed to get symbol 'XAUGBP': Symbol not found or has no quotes.
25/10/2022 09:31:19.165 | XAUJPY
25/10/2022 09:31:19.368 | Failed to get symbol 'XAUJPY': Symbol not found or has no quotes.
25/10/2022 09:31:19.368 | XAGAUD
25/10/2022 09:31:19.572 | Failed to get symbol 'XAGAUD': Symbol not found or has no quotes.
25/10/2022 09:31:19.572 | XBRUSD
25/10/2022 09:31:19.775 | Failed to get symbol 'XBRUSD': Symbol not found or has no quotes.
25/10/2022 09:31:19.775 | XTIUSD
25/10/2022 09:31:19.978 | Failed to get symbol 'XTIUSD': Symbol not found or has no quotes.
25/10/2022 09:31:19.978 | EURUSD
25/10/2022 09:31:19.978 | AUDUSD
25/10/2022 09:31:19.993 | GBPUSD
25/10/2022 09:31:19.993 | USDCAD
25/10/2022 09:31:19.993 | USDCHF
25/10/2022 09:31:19.993 | USDJPY
25/10/2022 09:31:19.993 | AUDCAD
25/10/2022 09:31:19.993 | AUDCHF
25/10/2022 09:31:20.181 | Failed to get symbol 'AUDCHF': Symbol not found or has no quotes.

It used to work fine from what I can remember but can't be bothered installing older version/fed up going backwards/forwards with the versions (which seem to be flying along! only found out by chance 4.4 was out and thankfully does not seem to suffer from the OnBar and Server.Time issues of 4.2 and 4.3 so can actually use it - although I still lose the entire automate chart/parameters/tabs display randomly every few hours and nothing brings it back which is frustrating but whatever not going to keep reporting/just keep restarting as workaround...)

Thanks

Max
 

Spotware's avatar

Spotware since: 23 Sep 2013;

  26 Oct 2022, 10:04

Hi Xammo,

Please let us know the broker and account number.

Best regards,

cTrader Team

TRADERS FIRSTâ„¢ Vote for your favorite features: https://ctrader.com/forum/suggestions

Xammo since: 23 Jun 2021;

  26 Oct 2022, 11:53

IC Markets Raw Trading Ltd - happens on any account live or demo/do you really need my account number(s)?

Xammo since: 23 Jun 2021;

  01 Nov 2022, 02:07

It is still doing the same thing in 4.4.17 - is it working for you/are you saying this is a broker specific problem please?

Xammo since: 23 Jun 2021;

  01 Nov 2022, 15:10

OK I gave in and installed 4.1 (and deleted all the sample bots/indicators... again... top suggestion for new versions of cTrader -> tick box to skip sample files on install please!)

Here's the results - 4.1 on the left - 4.4.17 on the right (btw I still have the automate display randomly dissapearing/relaunch only way to fix issue in 4.4.17)

4.1 rips through all the symbols no problem so it does not seem to be a broker specific issue

Anyway I am only wanting it to monitor the symbol info so will just use 4.1 to get that job done but yeh it looks like 4.4 has an issue with multi symbol

thomas.abele since: 31 Dec 2017;

  16 Nov 2022, 13:12
how could you install version 4.1?

Hi Xammo,

may I ask, how could you install version 4.1?

I want to install old version 4.1, because newer versions have so many issues. But so far without success.

Any help is highly appreciated.

Thanks and Best Regards

Thomas

Xammo since: 23 Jun 2021;

  16 Nov 2022, 14:26

Hi Thomas

I honestly can’t remember now but think you’ve got to press CTRL+SHIFT+ALT or whatever it is for submitting a support ticket from within cTrader and you will see a link on the pop up to download 4.1

search for how to get the key combination sorry I never use it and can’t remember - good luck!

cheers

Max

thomas.abele since: 31 Dec 2017;

  16 Nov 2022, 14:38
RE:

thanks Max! I found it.

Xammo since: 23 Jun 2021;

  26 Jan 2023, 12:11

A different error now for this issue in 4.6.2 running the simple code on my first post in this thread

I have this code in a bot I use to monitor all symbols

   private void Add_Symbols()
        {
            Print("Adding Symbols...");

            foreach (string string_Symbol in Symbols)
            {
                Symbol symbol = Symbols.GetSymbol(string_Symbol);

                if (symbol != null && symbol.IsTradingEnabled && !lOCS.Any(x => x.C_symbol.Name == symbol.Name))
                {
                    Class_Symbol oCS = new Class_Symbol(symbol)
                    {
                        C_queue_spread = new Queue<double>(),
                        C_queue_atr = new Queue<double>()
                    };

                    lOCS.Add(oCS);
                }
            }
        }

which is giving the below error - it is 'crashing' but it doesn't stop the bot then 10 minutes later it is trying again and crashing again... never seen that before usually it would just crash and stop the bot but I think I saw in the update info for 4.6.2 about bots continuing on through crashes so perhaps that is why but yeh it's saying the same key (Symbol) has already been added...?!

PanagiotisChar's avatar

PanagiotisChar since: 15 Sep 2022;

  27 Jan 2023, 09:10
Cofounder and Chief Technologist at Aieden Technologies