Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
I came across Eric Brown's post on Excel & Easy Language and used his template with some changes makes some daily constants ( about 100) available to an indicator I built.
It works great but each time I change the time interval it rereads the data from Excel and does its thing.
I was thinking about figuring out a way to read the data once, as it doesn't change in a day, to Global variable and then doing my thing from there. Is it worth the effort?
I'm not an Easy Language programmer but I can figure it out. I doubt anyone would be impressed by my code but it works.
I downloaded the Global Variable 2.2 stuff and have begun reading it. More Greek than English currently therefore the question, is it worth the effort?
Thanks in advance for your assistance.
Can you help answer these questions from other members on NexusFi?
I am not sure how to answer if something is worth the effort without knowing what you'd gain by changing it or lose by leaving it the way it is.
So for now I'd say learning something new is most likely worth the effort, as it should develop your skill in EasyLanguage and might be helpful for you later.
On a separate matter it sounds like there are much simpler solutions to your problem than utilizing Global Variables. Why not just block the reload of the Excel data every time you switch the time frame?
I'm sure by my question you could tell that I'm a beginner at this, and I really appreciate you taking the time to reply to my question. Conceptually I totally agree, but I don't seem to understand enough about the structure of Easy Language to do it.
-- I put the reading of Excel data in a "ONCE...begin...end" statement, thinking it would only do it once. That didn't work the way I wanted. It appears to do it "ONCE" each time it is invoked (which does make sense) but did cause it to reread the Excel data each time the time interval was changed.
"Blocking the reload" was exactly what I wanted but didn't get. My assumption was that the variable data didn't persist and needed to regenerated each time, therefore I'd have to use Global variable to keep the data once I had loaded it.
It sounds like there is another way, that would be great. Can you point me in that direction? Thanks again.
you are correct that the variables won't persist upon a symbol/time frame change and once would be re-executed with a change, too.
One idea would be to store a flag within a AppStorage dictionary as these will keep the values upon switching the time frame. So you could set the flag to true when the code is executed the first time and on every new reload check the value of the flag and block reading from Excel.
Isn't there any way to create any global variable directly in easylanguage without using the dll GlobalVariabel?
Is there any way to run a script once when a MC starts (not associated to any specific chart or scanner)?
The easiest way to do global variables in TS Easy language that I found was using Global Dictionary. I haven't done it for awhile, so I won't try and explain it here. However it isn't that hard. No DLL needed.
there is no such option in legacy Easylanguage and Object Oriented EasyLanguage (which is what the solution @Chuck6475 pointed out uses) is not available in Multicharts.
It will take some programming, but you could save a flag status on your hard disk or in memory when "when a MC starts" and runs your indicator. Then have this indicator (or other indicators) read the file/value from memory.
Hello and thanks for your answer,
I would like that MC run a script to login to a specific broker in Sweden, get session-id and save it into a variable which can be read from all other scripts in MC without using any extra DLL-files.
It seems that I would stop searching isn't it?