How to share Array

Questions about MultiCharts and user contributed studies.
User avatar
Smoky
Posts: 517
Joined: 03 Dec 2010
Location: Thailand
Has thanked: 99 times
Been thanked: 121 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: 7742
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2222 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: 718
Joined: 16 Dec 2006
Location: www.abctradinggroup.com
Has thanked: 125 times
Been thanked: 408 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: 51
Joined: 04 Oct 2013
Has thanked: 2 times
Been thanked: 5 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: 517
Joined: 03 Dec 2010
Location: Thailand
Has thanked: 99 times
Been thanked: 121 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 ;)

rc76
Posts: 51
Joined: 14 Oct 2020
Has thanked: 17 times

Re: How to share Array

Postby rc76 » 14 Apr 2024

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 ;)
Hi Smoky, if possible I have some quick Question regarding the app you mentioned:

PermVar vs SharedVar:

Q1
- It seems both serve the same purpose - i.e. for sharing variables? So should I just use the latest one which is SharedVar?
- Does PermVar do anything more than SharedVar?

Q2
- Can it share array?
- I tried to use ADE but ADE does not sure across different copy of MC.
- Can you use ELC to share array across different copy of MC? If so, may you please kindly share some example?

User avatar
Smoky
Posts: 517
Joined: 03 Dec 2010
Location: Thailand
Has thanked: 99 times
Been thanked: 121 times

Re: How to share Array

Postby Smoky » 15 Apr 2024

PermVar vs SharedVar :

Permvar use registry then yours datas are backup on the system the best to save a setup in disk.

Sharedvar use a server in memory then when you shutdown you computer yours datas are lost.

the best for me sharedvar because you can see in real time yours datas in the server.

both of then dont use array workaround use data1, data2, data3 as sharedvar variables names...

rc76
Posts: 51
Joined: 14 Oct 2020
Has thanked: 17 times

Re: How to share Array

Postby rc76 » 15 Apr 2024

Thank you so much Smoky.

Than it means that GV can do that same thing as SharedVar?

User avatar
Smoky
Posts: 517
Joined: 03 Dec 2010
Location: Thailand
Has thanked: 99 times
Been thanked: 121 times

Re: How to share Array

Postby Smoky » 15 Apr 2024

Even better because with sharedvar server you follow in real time all yours variables see:

rc76
Posts: 51
Joined: 14 Oct 2020
Has thanked: 17 times

Re: How to share Array

Postby rc76 » 15 Apr 2024

Awesome. Thank you so much Smoky!

I just send the same array question to Fx1 team, but they said this product is not supported anymore.

"we do not support this product anymore sorry, all our devs are out of the support, so we canot give you any answer other than at web, sorry for this."

Do you have encounter any issue using SharedVar with latest MC or Windows 11? Like memory leak or something?

User avatar
Smoky
Posts: 517
Joined: 03 Dec 2010
Location: Thailand
Has thanked: 99 times
Been thanked: 121 times

Re: How to share Array

Postby Smoky » 15 Apr 2024


Do you have encounter any issue using SharedVar with latest MC or Windows 11? Like memory leak or something?
Never, working MC15 Win11 24/24/7 without any issue ...


:wink: :mrgreen:

rc76
Posts: 51
Joined: 14 Oct 2020
Has thanked: 17 times

Re: How to share Array

Postby rc76 » 16 Apr 2024

Awesome! Thank you so much Smoky!

A quick question regarding getting data out of SharedVar app using such as AutoIt or AutoHotKey, any chance you have tried it?

I just try to retrieve data from SharedVar using AutoHotKey using DllCall() via SharedVar-a64.dll, it did return values, but not entirely correct.

For example:
It suppose to return version number like 1.2.0.310, but it returned something like 491797744.

Any chance you have tried something like that?

User avatar
Smoky
Posts: 517
Joined: 03 Dec 2010
Location: Thailand
Has thanked: 99 times
Been thanked: 121 times

Re: How to share Array

Postby Smoky » 18 Apr 2024

no sorry, but seem to use string var both side ?

rc76
Posts: 51
Joined: 14 Oct 2020
Has thanked: 17 times

Re: How to share Array

Postby rc76 » 18 Apr 2024

No worries, thank you Smoky! I will keep give it a try :)


Return to “MultiCharts”