Write a class to compute the Open, High, Low, Close values of the LTP and the total quantity traded based of the LTQ. The bar size should be variable. You may implement an overloaded constructor / setter method for this information to passed to the instance of your class.
Note that each bar's result should be cached in the class into private data structures with access granted via public getter methods.
Bar is basically representation of a collected data which stores Open High Low Close. Likewise here in the above sample data... from the time 09:15:01 to the last 09:15:01, the value in this time frame would create a bar.
Next Time stamp would start from 09:15:02 to last 09:15:02.
So each time stamp would construct a bar. Which would have the following data Open High Low Close. Open would be starting of the time stamp (means the first 09:15:01, and close would be the last timestamp i.e. 09:15:01, High would be the highest number in the time stamp series and low would be the lowest in the timestamp series.)
Now the row we have to look into to find out open high low and close would be the second last comma separated field which starts from 5245, 5240.15, 5242,5243...etc. The last field is called LTQ means last traded quantity...
Okay so you have a class. Can you show me how you are going to use this class? Show a main() that creates an instance of this class using your constructor. And you may need to show how/where the data you used to construct your class was obtained.
Oh and I really suggest you get used to using the class keyword instead of the struct keyword so you get to understand the difference.
Thanks for the suggestion. I will try to implement class keyword instead of the struct keyword. I am still in search of as how i am going to use this class in main(). I need some time for it...thats why i was looking for some help online...
I have a notepad file and from that i have to read the text with comma separated column.
What kind of specific information? If you have no idea how to read a text file then you need to start from the basics. Reading CSV files is not difficult, but it is above the basic file reading level. And since you state you don't have a basic understanding of file reading you need to start with the very basics. If you want specific information I really suggest you talk to your instructor or the TAs.