C# MSChart Candle Stick & Moving Average Chart. Error: Formula error - There are not enough data points for the Period

穿精又带淫゛_ 提交于 2019-12-06 16:32:26

Although pretty old I thought I leave my contribution since I was struggling with the very same error message and the posted code actually pointed me in the right direction.

I believe the chart1.DataBind() needs to move after setting XValueMember and YValueMembers. Like so:

    chart1.Series["Daily"].XValueMember = "DateStamp";
    chart1.Series["Daily"].YValueMembers = "HighPrice, LowPrice, OpenPrice, ClosePrice";   
    chart1.DataBind();

by the time the FinancialFormula gets applied the data will not have been loaded into the series object otherwise. You may run into other issue though ;)

please add

Chart1.DataManipulator.IsStartFromFirst = True

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!