Global Variables - How to make them work on hystoric chart and not only in real time  [SOLVED]

Questions about MultiCharts and user contributed studies.
dvdkite
Posts: 65
Joined: 16 May 2018
Has thanked: 10 times
Been thanked: 1 time

Global Variables - How to make them work on hystoric chart and not only in real time

Postby dvdkite » 11 Jul 2019

Hello Everyone,

Let me better explane my question. I have 2 chart that are actually communicating using Global Variables. In the Chart 1 I use codes like this to SET the Global Variables values:

Code: Select all

value2 = GVSetFloat(2,C); value3 = GVSetInteger(3,date); value4 = GVSetInteger(4,time);
Then in Chart 2 I use a similar code with GET ( GVGetInteger, GvGetFloat.... ) and it is working.

I use the code in chart 1 to save some data (price, time, ectt...) of an event and I plot an arrow in chart 2 over the candle related to that item. It works fine but it only start working from the exact second when I start the indicators. I have all indicationd over my candles but if I simply do a REFRESH INDICATORS then all my arrows disappear from chart 1 .... so it basically work only in real time but I'm not sure how to make it plot always ...I mean also for past days and not only in real time... how can I achive that?
My idea was to put values into an array and send the array from chart 1 to chart 2 but a GVSetArray is not availables ( and maybe it would be too heavy to be fast)....
I hope I've explaned well my questions.

Do you have any suggestion?

Thanks in advance

dvdkite
Posts: 65
Joined: 16 May 2018
Has thanked: 10 times
Been thanked: 1 time

Re: Global Variables - How to make them work on hystoric chart and not only in real time

Postby dvdkite » 16 Jul 2019

Hello everyone again, has anyone had my problems with Global Variables? I know that a few people actually using them... but it would be nice to use them non only in real time but also to see them work on historical data on the chart... I'm sure there's a way but I really cannot find any indications here or with google. Any suggestions for the MC official staff? Thanks

User avatar
Anna MultiCharts
Posts: 560
Joined: 14 Jul 2017
Has thanked: 42 times
Been thanked: 140 times

Re: Global Variables - How to make them work on hystoric chart and not only in real time

Postby Anna MultiCharts » 16 Jul 2019

Hello, dvdkite!

You are right saying the Global Variables can only work in realtime. The reason for that is that there’s no bar linking and synchronization between the studies on different charts, and it’s not possible to establish this synchronization (this cannot be done by means of the PowerLanguage). If you want to keep the historical values of indicators present after the reload of the chart you can try creating a special dll that will store the current indicators’ values which you’ll be able to extract later.

User avatar
ABC
Posts: 718
Joined: 16 Dec 2006
Location: www.abctradinggroup.com
Has thanked: 125 times
Been thanked: 408 times
Contact:

Re: Global Variables - How to make them work on hystoric chart and not only in real time

Postby ABC » 16 Jul 2019

David,

the design of Global Variables makes them suited for real time use. While what you have in mind might be doable with Global Variables, it would require storing each bar with a value using a differently named Global Variable. This could become hard to manage and depending on the amount of bars you have you might also run into limitations as there is a finite amount of shared named global variables that can be handled.
EasyLanguage Collections might be better suited for what you have in mind, as you can share lists or maps across charts that are located within the same instance of Multicharts.

Regards,

ABC

Zoakes
Posts: 14
Joined: 23 Jul 2019
Has thanked: 1 time

Re: Global Variables - How to make them work on hystoric chart and not only in real time  [SOLVED]

Postby Zoakes » 02 Aug 2020

This is a pretty old thread, but I'm getting a 'cannot find globalvariables.dll' error whenever I use even the basic examples -- it's installed in the proper folder, installed the eld file in MC, don't know what's wrong.

--Resolved: I simply pulled the ORIGINAL GlobalVariables.dll from a fresh install, removed the 'new' one I installed (wrong -- likely 32 bit), and it works.
Hint -- GlobalVariables COMES with MC64 -- don't download anything for them, they are builtin! Don't know why they are included with ELC and ADE in forums, very misleading.


Return to “MultiCharts”