How to share Array

Questions about MultiCharts and user contributed studies.
User avatar
Smoky
Posts: 416
Joined: 03 Dec 2010
Location: Thailand
Has thanked: 67 times
Been thanked: 105 times

How to share Array

Postby Smoky » 11 Mar 2016

Hi all,

did someone know how to share Arrays between charts ? (in PL )


Many thanks

User avatar
TJ
Posts: 7238
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 991 times
Been thanked: 2058 times

Re: How to share Array

Postby TJ » 11 Mar 2016

Hi all,

did someone know how to share Arrays between charts ? (in PL )


Many thanks
Anything shared between charts must go through GlobalVariables/ELC/ADE.

gilko
Posts: 16
Joined: 19 Dec 2013
Has thanked: 5 times
Been thanked: 3 times

Re: How to share Array

Postby gilko » 12 Mar 2016

Tanks TJ,

but you can't use array with GV.

you can use workaround with numbered value,

with colomn1 interger, colomn2 double, colomn3 float, colomn4 string

but with max row 10000 ....


Another way is to use Excel dll ...

User avatar
ABC
Posts: 636
Joined: 16 Dec 2006
Has thanked: 120 times
Been thanked: 359 times
Contact:

Re: How to share Array

Postby ABC » 12 Mar 2016

I'd suggest to take a look at EasyLanguage Collections. You can easily share lists, maps and collections of these across charts.

Regards,
ABC
Hi all,

did someone know how to share Arrays between charts ? (in PL )


Many thanks

tonyng
Posts: 46
Joined: 04 Oct 2013
Has thanked: 2 times
Been thanked: 4 times

Re: How to share Array

Postby tonyng » 10 May 2016

I don't think you can share array by using this version of EasyLanguage. Try ElCollection with ADE. BTW, GV has many diff. type of arrays like int,double,char etc.. .

i.e. Chart1 and Chart2 share int[0] to [100] and Chart3 and Chart4 share int[101] to [200]

BTW, GV is not thread safe. May be ElCollection is thread safe but I am not sure. Thread safe means there is C code to manage the critical section for you.

GV - can be used to share data between different copy of MC or Charts
ElCollection - can be only used to share data between local charts with ADE

Unless you know c++ programming, you cannot do data sharing safely with MC. I wrote a special c++ dll by using a Nanomsg for sharing data between different charts and its thread safe.

.net version on the other hand has no problem to do that since .net has built in feature called concurrency collection.

In short, you're responsible for making sure your shared array is thread safe. I know lots people is using elcollection here. May be someone can help u with that.

User avatar
Smoky
Posts: 416
Joined: 03 Dec 2010
Location: Thailand
Has thanked: 67 times
Been thanked: 105 times

Re: How to share Array

Postby Smoky » 11 May 2016

Today I use ElCollection , fine to do all i want with arrays ;)


I prefer to use https://fx1.net/sharedvar.php to share numeric var rather GV, tradesafe and very fast, with server client to show in real time your var(s) (update/change)...


you can also use https://fx1.net/permvar.php to store data in registry for starting new MC session with last stored var(s)...(better than file text, you have direct access to your named value...


thanks ;)


Return to “MultiCharts”