PLUGINS => Symbols are only added when Plugin Starts and do NOT update after switching accounts (API Bug?)

Created at 02 Feb 2025, 12:13
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!
TO

TommyFFX

Joined 07.12.2021

PLUGINS => Symbols are only added when Plugin Starts and do NOT update after switching accounts (API Bug?)
02 Feb 2025, 12:13


I keep getting the same symbols when account is switching with different broker and different symbols. 

How can I get the new symbols of the new account/broker?
Kind Regards



using System;

using System.Linq;

using cAlgo.API;


 

namespace cAlgo.Plugins

{

    [Plugin(AccessRights = AccessRights.None)]

    public class SymbolTest : Plugin

    {

        protected override void OnStart()

        {

            Account.Switched += OnAccountSwitched;

        }


 

        private void OnAccountSwitched(AccountSwitchedEventArgs args)

        {

            try

            {

                var availableSymbols = Symbols.ToList();

                Print($"[INFO] Symbols after switch: {string.Join(", ", availableSymbols)}");

            }

            catch (Exception ex)

            {

                Print($"[ERROR] Failed to fetch symbols: {ex.Message}");

            }

        }


 

        protected override void OnStop()

        {

            Print("[INFO] Plugin stopped.");

            Account.Switched -= OnAccountSwitched;

        }

    }

}


@TommyFFX
Replies

TommyFFX
02 Feb 2025, 15:53 ( Updated at: 14 Feb 2025, 18:21 )

It looks like the symbols are always loaded with the account where the plugin has started and can not be updated with other account symbols when account is changing?

Is this going to be fixed in an update?

Kind Regards

@PanagiotisCharalampous


@TommyFFX