GetSymbol Problem

Created at 25 Oct 2022, 12:41
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!
XA

Xammo

Joined 23.06.2021

GetSymbol Problem
25 Oct 2022, 12:41


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
 


@Xammo
Replies

Spotware
26 Oct 2022, 10:04

Hi Xammo,

Please let us know the broker and account number.

Best regards,

cTrader Team


@Spotware

Xammo
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

Xammo
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

Xammo
01 Nov 2022, 15:10 ( Updated at: 21 Dec 2023, 09:23 )

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


@Xammo

thomas.abele
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

 


@thomas.abele

Xammo
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

 


@Xammo

thomas.abele
16 Nov 2022, 14:38 ( Updated at: 21 Dec 2023, 09:23 )

RE:

thanks Max! I found it.


@thomas.abele

Xammo
26 Jan 2023, 12:11 ( Updated at: 21 Dec 2023, 09:23 )

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...?!


@Xammo

PanagiotisChar
27 Jan 2023, 09:09 ( Updated at: 27 Jan 2023, 09:10 )

Hi Max,

Did you try fixing your exception first?

Aieden Technologies

Need help? Join us on Telegram

Need premium support? Trade with us

 


@PanagiotisChar

Xammo
28 Jan 2023, 14:57

Hi Panagiotis

My fault I shouldn't have confused things showing the code snippet from my monitoring bot which is why I think you are asking if I fixed the exception

Just try running the simple bot I posted in the the first post here that gets symbols for all symbols - it crashes out with that error staight away no exceptions

Cheers

Max


@Xammo

travoyazse
30 Jan 2023, 12:34

Symbol not exists

I have the same problem.

30/01/2023 11:24:17.098 | Failed to get symbol 'AUDCAD': Symbol not found or has no quotes.

 

Do you have a solution for this problem?

It was working ok on friday, 27 jan 2023.

But today I get the error all the time

 

Even though I check that it exists before with: Symbols.Exists(name)

 


@travoyazse

boris_k
24 Sep 2023, 14:21 ( Updated at: 21 Dec 2023, 09:23 )

RE: GetSymbol Problem

PanagiotisChar said: 

 

 

I have the same issue.
How to fix it?
Regards,


@boris_k

whaaaaatever.ken
29 Nov 2023, 11:15 ( Updated at: 21 Dec 2023, 09:23 )

Symbol not found

I have the same issue.

create a New cBot, and run backtest, I got this.


@whaaaaatever.ken

whaaaaatever.ken
29 Nov 2023, 13:26 ( Updated at: 21 Dec 2023, 09:23 )

Solved...?

I may have solved the problem.
It worked when I changed the .Net framework to 4.x.

It should have worked with 6.0 before....
I don't know the exact cause.

For the time being, I am relieved that it works.


@whaaaaatever.ken

PanagiotisCharalampous
30 Nov 2023, 06:17

Reply to: GetSymbol Problem

Hi all,

It's a known issue and it will be resolved in an upcoming update.

Best regards,

Panagiotis


@PanagiotisCharalampous