Access Dictionary from cBot

Created at 23 Feb 2017, 06:32
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!
TR

trend_meanreversion

Joined 31.07.2014

Access Dictionary from cBot
23 Feb 2017, 06:32


Hi Team,

Excuse me for my ignorance about programming language but i would like to know how to access "public" defined variables or Collections like Dictionary from an Indicator to cBot. I know one can access IndicatorDataSeries but what about other variables, particularly if data structure is more complicated like a collection ( List or Dictionary etc )

  [Output("NZDUSD_M5", Color = Colors.Green)]
  public IndicatorDataSeries NZDUSD_M5 { get; set; }

  public Dictionary<DateTime, Dictionary<string, int>> DictList_M5 = new Dictionary<DateTime, Dictionary<string, int>>();

my Dictionary(DictList_M5) in my indicator is getting populated properly as i have already checked it  but when i try to access it a cBot like below

 foreach (KeyValuePair<DateTime, Dictionary<string, int>> kvp in _HM.DictList_M5)
 {
            
    Print("Key = {0}", kvp.Key);
               
  }

it gives me nothing ( I have already initialized indicator with correct parameters etc..).

Can somebody please shed some light on it ?

 

 

 


@trend_meanreversion
Replies

Jiri
23 Feb 2017, 12:10

Hi, see this: /forum/indicator-support/10973
@Jiri

trend_meanreversion
23 Feb 2017, 12:18

RE:

tmc. said:

Hi, see this: /forum/indicator-support/10973

Perfect. Thanks a lot mate. It it working now :)


@trend_meanreversion