| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732 |
- //
- // ChartView.h
- // ChartView
- //
- // Created by Simon Zhou on 14-6-11.
- // Copyright (c) 2014年 muchinfo. All rights reserved.
- //
- #import <UIKit/UIKit.h>
- /**
- * @brief 图表类型枚举
- * - 枚举列表:
- * -# ChartTyeTSPlan - 分时图
- * -# ChartViewTypeKL - K线图
- * -# ChartViewTypeImmediately - 瞬时图
- */
- typedef enum ChartViewType {
- ChartViewTypeTSPlan,
- ChartViewTypeKL,
- ChartViewTypeImmediately
- } ChartViewType;
- /**
- * @brief 图表指标类型枚举
- */
- typedef enum ChartTargetType {
- /// MACD指标
- MACD,
- /// 成交量指标
- VOL,
- /// KDJ指标
- KDJ,
- /// RSI指标
- RSI,
- /// CCI指标
- CCI,
- /// DMA指标
- DMA,
- /// KD指标
- KD,
- /// BIAS指标
- BIAS,
- /// CR指标
- CR,
- /// WR指标
- WR,
- /// PSY指标
- PSY,
- /// ASI指标
- ASI,
- /// VR指标
- VR,
- /// BOLL指标
- BOLL,
- /// OBV指标
- OBV,
- /// VOLHS指标
- VOLHS
- } ChartTargetType;
- /**
- * @brief 图表错误枚举
- */
- typedef enum ChartErrorType {
- /// 无错误
- ChartErrorTypeNone = 0,
- /// 行情数据超时
- ChartErrorTypeQuotaTimeout = -80001,
- /// 数据周期间隔秒数
- ChartErrorTypeNotSetCycleInterval = -80002,
- /// 行情数据比图表最后时间还要早
- ChartErrorTypeQuotaTimeOldest = -80003
- } ChartErrorType;
- @class ChartData;
- @protocol ChartViewDelegate;
- /**
- * @brief 本地化图表视图
- */
- @interface ChartView : UIView <UIGestureRecognizerDelegate>
- @property (nonatomic,weak) id<ChartViewDelegate> delegate;
- #pragma mark - 数据成员
- /// K线数据
- @property (nonatomic, strong, setter = setChartDataArray:) NSMutableArray *chartDataArray;
- /// 商品最小变动单位
- @property (nonatomic, strong) NSDecimalNumber *minUnit;
- /// 最小交易数量小数位
- @property (nonatomic, strong) NSDecimalNumber *numMinUnit;
- /// 图表类型,默认为分时图
- @property (nonatomic, assign) ChartViewType chartViewType;
- /// 数据周期间隔秒数,比如1分钟K线为60.0f,1日线为1440.0f
- @property (nonatomic, assign) NSTimeInterval cycleInterval;
- /// 图表指标类型,默认为MACD
- @property (nonatomic, assign) ChartTargetType chartTargetType;
- /**
- 分时图相关清除的数据,比如休市期补的数据等,正确设置此值以保证数据能够正确到达x轴最后
- */
- /// 传分时图结算计划
- @property (nonatomic, strong) NSArray<NSDictionary<NSString *, NSDate *> *> *reckonDetails;
- /// 交易日应有数据个数
- @property (nonatomic, assign) NSInteger tsCount;
- #pragma mark - 显示成员
- /// 图表绘制底色红色
- @property (nonatomic,assign) CGFloat bgRed;
- /// 图表绘制底色绿色
- @property (nonatomic,assign) CGFloat bgGreen;
- /// 图表绘制底色蓝色
- @property (nonatomic,assign) CGFloat bgBlue;
- /// 轴线颜色
- @property (nonatomic,strong) UIColor *lineColor;
- /// 字体颜色
- @property (nonatomic,strong) UIColor *titleColor;
- /// 文本的字体
- @property (nonatomic,strong) UIFont *titleFont;
- /// 是否显示现价的判断标志,默认为YES
- @property (nonatomic,assign) BOOL isShowPrice;
- /// K线阴块红色值
- @property (nonatomic,assign) CGFloat decKRed;
- /// K线阴块绿色值
- @property (nonatomic,assign) CGFloat decKGreen;
- /// K线阴块蓝色值
- @property (nonatomic,assign) CGFloat decKBlue;
- /// K线阴块alpha值
- @property (nonatomic,assign) CGFloat decKAlpha;
- /// K线阳块红色值
- @property (nonatomic,assign) CGFloat aesKRed;
- /// K线阳块绿色值
- @property (nonatomic,assign) CGFloat aesKGreen;
- /// K线阳块蓝色值
- @property (nonatomic,assign) CGFloat aesKBlue;
- /// K线阳块alpha值
- @property (nonatomic,assign) CGFloat aesKAlpha;
- /// K线平块红色值
- @property (nonatomic,assign) CGFloat samKRed;
- /// K线平块绿色值
- @property (nonatomic,assign) CGFloat samKGreen;
- /// K线平块蓝色值
- @property (nonatomic,assign) CGFloat samKBlue;
- /// K线平块alpha值
- @property (nonatomic,assign) CGFloat samKAlpha;
- /// 十字线红色值
- @property (nonatomic,assign) CGFloat tipRed;
- /// 十字线绿色值
- @property (nonatomic,assign) CGFloat tipGreen;
- /// 十字线蓝色值
- @property (nonatomic,assign) CGFloat tipBlue;
- /// 十字线alpha值
- @property (nonatomic,assign) CGFloat tipAlpha;
- /// 十字线标题颜色对象
- @property (nonatomic,strong) UIColor *tipTitleColor;
- /// priceGreenColor
- @property (nonatomic,strong) UIColor *priceGreenColor;
- /// K线MA5平均线红色值
- @property (nonatomic,assign) CGFloat kMA5Red;
- /// K线MA5平均线绿色值
- @property (nonatomic,assign) CGFloat kMA5Green;
- /// K线MA5平均线蓝色值
- @property (nonatomic,assign) CGFloat kMA5Blue;
- /// K线MA5平均线alpha值
- @property (nonatomic,assign) CGFloat kMA5Alpha;
- /// K线MA10平均线红色值
- @property (nonatomic,assign) CGFloat kMA10Red;
- /// K线MA10平均线绿色值
- @property (nonatomic,assign) CGFloat kMA10Green;
- /// K线MA10平均线蓝色值
- @property (nonatomic,assign) CGFloat kMA10Blue;
- /// K线MA10平均线alpha值
- @property (nonatomic,assign) CGFloat kMA10Alpha;
- /// K线MA15平均线红色值
- @property (nonatomic,assign) CGFloat kMA15Red;
- /// K线MA15平均线绿色值
- @property (nonatomic,assign) CGFloat kMA15Green;
- /// K线MA15平均线蓝色值
- @property (nonatomic,assign) CGFloat kMA15Blue;
- /// K线MA15平均线alpha值
- @property (nonatomic,assign) CGFloat kMA15Alpha;
- /// 分时线红色值
- @property (nonatomic,assign) CGFloat tsRed;
- /// 分时线绿色值
- @property (nonatomic,assign) CGFloat tsGreen;
- /// 分时线蓝色值
- @property (nonatomic,assign) CGFloat tsBlue;
- /// 分时线alpha值
- @property (nonatomic,assign) CGFloat tsAlpha;
- /// 分时MA线红色值
- @property (nonatomic,assign) CGFloat tsMARed;
- /// 分时MA线绿色值
- @property (nonatomic,assign) CGFloat tsMAGreen;
- /// 分时MA线蓝色值
- @property (nonatomic,assign) CGFloat tsMABlue;
- /// 分时MA线alpha值
- @property (nonatomic,assign) CGFloat tsMAAlpha;
- /// 分时昨收线红色值
- @property (nonatomic,assign) CGFloat preCloseLineRed;
- /// 分时昨收线绿色值
- @property (nonatomic,assign) CGFloat preCloseLineGreen;
- /// 分时昨收线蓝色值
- @property (nonatomic,assign) CGFloat preCloseLineBlue;
- /// 分时昨收线alpha值
- @property (nonatomic,assign) CGFloat preCloseLineAlpha;
- /// MACD DIF线红色值
- @property (nonatomic,assign) CGFloat macdDIFRed;
- /// MACD DIF线绿色值
- @property (nonatomic,assign) CGFloat macdDIFGreen;
- /// MACD DIF线蓝色值
- @property (nonatomic,assign) CGFloat macdDIFBlue;
- /// MACD DIF线alpha值
- @property (nonatomic,assign) CGFloat macdDIFAlpha;
- /// MACD DEA线红色值
- @property (nonatomic,assign) CGFloat macdDEARed;
- /// MACD DEA线绿色值
- @property (nonatomic,assign) CGFloat macdDEAGreen;
- /// MACD DEA线蓝色值
- @property (nonatomic,assign) CGFloat macdDEABlue;
- /// MACD DEA线alpha值
- @property (nonatomic,assign) CGFloat macdDEAAlpha;
- /// RSI RSI1线红色值
- @property (nonatomic,assign) CGFloat rsi1Red;
- /// RSI RSI1线绿色值
- @property (nonatomic,assign) CGFloat rsi1Green;
- /// RSI RSI1线蓝色值
- @property (nonatomic,assign) CGFloat rsi1Blue;
- /// RSI RSI1线alpha值
- @property (nonatomic,assign) CGFloat rsi1Alpha;
- /// RSI RSI2线红色值
- @property (nonatomic,assign) CGFloat rsi2Red;
- /// RSI RSI2线绿色值
- @property (nonatomic,assign) CGFloat rsi2Green;
- /// RSI RSI2线蓝色值
- @property (nonatomic,assign) CGFloat rsi2Blue;
- /// RSI RSI2线alpha值
- @property (nonatomic,assign) CGFloat rsi2Alpha;
- /// KT KT线红色值
- @property (nonatomic,assign) CGFloat ktRed;
- /// KT KT线绿色值
- @property (nonatomic,assign) CGFloat ktGreen;
- /// KT KT线蓝色值
- @property (nonatomic,assign) CGFloat ktBlue;
- /// KT KT线alpha值
- @property (nonatomic,assign) CGFloat ktAlpha;
- /// JT JT线红色值
- @property (nonatomic,assign) CGFloat jtRed;
- /// JT JT线绿色值
- @property (nonatomic,assign) CGFloat jtGreen;
- /// JT JT线蓝色值
- @property (nonatomic,assign) CGFloat jtBlue;
- /// JT JT线alpha值
- @property (nonatomic,assign) CGFloat jtAlpha;
- /// DT DT线红色值
- @property (nonatomic,assign) CGFloat dtRed;
- /// DT DT线绿色值
- @property (nonatomic,assign) CGFloat dtGreen;
- /// DT DT线蓝色值
- @property (nonatomic,assign) CGFloat dtBlue;
- /// DT DT线alpha值
- @property (nonatomic,assign) CGFloat dtAlpha;
- /// RSI RSI3线红色值
- @property (nonatomic,assign) CGFloat rsi3Red;
- /// RSI RSI3线绿色值
- @property (nonatomic,assign) CGFloat rsi3Green;
- /// RSI RSI3线蓝色值
- @property (nonatomic,assign) CGFloat rsi3Blue;
- /// RSI RSI3线alpha值
- @property (nonatomic,assign) CGFloat rsi3Alpha;
- /// CCI线红色值
- @property (nonatomic,assign) CGFloat cciRed;
- /// CCI线绿色值
- @property (nonatomic,assign) CGFloat cciGreen;
- /// CCI线蓝色值
- @property (nonatomic,assign) CGFloat cciBlue;
- /// CCI线alpha值
- @property (nonatomic,assign) CGFloat cciAlpha;
- /// DAM线红色值
- @property (nonatomic,assign) CGFloat dmaRed;
- /// DAM线绿色值
- @property (nonatomic,assign) CGFloat dmaGreen;
- /// DAM线蓝色值
- @property (nonatomic,assign) CGFloat dmaBlue;
- /// DAM线alpha值
- @property (nonatomic,assign) CGFloat dmaAlpha;
- /// AMA线红色值
- @property (nonatomic,assign) CGFloat amaRed;
- /// AMA线绿色值
- @property (nonatomic,assign) CGFloat amaGreen;
- /// AMA线蓝色值
- @property (nonatomic,assign) CGFloat amaBlue;
- /// AMA线alpha值
- @property (nonatomic,assign) CGFloat amaAlpha;
- /// BIAS BIAS1线红色值
- @property (nonatomic,assign) CGFloat bias1Red;
- /// BIAS BIAS1线绿色值
- @property (nonatomic,assign) CGFloat bias1Green;
- /// BIAS BIAS1线蓝色值
- @property (nonatomic,assign) CGFloat bias1Blue;
- /// BIAS BIAS1线alpha值
- @property (nonatomic,assign) CGFloat bias1Alpha;
- /// BIAS BIAS2线红色值
- @property (nonatomic,assign) CGFloat bias2Red;
- /// BIAS BIAS2线绿色值
- @property (nonatomic,assign) CGFloat bias2Green;
- /// BIAS BIAS2线蓝色值
- @property (nonatomic,assign) CGFloat bias2Blue;
- /// BIAS BIAS2线alpha值
- @property (nonatomic,assign) CGFloat bias2Alpha;
- /// BIAS BIAS3线红色值
- @property (nonatomic,assign) CGFloat bias3Red;
- /// BIAS BIAS3线绿色值
- @property (nonatomic,assign) CGFloat bias3Green;
- /// BIAS BIAS3线蓝色值
- @property (nonatomic,assign) CGFloat bias3Blue;
- /// BIAS BIAS3线alpha值
- @property (nonatomic,assign) CGFloat bias3Alpha;
- /// PSY PSY线红色值
- @property (nonatomic,assign) CGFloat psyRed;
- /// PSY PSY线绿色值
- @property (nonatomic,assign) CGFloat psyGreen;
- /// PSY PSY线蓝色值
- @property (nonatomic,assign) CGFloat psyBlue;
- /// PSY PSY线alpha值
- @property (nonatomic,assign) CGFloat psyAlpha;
- /// PSYMA PSYMA线红色值
- @property (nonatomic,assign) CGFloat psymaRed;
- /// PSYMA PSYMA线绿色值
- @property (nonatomic,assign) CGFloat psymaGreen;
- /// PSYMA PSYMA线蓝色值
- @property (nonatomic,assign) CGFloat psymaBlue;
- /// PSYMA PSYMA线alpha值
- @property (nonatomic,assign) CGFloat psymaAlpha;
- #pragma mark - 位置成员
- /// Y轴上边距,默认为10.0f
- @property (nonatomic,assign) CGFloat yAxisPaddingTop;
- /// Y轴下边距,默认为25.0f
- @property (nonatomic,assign) CGFloat yAxisPaddingBottom;
- #pragma mark - 交互成员
- /// 移动手势递增量
- @property (nonatomic,assign) NSInteger panGestureIncrement;
- #pragma mark - 分时图专用
- /// 昨收价
- @property (nonatomic, strong) NSDecimalNumber *preClose;
- /// 开盘时间字符串
- @property (nonatomic, strong) NSDate *tsStartTime;
- /// 收盘时间字符串
- @property (nonatomic, strong) NSDate *tsCloseTime;
- #pragma mark - 指标专用
- /// 指标框高度
- @property (nonatomic, assign) CGFloat indicatorHight;
- /// 是否显示指标,默认为YES
- @property (nonatomic, assign, setter=setIsShowIndicator:) BOOL isShowIndicator;
- #pragma mark - 开高低收专用
- /// 是否显示开高低收,默认为NO (不是用来长按十字线的)
- @property (nonatomic,assign,setter=setIsShowOHLP:) BOOL isShowOHLP;
- /// 是否是币币的商品
- @property (nonatomic,assign,setter=setIsBBGoods:) BOOL isBBGoods;
- #pragma mark - 公开方法
- /**
- * @brief 初始化方法,一般在buildView时调用
- *
- * @param chartViewType 图表类型
- * @param frame frame
- *
- * @return self
- */
- - (instancetype)initWithType:(ChartViewType)chartViewType frame:(CGRect)frame;
- /**
- * @brief 初始化图表 (图表初始化时调用)
- */
- - (void)initChartView;
- /**
- * @brief 切换图表类型的方法,一般在用户点击分时图或K线周期时调用
- *
- * @param chartViewType 目标切换图表类型
- * @param chartDataArray 图表数据
- */
- - (void)changeChartType:(ChartViewType)chartViewType chartDataArray:(NSMutableArray *)chartDataArray;
- /**
- * @brief 追加图表数据的方法,一般在图表刷新(包括自动刷新)时调用
- *
- * @param appendChartDataArray 追加的图表数据
- */
- - (void)appendChartDataArray:(NSMutableArray *)appendChartDataArray;
- /**
- * @brief 让图表恢复正常状态的方法。可在十字线显示时离开ViewController等情况下调用。
- */
- - (void)restoreNormalState;
- /**
- 清空图表的方法
- */
- - (void)clear;
- #pragma mark - 手势相关
- /**
- * @brief 初始化和图标进行交互的相关手势
- */
- - (void)initGestureRecognizer;
- #pragma mark - 指标切换
- /**
- * @brief 切换图表指标类型的方法
- */
- - (void)changeChartTargetType:(ChartTargetType)chartTargetType;
- #pragma mark - 追加行情
- /**
- * @brief 追加行情现价的方法。
- *
- * @param price 行情现价
- * @param priceTime 行情时间
- * @param lastVolume 成交量
- *
- */
- - (ChartErrorType)appendQuotaPrice:(NSDecimalNumber *)price priceTime:(NSDate *)priceTime lastVolume:(NSDecimalNumber *)lastVolume;
- #pragma mark - 颜色设置
- /**
- * @brief 设置K线阴块颜色的方法
- *
- * @param decKRed K线阴块红色值
- * @param decKGreen K线阴块绿色值
- * @param decKBlue K线阴块蓝色值
- * @param decKAlpha K线阴块alpha值
- */
- - (void)setDecKRed:(CGFloat)decKRed decKGreen:(CGFloat)decKGreen decKBlue:(CGFloat)decKBlue decKAlpha:(CGFloat)decKAlpha;
- /**
- * @brief 设置K线阳块颜色的方法
- *
- * @param aesKRed K线阳块红色值
- * @param aesKGreen K线阳块绿色值
- * @param aesKBlue K线阳块蓝色值
- * @param aesKAlpha K线阳块alpha值
- */
- - (void)setAesKRed:(CGFloat)aesKRed aesKGreen:(CGFloat)aesKGreen aesKBlue:(CGFloat)aesKBlue aesKAlpha:(CGFloat)aesKAlpha;
- /**
- * @brief 设置K线平块颜色的方法
- *
- * @param samKRed K线平块红色值
- * @param samKGreen K线平块绿色值
- * @param samKBlue K线平块蓝色值
- * @param samKAlpha K线平块alpha值
- */
- - (void)setSamKRed:(CGFloat)samKRed samKGreen:(CGFloat)samKGreen samKBlue:(CGFloat)samKBlue samKAlpha:(CGFloat)samKAlpha;
- /**
- * @brief 设置十字线颜色的方法
- *
- * @param tipRed 十字线红色值
- * @param tipGreen 十字线绿色值
- * @param tipBlue 十字线蓝色值
- * @param tipAlpha 十字线alpha值
- * @param tipTitleColor 十字线标题颜色对象
- */
- - (void)setTipRed:(CGFloat)tipRed tipGreen:(CGFloat)tipGreen tipBlue:(CGFloat)tipBlue tipAlpha:(CGFloat)tipAlpha tipTitleColor:(UIColor *)tipTitleColor;
- /**
- * @brief 设置分时图昨收线颜色的方法
- *
- * @param preCloseLineRed 昨收线红色值
- * @param preCloseLineGreen 昨收线绿色值
- * @param preCloseLineBlue 昨收线蓝色值
- * @param preCloseLineAlpha 昨收线alpha值
- */
- - (void)setPreCloseLineRed:(CGFloat)preCloseLineRed preCloseLineGreen:(CGFloat)preCloseLineGreen preCloseLineBlue:(CGFloat)preCloseLineBlue preCloseLineAlpha:(CGFloat)preCloseLineAlpha;
- /**
- * @brief 设置K线MA5平均线颜色的方法
- *
- * @param kMA5Red K线MA5平均线红色值
- * @param kMA5Green K线MA5平均线绿色值
- * @param kMA5Blue K线MA5平均线蓝色值
- * @param kMA5Alpha K线MA5平均线alpha值
- */
- - (void)setkMA5Red:(CGFloat)kMA5Red kMA5Green:(CGFloat)kMA5Green kMA5Blue:(CGFloat)kMA5Blue kMA5Alpha:(CGFloat)kMA5Alpha;
- /**
- * @brief 设置K线MA10平均线颜色的方法
- *
- * @param kMA10Red K线MA10平均线红色值
- * @param kMA10Green K线MA10平均线绿色值
- * @param kMA10Blue K线MA10平均线蓝色值
- * @param kMA10Alpha K线MA10平均线alpha值
- */
- - (void)setkMA10Red:(CGFloat)kMA10Red kMA10Green:(CGFloat)kMA10Green kMA10Blue:(CGFloat)kMA10Blue kMA10Alpha:(CGFloat)kMA10Alpha;
- /**
- * @brief 设置K线MA15平均线颜色的方法
- *
- * @param kMA15Red K线MA15平均线红色值
- * @param kMA15Green K线MA15平均线绿色值
- * @param kMA15Blue K线MA15平均线蓝色值
- * @param kMA15Alpha K线MA15平均线alpha值
- */
- - (void)setkMA15Red:(CGFloat)kMA15Red kMA15Green:(CGFloat)kMA15Green kMA15Blue:(CGFloat)kMA15Blue kMA15Alpha:(CGFloat)kMA15Alpha;
- /**
- * @brief 设置开高低收报价字体颜色为绿色时的颜色
- */
- - (void)setPriceGreenColor:(UIColor *)priceGreenColor;
- /**
- * @brief 设置分时线颜色的方法
- *
- * @param tsRed 分时线红色值
- * @param tsGreen 分时线绿色值
- * @param tsBlue 分时线蓝色值
- * @param tsAlpha 分时线alpha值
- */
- - (void)setTsRed:(CGFloat)tsRed tsGreen:(CGFloat)tsGreen tsBlue:(CGFloat)tsBlue tsAlpha:(CGFloat)tsAlpha;
- /**
- * @brief 设置分时MA线颜色的方法
- *
- * @param tsMARed 分时MA线红色值
- * @param tsMAGreen 分时MA线绿色值
- * @param tsMABlue 分时MA线蓝色值
- * @param tsMAAlpha 分时MA线alpha值
- */
- - (void)setTsMARed:(CGFloat)tsMARed tsMAGreen:(CGFloat)tsMAGreen tsMABlue:(CGFloat)tsMABlue tsMAAlpha:(CGFloat)tsMAAlpha;
- /**
- * @brief 设置MACD DIF线颜色的方法
- *
- * @param macdDIFRed MACD DIF线红色值
- * @param macdDIFGreen MACD DIF线绿色值
- * @param macdDIFBlue MACD DIF线蓝色值
- * @param macdDIFAlpha MACD DIF线alpha值
- */
- - (void)setMacdDIFRed:(CGFloat)macdDIFRed macdDIFGreen:(CGFloat)macdDIFGreen macdDIFBlue:(CGFloat)macdDIFBlue macdDIFAlpha:(CGFloat)macdDIFAlpha;
- /**
- * @brief 设置MACD DEA线颜色的方法
- *
- * @param macdDEARed MACD DEA线红色值
- * @param macdDEAGreen MACD DEA线绿色值
- * @param macdDEABlue MACD DEA线蓝色值
- * @param macdDEAAlpha MACD DEA线alpha值
- */
- - (void)setMacdDEARed:(CGFloat)macdDEARed macdDEAGreen:(CGFloat)macdDEAGreen macdDEABlue:(CGFloat)macdDEABlue macdDEAAlpha:(CGFloat)macdDEAAlpha;
- /**
- * @brief 设置RSI RSI1线颜色的方法
- *
- * @param rsi1Red RSI RSI1线红色值
- * @param rsi1Green RSI RSI1线绿色值
- * @param rsi1Blue RSI RSI1线蓝色值
- * @param rsi1Alpha RSI RSI1线alpha值
- */
- - (void)setRSI1Red:(CGFloat)rsi1Red rsi1Green:(CGFloat)rsi1Green rsi1Blue:(CGFloat)rsi1Blue rsi1Alpha:(CGFloat)rsi1Alpha;
- /**
- * @brief 设置RSI RSI2线颜色的方法
- *
- * @param rsi2Red RSI RSI2线红色值
- * @param rsi2Green RSI RSI2线绿色值
- * @param rsi2Blue RSI RSI2线蓝色值
- * @param rsi2Alpha RSI RSI2线alpha值
- */
- - (void)setRSI2Red:(CGFloat)rsi2Red rsi2Green:(CGFloat)rsi2Green rsi2Blue:(CGFloat)rsi2Blue rsi2Alpha:(CGFloat)rsi2Alpha;
- /**
- * @brief 设置RSI3线颜色的方法
- *
- * @param rsi3Red RSI3线红色值
- * @param rsi3Green RSI RSI3线绿色值
- * @param rsi3Blue RSI3线蓝色值
- * @param rsi3Alpha RSI3线alpha值
- */
- - (void)setRSI3Red:(CGFloat)rsi3Red rsi3Green:(CGFloat)rsi3Green rsi3Blue:(CGFloat)rsi3Blue rsi3Alpha:(CGFloat)rsi3Alpha;
- /**
- * @brief 设置KT KT线颜色的方法
- *
- * @param ktRed KT线红色值
- * @param ktGreen KT线绿色值
- * @param ktBlue KT线蓝色值
- * @param ktAlpha KT线alpha值
- */
- - (void)setKTRed:(CGFloat)ktRed ktGreen:(CGFloat)ktGreen ktBlue:(CGFloat)ktBlue ktAlpha:(CGFloat)ktAlpha;
- /**
- * @brief 设置DT DT线颜色的方法
- *
- * @param dtRed DT DT线红色值
- * @param dtGreen DT DT线绿色值
- * @param dtBlue DT DT线蓝色值
- * @param dtAlpha DT DT线alpha值
- */
- - (void)setDTRed:(CGFloat)dtRed dtGreen:(CGFloat)dtGreen dtBlue:(CGFloat)dtBlue dtAlpha:(CGFloat)dtAlpha;
- /**
- * @brief 设置JT JT线颜色的方法
- *
- * @param jtRed JT JT线红色值
- * @param jtGreen JT JT线绿色值
- * @param jtBlue JT JT线蓝色值
- * @param jtAlpha JT JT线alpha值
- */
- - (void)setJTRed:(CGFloat)jtRed jtGreen:(CGFloat)jtGreen jtBlue:(CGFloat)jtBlue jtAlpha:(CGFloat)jtAlpha;
- /**
- * @brief 设置CCI CCI线颜色的方法
- *
- * @param cciRed CCI CCI线红色值
- * @param cciGreen CCI CCI线绿色值
- * @param cciBlue CCI CCI线蓝色值
- * @param cciAlpha CCI CCI线alpha值
- */
- - (void)setCCIRed:(CGFloat)cciRed cciGreen:(CGFloat)cciGreen cciBlue:(CGFloat)cciBlue cciAlpha:(CGFloat)cciAlpha;
- /**
- * @brief 设置DMA线颜色的方法
- *
- * @param dmaRed DMA线红色值
- * @param dmaGreen DMA线绿色值
- * @param dmaBlue DMA线蓝色值
- * @param dmaAlpha DMA线alpha值
- */
- - (void)setDMARed:(CGFloat)dmaRed dmaGreen:(CGFloat)dmaGreen cciBlue:(CGFloat)dmaBlue cciAlpha:(CGFloat)dmaAlpha;
- /**
- * @brief 设置AMA线颜色的方法
- *
- * @param amaRed AMA线红色值
- * @param amaGreen AMA线绿色值
- * @param amaBlue AMA线蓝色值
- * @param amaAlpha AMA线alpha值
- */
- - (void)setAMARed:(CGFloat)amaRed amaGreen:(CGFloat)amaGreen cciBlue:(CGFloat)amaBlue cciAlpha:(CGFloat)amaAlpha;
- /**
- * @brief 设置BIAS BIAS1线颜色的方法
- *
- * @param bias1Red BIAS BIAS1线红色值
- * @param bias1Green BIAS BIAS1线绿色值
- * @param bias1Blue BIAS BIAS1线蓝色值
- * @param bias1Alpha BIAS BIAS1线alpha值
- */
- - (void)setBIAS1Red:(CGFloat)bias1Red bias1Green:(CGFloat)bias1Green bias1Blue:(CGFloat)bias1Blue bias1Alpha:(CGFloat)bias1Alpha;
- /**
- * @brief 设置BIAS BIAS2线颜色的方法
- *
- * @param bias2Red BIAS BIAS2线红色值
- * @param bias2Green BIAS BIAS2线绿色值
- * @param bias2Blue BIAS BIAS2线蓝色值
- * @param bias2Alpha BIAS BIAS2线alpha值
- */
- - (void)setBIAS2Red:(CGFloat)bias2Red bias2Green:(CGFloat)bias2Green bias2Blue:(CGFloat)bias2Blue bias2Alpha:(CGFloat)bias2Alpha;
- /**
- * @brief 设置BIAS BIAS3线颜色的方法
- *
- * @param bias3Red BIAS BIAS3线红色值
- * @param bias3Green BIAS BIAS3线绿色值
- * @param bias3Blue BIAS BIAS3线蓝色值
- * @param bias3Alpha BIAS BIAS3线alpha值
- */
- - (void)setBIAS3Red:(CGFloat)bias3Red bias3Green:(CGFloat)bias3Green bias3Blue:(CGFloat)bias3Blue bias3Alpha:(CGFloat)bias3Alpha;
- /**
- * @brief 设置PSY PSY线颜色的方法
- *
- * @param psyRed PSY PSY线红色值
- * @param psyGreen PSY PSY线绿色值
- * @param psyBlue PSY PSY线蓝色值
- * @param psyAlpha PSY PSY线alpha值
- */
- - (void)setPSYRed:(CGFloat)psyRed psyGreen:(CGFloat)psyGreen psyBlue:(CGFloat)psyBlue psyAlpha:(CGFloat)psyAlpha;
- /**
- * @brief 设置PSYMA PSYMA线颜色的方法
- *
- * @param psymaRed PSYMA PSYMA线红色值
- * @param psymaGreen PSYMA PSYMA线绿色值
- * @param psymaBlue PSYMA PSYMA线蓝色值
- * @param psymaAlpha PSYMA PSYMA线alpha值
- */
- - (void)setPSYMARed:(CGFloat)psymaRed psymaGreen:(CGFloat)psymaGreen psymaBlue:(CGFloat)psymaBlue psymaAlpha:(CGFloat)psymaAlpha;
- @end
- #pragma mark - ChartViewDelegate
- /**
- * @brief 图表委托协议
- */
- @protocol ChartViewDelegate <NSObject>
- /**
- * @brief 图表请求上层使用者刷新图表数据(从行情历史)的方法,一般在数据出现异常时触发(比如追加行情时间与图表最新数据块已经超时一个时间周期等)
- *
- * @param errorCode 异常代码
- */
- - (void)requestRefreshChartDataWithErrorCode:(ChartErrorType)errorCode;
- /**
- * @brief 由于处理行情而造成图表数据最新时间变动时触发
- *
- * @param lasttime 图表数据最新时间
- */
- - (void)onChangeDataLasttime:(NSDate *)lasttime;
- @optional
- /**
- * @brief 拖到图表到达第一个数据的时候触发
- */
- - (void)onPanChartDataToTop;
- @optional
- /**
- 当第一次完成数据初始化时回调
- @param targets 有数据的指标类型数组
- */
- - (void)onFinishInitDataWithTargets:(NSArray<NSString *> *)targets;
- @end
|