| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
-
- using IndexFormula.Finance.DataProvider;
- using MuchInfo.Chart.Data.EnumTypes;
- using MuchInfo.Chart.Data.Interfaces;
- using MuchInfo.Chart.Data.Models;
- using System;
- using System.Collections.Generic;
- namespace MuchInfo.Chart.DataAdapter
- {
- /// <summary>
- /// 图表与编辑器的数据交换
- /// </summary>
- public interface IDataService
- {
- /// <summary>
- /// 使用公式计算图表数据
- /// </summary>
- /// <param name="source">源数据,需要计算的数据</param>
- /// <param name="sourceChart">所有要计算的公式</param>
- /// <param name="cycleType">周期类型</param>
- /// <param name="minutes">自定义周期分钟数</param>
- /// <returns>返回图表数据</returns>
- List<FormulaModel> Calculate(List<Data.Interfaces.IBarDataPoint> source, List<FormulaModel> sourceChart, Data.EnumTypes.CycleType cycleType, TimeSpan minutes);
- /// <summary>
- /// 使用公式计算图表数据
- /// </summary>
- /// <param name="source">源数据,需要计算的数据</param>
- /// <param name="formula">公式</param>
- /// <param name="cycleType">周期类型</param>
- /// <param name="minutes">自定义周期分钟数</param>
- /// <returns>返回图表数据</returns>
- FormulaModel Calculate(List<Data.Interfaces.IBarDataPoint> source, FormulaModel formula, Data.EnumTypes.CycleType cycleType, TimeSpan minutes);
- /// <summary>
- /// 打开指标编辑器
- /// </summary>
- /// <param name="source">计算源数据</param>
- /// <param name="formulaArray">当前图表的所有计算公式</param>
- /// <param name="cycleType">周期类型</param>
- /// <param name="minutes">自定义周期分钟数</param>
- /// <returns>返回图表数据</returns>
- List<FormulaModel> OpenEditor(List<IBarDataPoint> source, string[] formulaArray, CycleType cycleType, TimeSpan minutes);
- /// <summary>
- /// 编辑指定的公式
- /// </summary>
- /// <param name="formulaName">公式名称</param>
- void EditFormula(string formulaName);
- /// <summary>
- /// 打开指标编辑器
- /// </summary>
- /// <param name="formulaName">公式名称</param>
- void OpenFormulaEdit(string formulaName);
- /// <summary>
- /// 设置图表语言
- /// </summary>
- /// <param name="language">语言类型</param>
- void SetEditorLanguage(ChartLanguageType language);
- /// <summary>
- /// 从文件中加载公式集合
- /// </summary>
- /// <param name="fileName">公式文件fml</param>
- /// <returns></returns>
- SpaceModel LoadSpaceFromFile(string fileName);
- /// <summary>
- /// 保存指标参数
- /// </summary>
- /// <param name="programModels">公式参数</param>
- void SaveFormulaParams(List<ProgramModel> programModels);
- /// <summary>
- /// 数据转换
- /// </summary>
- /// <param name="source">数据类型</param>
- /// <param name="cycleType">周期</param>
- /// <param name="minutes">自定义周期时间</param>
- /// <returns></returns>
- CommonDataProvider DataPointConvert(List<Data.Interfaces.IBarDataPoint> source,
- Data.EnumTypes.CycleType cycleType, TimeSpan minutes, IDataManager dataManager);
- }
- }
|