Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to draw candle charts in C# [closed]

Tags:

c#

.net

charts

How can I draw candle charts in C#? Does anybody has any examples with a nice interface?

like image 538
Thiago Avatar asked Apr 16 '10 01:04

Thiago


People also ask

How are candlesticks made in charts?

Candlesticks are graphical representations of price movements for a given period of time. They are commonly formed by the opening, high, low, and closing prices of a financial instrument. If the opening price is above the closing price then a filled (normally red or black) candlestick is drawn.

How do you make an Ohlc chart?

Steps to Create an OHLC ChartCreate or design a SQL query. Run the query and check the results. Display and enable the Chart query builder. For your opening and closing price values, use the Stock Charts – Stock Open and/or Stock Close selections.

What is the best candlestick pattern to trade?

Which candlestick pattern is most reliable? Many patterns are preferred and deemed the most reliable by different traders. Some of the most popular are: bullish/bearish engulfing lines; bullish/bearish long-legged doji; and bullish/bearish abandoned baby top and bottom.


2 Answers

I've used the MSChart and found it to be pretty good. It supports candlestick charts. I've used ZedGraph as well but found a few graphical anomalies showed up on my charts but they were otherwise good as well.

like image 107
itsmatt Avatar answered Oct 01 '22 23:10

itsmatt


I use this for stock data but its in VB

        With Chart1.ChartAreas("myarea")
            .AxisY.Maximum = (Math.Ceiling((HighValue * 100)) / 100)
            .AxisY.Minimum = (Math.Floor((LowValue * 100)) / 100)
            .AxisY.LabelStyle.Format = "{0.00}"
        End With

        Dim s1 As New Series
        With s1
            .ChartArea = "myarea"
            .ChartType = SeriesChartType.Candlestick
            .XValueType = ChartValueType.String
            .YValueType = ChartValueType.Single
            .YValuesPerPoint = 4
            .CustomProperties = "PriceDownColor=Red, PriceUpColor=Green"
        End With


        For i = Globals.GraphColumns - 1 To 0 Step -1
            OutData = Data_Array.Item(i)

            s1.Points.AddXY(OutData.thedate, OutData.high, OutData.low, OutData.close, OutData.open)


        Next


        Chart1.Series.Add(s1)
        Me.Controls.Add(Chart1)
like image 26
Beto Avatar answered Oct 01 '22 22:10

Beto