NexusFi: Find Your Edge


Home Menu

 





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


Discussion in MultiCharts

Updated
    1. trending_up 1,094 views
    2. thumb_up 0 thanks given
    3. group 2 followers
    1. forum 0 posts
    2. attach_file 0 attachments




 
Search this Thread

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

  #1 (permalink)
 keywestcrazy 
Cary, North Carolina
 
Experience: Advanced
Platform: MC.Net was NeoTckr, NT7/8
Posts: 6 since Aug 2010
Thanks Given: 3
Thanks Received: 0

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
events.
- 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.
John

Started this thread Reply With Quote




Last Updated on September 21, 2019


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
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.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts