ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  finance chart
Posted by Mohamed Wahab on Nov-18-2012 15:42
Attachments:
Hello ,

I want to ask to make (empty region) in chart like in picture ..

i want the customer determine the stock market very good

i use http://www.advsofteng.com/gallery_finance.html

and i want make in interactive finance chart

please view the picture >>


Mohamed
Untitled.png

  Re: finance chart
Posted by Peter Kwan on Nov-19-2012 23:46
Hi Mohamed,

If your timeStamps are longer than your other data, then there will be some empty region at the end. For example, if your timeStamps are from 9:30am to 4:30pm, but your data are only up to 3:45pm (that is, the timeStamps array are longer than the other data arrays), there will be some empty space at the end.

Hope this can help.

Regards
Peter Kwan

  Re: finance chart
Posted by Mohamed Wahab on Nov-22-2012 16:56
i want to ask about trace finance .. in interactive chart ? how can make it ?

  Re: finance chart
Posted by Mohamed Wahab on Nov-22-2012 17:00
i suffering big problem in timestamps :(

is this correct to draw ?

for (int i = 0; i < x; i++)
        {
            DateTime res;
            DateTime.TryParse(ds.Tables["Chart"].Rows[i]["dt"].ToString(), out res);

            timeStampsx.Add(res);
            highDatax.Add(Convert.ToDouble(ds.Tables["Chart"].Rows[i]["hi"]));
            lowDatax.Add(Convert.ToDouble(ds.Tables["Chart"].Rows[i]["lo"]));
            openDatax.Add(Convert.ToDouble(ds.Tables["Chart"].Rows[i]["op"]));
            closeDatax.Add(Convert.ToDouble(ds.Tables["Chart"].Rows[i]["cl"]));
            volDatax.Add(Convert.ToDouble(ds.Tables["Chart"].Rows[i]["vol"]));

        }

         timeStamps = timeStampsx.ToArray();
     highData = highDatax.ToArray();
       lowData = lowDatax.ToArray();
        openData = openDatax.ToArray();
        closeData = closeDatax.ToArray();
         volData = volDatax.ToArray();

and why not drawing and make massege (not in time period ! )

  Re: finance chart
Posted by Peter Kwan on Nov-23-2012 02:45
Hi Mohamed,

If you are using the Interactive Financial Chart sample code, and you obtain the message "No data available for the specified time period", that means you do not have sufficient data that is within the time range from "startDate" to "endDate".

To troubleshoot the code, please check if your data that are within the time range "startDate" to "endDate" is more than the "extraPoints" your code used.

One method to diagnose the problem is to simply print the important part of your data out as the error message. For example, in the original code, the error message is:

viewer.Image = errMsg("No data available for the specified time period").makeWebImage(Chart.PNG);

You can change it to:

string msg = "";
if (timeStamps.Length == 0)
    msg = "timeStamps array has zero length";
else
{
    msg += "Start Date = " + startDate.ToString() + "\\n";
    msg += "End Date = " + endDate.ToString() + "\\n";
    msg += "timeStamps[0] = " + timeStamps[0].ToString() + "\\n";
    msg += "timeStamps[timeStamps.Length - 1] = " + timeStamps[timeStamps.Length - 1].ToString() + "\\n";
    msg += "timeStamps.Length = " + timeStamps.Length + "\\n";
    msg += "extraPoints: " + extraPoints + "\\n";

    msg += "No data available for the specified time period";
}

viewer.Image = errMsg(msg).makeWebImage(Chart.PNG);

Now you can see the startDate, endDate, the actual time range of your data, as well as the number of data points in your data and the extraPoints you are using. You can then check if you have sufficient data that is within the range from "startDate" to "endDate".

If the above still cannot solve the problem, please let me know what is the message displayed.

Regards
Peter Kwan

  Re: finance chart
Posted by Peter Kwan on Nov-23-2012 03:04
Attachments:
Hi Mohamed,

To combine the "Interactive Financial Chart" with the "Finance Chart with Track Line" sample code, you just need to copy the code that produces the track line from the "Finance Chart with Track Line" to the "Interactive Financial Chart".

In brief, for the server side code, you just need to output the Javascript chart model. For the browser side code, you just need to copy the Javascript code that draws the track line.

I have attached an example for your reference.

Hope this can help.

Regards
Peter Kwan
financedemotrack4.aspx
financedemotrack4.aspx

50.98 Kb

  Re: finance chart
Posted by Mohamed Wahab on Nov-24-2012 18:41
yes very thanks Peter...  run :)

  Re: finance chart
Posted by Mohamed Wahab on Nov-24-2012 19:33
and how to make timestamps array longer than other ??
they in one for loop ??
like this

sql = "SELECT  dbo.Price_Data.TK, dbo.Price_Data.NM, dbo.Prices.dt, dbo.Prices.OP,
dbo.Prices.CL, dbo.Prices.HI, dbo.Prices.LO, dbo.Prices.VOL,
dbo.Prices.PD_TK_ID FROM         dbo.Price_Data INNER JOIN                       dbo.Prices
ON dbo.Price_Data.TK_ID = dbo.Prices.PD_TK_ID WHERE     (dbo.Price_Data.TK = '" +
ticker + "') AND dt between '" + startDate.ToString("yyyy/MM/dd") + "' and '" +
endDate.ToString("yyyy/MM/dd") + "'  ORDER BY dbo.Prices.dt  ";
        ds = Co.Select(sql, "Chart", 102);
        int x = ds.Tables["Chart"].Rows.Count;
        for (int i = 0; i < x; i++)
        {
            DateTime res;
            DateTime.TryParse(ds.Tables["Chart"].Rows[i]["dt"].ToString(), out res);

            timeStampsx.Add(res);
            highDatax.Add(Convert.ToDouble(ds.Tables["Chart"].Rows[i]["hi"]));
            lowDatax.Add(Convert.ToDouble(ds.Tables["Chart"].Rows[i]["lo"]));
            openDatax.Add(Convert.ToDouble(ds.Tables["Chart"].Rows[i]["op"]));
            closeDatax.Add(Convert.ToDouble(ds.Tables["Chart"].Rows[i]["cl"]));
            volDatax.Add(Convert.ToDouble(ds.Tables["Chart"].Rows[i]["vol"]));

        }

         timeStamps = timeStampsx.ToArray();
     highData = highDatax.ToArray();
       lowData = lowDatax.ToArray();
        openData = openDatax.ToArray();
        closeData = closeDatax.ToArray();
         volData = volDatax.ToArray();

  Re: finance chart
Posted by Peter Kwan on Nov-27-2012 01:16
Hi Mohamed,

To make timestamps array longer, just add more dates. For example:

//After obtaining the timeStampsx, add more dates
DateTime lastTime = timeStampsx[timeStampsx.Count - 1];
timeStampsx.Add(lastTime.AddDays(1));
timeStampsx.Add(lastTime.AddDays(2));
timeStampsx.Add(lastTime.AddDays(3));
timeStampsx.Add(lastTime.AddDays(4));

Hope this can help.

Regards
Peter Kwan

  Re: finance chart
Posted by Mohamed Wahab on Nov-27-2012 01:55
yeah , thanks Peter and i select another method also and run

  Re: finance chart
Posted by Mohamed Wahab on Nov-27-2012 01:56
yeah , thanks Peter and i select another method also and run

  Re: finance chart
Posted by Mohamed Wahab on Nov-27-2012 01:58
I want to make time fequency in chart
Daily , weekly , monthly , yearly .. regarded to my data
i want to make it in dropdown list like frame ?

  Re: finance chart
Posted by Peter Kwan on Nov-28-2012 02:55
Hi Mohamed,

By "time frequency", I assume you are referring to the time for each trading session (that is, a weekly chart means each trading session or candlestick is one week).

In the original Interactive Financial Chart sample code, there are already subroutines to get weekly or monthly data. Basically, to draw a weekly chart, simply pass weekly data to ChartDirector. (Do you have a database for weekly data, monthly data and yearly data?) If you do not have weekly data, you may get the daily data, then call convertDailyToWeeklyData. See the comments in the getWeeklyData subroutine. The same applies for monthly data as well.

If you want to "make it in dropdown list like frame", please just make the drop down list using standard asp:DropDownList. You may refer to ASP.NET documentation on how to make the drop down list. After making the list, you may modify your code to get the data accroding to the drop down list.

Hope this can help.

Regards
Peter Kwan

  Re: finance chart
Posted by Mohamed Wahab on Nov-28-2012 17:17

yeah peter , thanks