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
|