How to get content of text files?

Questions about MultiCharts and user contributed studies.
TW
Posts: 31
Joined: 14 Dec 2009
Has thanked: 5 times
Been thanked: 1 time

How to get content of text files?

Postby TW » 22 Mar 2010

How to read content of text files by P/L? Thanks!

User avatar
Bruce DeVault
Posts: 438
Joined: 19 Jan 2010
Location: Washington DC
Been thanked: 2 times
Contact:

Postby Bruce DeVault » 22 Mar 2010

EasyLanguage has no direct commands to read text files. However, you could do this from a DLL - either by building your own or by using a prebuilt package like ADE (which is built upon the ELC DLL) to fulfill your purpose.

TW
Posts: 31
Joined: 14 Dec 2009
Has thanked: 5 times
Been thanked: 1 time

Postby TW » 22 Mar 2010

Thanks Bruce.

I just need a temporary database to read a calculated result from the other chart which calculated before session time. I think ADE can't work for it.

User avatar
Bruce DeVault
Posts: 438
Joined: 19 Jan 2010
Location: Washington DC
Been thanked: 2 times
Contact:

Postby Bruce DeVault » 22 Mar 2010

For simple interchart communications, I would suggest global variables or pushpop as the easiest solution.

TW
Posts: 31
Joined: 14 Dec 2009
Has thanked: 5 times
Been thanked: 1 time

Postby TW » 22 Mar 2010

I want to get a result of one year data in chart A and transfer data to real time chart B, so I don't let chart A receive real time data during session time. I'm not sure if GV could work, I'll try it. Thanks Bruce!

User avatar
Bruce DeVault
Posts: 438
Joined: 19 Jan 2010
Location: Washington DC
Been thanked: 2 times
Contact:

Postby Bruce DeVault » 22 Mar 2010

In Chart A simply don't put the values into the GV if LastBarOnChart is true e.g. if you are in real-time.

TW
Posts: 31
Joined: 14 Dec 2009
Has thanked: 5 times
Been thanked: 1 time

Postby TW » 22 Mar 2010

Mmmm... It seems no solutions so far. Thanks anyway!

bowlesj3
Posts: 2148
Joined: 21 Jul 2007
Has thanked: 210 times
Been thanked: 424 times

Postby bowlesj3 » 22 Mar 2010

Hi TW,

I am not sure of exactly what you are trying to do but if you do decide to read/write text files this time (or any time in the future) the thread below has an example in the documentation of how to use the map command and list commands of the EL collections to get text data in and out of MC using csv files. It saves you having to learn the full ADE which I personally have never had a use for. To quickly figure out how to use the map command to do it you need to read the EL collections document which is in the last post of the thread below because I figured out exactly how to use the map command for it and put an example in to the original documentation. Without that example it can take a fair bit of experimenting to figure it out.

John.

http://forum.tssupport.com/viewtopic.ph ... highlight=

User avatar
Bruce DeVault
Posts: 438
Joined: 19 Jan 2010
Location: Washington DC
Been thanked: 2 times
Contact:

Postby Bruce DeVault » 22 Mar 2010

I'm not sure why you would say "no solutions so far" - these types of solutions (GV, ELC, ADE) are the best and most straight-forward way to do this. You have a whole number of options, including GV/PushPop which is probably the simplest, ELC which is next least complex, and ADE which is most complex.

TW
Posts: 31
Joined: 14 Dec 2009
Has thanked: 5 times
Been thanked: 1 time

Postby TW » 22 Mar 2010

Hi John, thanks for the information!

Bruce, sorry for misunderstanding. I'll try GV first.

Thank you all!!

bowlesj3
Posts: 2148
Joined: 21 Jul 2007
Has thanked: 210 times
Been thanked: 424 times

Postby bowlesj3 » 22 Mar 2010

One thing about GV. If you shut down MC but leave your computer (windows) running the GV values are retrained for the next time you start up MC.

Of course if you want to send data to another computer as I do you need to write to a file and pick it up from the other computer.

User avatar
Bruce DeVault
Posts: 438
Joined: 19 Jan 2010
Location: Washington DC
Been thanked: 2 times
Contact:

Postby Bruce DeVault » 22 Mar 2010

No problem - the one place where the added complexity involved with ADE would be justified is if you need to backtest / work with historical bars. For this, you can use ELC if you restrict everything to one chart (thus can line up by the bar number) but otherwise, such as when they are on different charts, ADE would be the easiest way to go. When only "real-time" information is needed, often GV or PushPop are the way to go, with ELC somewhere in between, such as when you must work with a file and don't just want the value sent to the other chart the most straight forward way possible. Often, ADE is not necessary, especially if real-time only is acceptable.

TW
Posts: 31
Joined: 14 Dec 2009
Has thanked: 5 times
Been thanked: 1 time

Postby TW » 22 Mar 2010

It sounds ELC is the best way to me.

Thanks, you guys are awesome!

TW
Posts: 31
Joined: 14 Dec 2009
Has thanked: 5 times
Been thanked: 1 time

Postby TW » 22 Mar 2010

Here is a DLL for reading text files:

www.codetalkerworld.net/downloads_dll.htm

User avatar
Bruce DeVault
Posts: 438
Joined: 19 Jan 2010
Location: Washington DC
Been thanked: 2 times
Contact:

Postby Bruce DeVault » 23 Mar 2010

I notice the webpage says "TS2000i or TS6 only" (TS is currently on 8.8 and 2000i is no longer available in the USA) - have you tested this and does it work for what you need?

TW
Posts: 31
Joined: 14 Dec 2009
Has thanked: 5 times
Been thanked: 1 time

Postby TW » 23 Mar 2010

I haven't tried it yet. I think the lastest version was by 09/18/2002, that's why it says TS6 or 2000i only

User avatar
Bruce DeVault
Posts: 438
Joined: 19 Jan 2010
Location: Washington DC
Been thanked: 2 times
Contact:

Postby Bruce DeVault » 23 Mar 2010

Okay, great - let us know if this works out for you!


Return to “MultiCharts”