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)
from this post it's not really clear what the problem is. From the MC post it appears you are having problems with how to create and name the list. This is something you have to do before you can work with it.
From the code piece you posted it appears that you want to read every line into its own list and store all those lists within a collection of lists.
I could better help you if I you could elaborate what exactly you want to achieve in the end. Meaning in what structure you need the strings later. Maybe what you are trying to do could be accomplished easier.
If you are sure you are on the right track a synopsis of what to do would be something like this:
1. Create a new (or shared) collection of lists.
2. Create a new list and read the first line of your file into this list.
3. Store the list within your collection. This should be done by a key you can easily re-access.
4. Create a new list and read the second line into this list.
5. Store this list within your collection.
Of course 2. to 5. should be done within a loop.
After that you can loop up each list by its key from the collection, call it and read the individual list values.
Again I am not sure that you need something like this and for understanding EL Collections I would strongly advise to start with something simple. Collections of Lists and Maps are more complex, but easily to manage once you have a solid ELC understanding.
To be honest.... I don't understand too much about ElCollection... I just don't get it.
File creation: Explanation of what I have already done,
A file is created. This file is created by capturing info on trend line that are draw on a chart. The goal is to reproduce these trend line to the same instrument but wit a lower scale. I draw trend line that represent bid support / resistance or supply / demand level. I draw them on a 4H and daily charts. Actually, I redraw them manually, I want it to be done by the code
File creation:
Each time a new Trend line is read, MC capture, The price, the date/time / color / size / style
Mc create a CSV string whit these data
Each string is terminated with the "NewLine" command
String are then entered in the file using the FileAppend command
At the end, I got a Text file named under the instrument that was used to capture trend line. Each Text file is specific to an instrument.
Explanation of what I want to achieve
I want to connect (create an ID) and open the text file
I need to read and put in variable named "TL_String" the first string ( inscription) of the text file
This TL_String will be process... (This work is done) and trend line is draw on a chart
Loop until all the string has been read in the file
To do these steps, I think that I need ElCollection
I need to learn
- how to "connect" create an ID (the path\name is under a variable name "FileName"
- How to read one string at the time and loop until all string has been read
- How to close the file if needed.
Hope it better explain what I want to achieve
Martin:
N.B.
Once finished, I will publish the code to reproduce the trend line over different chart using different scale.
While working on this , I created a tool that enable me to execute a function using a click of the mouse. Click on the upper corner, capture all trend line A click on the lower corner, will execute the function to reproduce the trend line. This enable me to control some function on MC using mouse click.. It could easily be modify the to enable me to have more clickable region that may act like command button. This section has been add to an indicator that I use on all charts
Since this only takes a few minutes I completed an example EasyLanguage indicator before I broke for lunch. You can expand on it to provide user defined colors and styles as well as any other operation applicable to a TrendLine.
File format would be as follows. startDate, startTime,startPrice,endDate,endTime,endPrice