using C# events in MC.Net similar to Global Variables - futures io
futures io futures trading

using C# events in MC.Net similar to Global Variables

Discussion in MultiCharts

Updated September 21st 2019 by keywestcrazy
    1. trending_up 378 views
    2. thumb_up 0 thanks given
    3. group 2 followers
    1. forum 0 replies
    2. attach_file 0 attachments

Welcome to futures io: the largest futures trading community on the planet, with well over 100,000 members
  • Genuine reviews from real traders, not fake reviews from stealth vendors
  • Quality education from leading professional traders
  • We are a friendly, helpful, and positive community
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts
  • We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

(If you already have an account, login at the top of the page)

Search this Thread

using C# events in MC.Net similar to Global Variables

(login for full post details)
  #1 (permalink)
Cary, North Carolina
Experience: Advanced
Platform: MC.Net was NeoTckr, NT7/8
Posts: 6 since Aug 2010
Thanks: 0 given, 0 received

using C# events in MC.Net similar to Global Variables

Thoughts ... Comments ... Advise ....

In MultiCharts.Net -
As I think about implementing a sharing mechanism for plots and other values between my indicators and signals I looked at a number of possible solutions, that meet what I think are my needs, I have read about the following areas.
1 - Concurrent Dictionary - used by Global Variables - native c#
2 - Singleton
3 - static declaration and public naming of things to share -- plots, variables etc.
4 - Using Events, which are native to c#.

I am leaning to using events.
- # of events to create is 3 time frames x 10 = 30. I would want it to scale, lets say I go wild in tracking everything under the sun and it goes to 500
- The creator / sender of the event would be the indicator / strategy that produced it.
(Don't know what it would take to expand this to portfolio trader
- Some of my 'things', - very, very few - will be on the tick level
- Most will update / send event on bar completion, which is 2 - 4 minutes for 2/3 of windows, 5-15 minutes for other 1/3
- This will eliminate the need for continuous checking for new value in strategies and other consumers using the variable (data).
- Receivers (strategies, signals, other indicators, during start up will set place holders for to be delivered - event data to a default value to start.
- Larger overall strategy will create buy / sell signals in real time (intrabar) to broker to be executed. (moving trailing stops, etc)
- No need for locking mechanism, as I will distribute the value(s) as part of the event message structure.
- Seems like a performance advantage using Events, but a memory hit, unless I use dynamic events.
I'll probably start with static events and see how much memory I am eating up as I add more things to be watched.

Thanks for your time to reply and insights.

Reply With Quote

futures io Trading Community Platforms and Indicators MultiCharts > using C# events in MC.Net similar to Global Variables

September 21, 2019

Upcoming Webinars and Events

Free BloodHound Licenses for everyone!


Every journal equals ten meals for the hungry


Copyright © 2020 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432,
All information is for educational use only and is not investment advice.
There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
no new posts