help with a pgm [C++]

dOm1naTOr

Skilled
One of my friend needs to finish this pgm asap, and she is asking me for help.
im a n00b in pgming, even though i finished CS engineering.:(
plz help me guys. i promised, her, ill get it done seeking help from online community friends. ;)

this is the question she has forewarded.
Plotting a candlestick chart:

A candlestick chart is a style of bar-chart used primarily to describe price movements of an equity over time. It is a combination of a line-chart and a bar-chart, in that each bar represents the range of price movement over a given time interval. For more information see Candlestick chart - Wikipedia, the free encyclopedia.
Program outline
1. Read a comma separated text file which contains values for plotting the chart.

- Format of text file = repeated records containing open, high, low, close. (sample file attached) (maximum 20 records)

2. Plot the candles for each record.

- Need a maximum of 20 candles, but the program should work for <= 20 records

- The logic for plotting the chart is shown below.

- If (open >= close) for a record, the candle has to be filled with red color else candle should be filled with green color.

- Plot the graph with black background.

- The screen should be divided into 20 vertical slices with equal width. (no need to show the separator line)

- There should be a separation between each candles. See images attached for more information

- No need of x and y axis unit indicators.
mail


http://mail.google.com/mail/?ui=2&ik=e29d39b66a&view=att&th=123cb3109a2d18ab&attid=0.0.2&disp=emb&realattid=0.0.2&zw
 
r u looking for win32 pgm or normal console / DOS C++ / gcc pgm?
u need to write some fn .. to print box and ur candles..
its dependent on which platform u choose.

make an object candle ..
create instance of each for values read from file..

while ploting ur y is dependent on value held by instance..
u need to get x , which is dependent on rec no..

you can assign the rec num when u read, or use static variable (bad design) or a singleton class to return it..

now u have an x and y (y can be mid of open and close normalized to scale.)
now u draw a candle with x-5, y-factor, x+5 , y+factor.
thn draw a line from high to low thru x.

put logic into a fn of object..

dOm1naTOr said:
Program outline
1. Read a comma separated text file which contains values for plotting the chart.

- Format of text file = repeated records containing open, high, low, close. (sample file attached) (maximum 20 records)

cant see ur atachment...still
read into a string, tokenize it for comma.
dOm1naTOr said:
2. Plot the candles for each record.

- Need a maximum of 20 candles, but the program should work for <= 20 records
plot candle's one by one.
after each draw .. increment ur x or rec no.

make sure u divide ur plot area, and take rec no, and change it to ploting cordinates.

- The logic for plotting the chart is shown below.
dOm1naTOr said:
- If (open >= close) for a record, the candle has to be filled with red color else candle should be filled with green color.

??? is it hard?

dOm1naTOr said:
- Plot the graph with black background.

- The screen should be divided into 20 vertical slices with equal width. (no need to show the separator line)
- There should be a separation between each candles. See images attached for more information
you decide candle width, choose accordingly

dOm1naTOr said:
 
@blackprince
thank you very much

but i dun understand most of the stuffs. :(
ill quote all these replys to her.
btw, sorry, the link was from my mail. Here it goes

these are the pics
image001g.png
 
Back
Top