#[repr(i32)]pub enum CustomIndicatorField {
Show 29 variants
Unknown = 0,
Price = 1,
Ma5 = 2,
Ma10 = 3,
Ma20 = 4,
Ma30 = 5,
Ma60 = 6,
Ma120 = 7,
Ma250 = 8,
Rsi = 9,
Ema5 = 10,
Ema10 = 11,
Ema20 = 12,
Ema30 = 13,
Ema60 = 14,
Ema120 = 15,
Ema250 = 16,
Value = 17,
Ma = 30,
Ema = 40,
KdjK = 50,
KdjD = 51,
KdjJ = 52,
MacdDiff = 60,
MacdDea = 61,
Macd = 62,
BollUpper = 70,
BollMiddler = 71,
BollLower = 72,
}Expand description
自定义技术指标属性
Variants§
Unknown = 0
未知
Price = 1
最新价格
Ma5 = 2
5日简单均线(不建议使用)
Ma10 = 3
10日简单均线 (不建议使用)
Ma20 = 4
20日简单均线 (不建议使用)
Ma30 = 5
30日简单均线 (不建议使用)
Ma60 = 6
60日简单均线 (不建议使用)
Ma120 = 7
120日简单均线(不建议使用)
Ma250 = 8
250日简单均线(不建议使用)
Rsi = 9
RSI 指标参数的默认值为12
Ema5 = 10
5日指数移动均线 (不建议使用)
Ema10 = 11
10日指数移动均线 (不建议使用)
Ema20 = 12
20日指数移动均线 (不建议使用)
Ema30 = 13
30日指数移动均线 (不建议使用)
Ema60 = 14
60日指数移动均线 (不建议使用)
Ema120 = 15
120日指数移动均线(不建议使用)
Ema250 = 16
250日指数移动均线(不建议使用)
Value = 17
自定义数值(stock_field1 不支持此字段)
Ma = 30
简单均线
Ema = 40
指数移动均线
KdjK = 50
KDJ 指标的 K 值。指标参数需要根据 KDJ 进行传参。不传则默认为 [9,3,3]
KdjD = 51
KDJ 指标的 D 值。指标参数需要根据 KDJ 进行传参。不传则默认为 [9,3,3]
KdjJ = 52
KDJ 指标的 J 值。指标参数需要根据 KDJ 进行传参。不传则默认为 [9,3,3]
MacdDiff = 60
MACD 指标的 DIFF 值。指标参数需要根据 MACD 进行传参。不传则默认为 [12,26,9]
MacdDea = 61
MACD 指标的 DEA 值。指标参数需要根据 MACD 进行传参。不传则默认为 [12,26,9]
Macd = 62
MACD 指标的 MACD 值。指标参数需要根据 MACD 进行传参。不传则默认为 [12,26,9]
BollUpper = 70
BOLL 指标的 UPPER 值。指标参数需要根据 BOLL 进行传参。不传则默认为 [20,2]
BollMiddler = 71
BOLL 指标的 MIDDLER 值。指标参数需要根据 BOLL 进行传参。不传则默认为 [20,2]
BollLower = 72
BOLL 指标的 LOWER 值。指标参数需要根据 BOLL 进行传参。不传则默认为 [20,2]
Implementations§
Source§impl CustomIndicatorField
impl CustomIndicatorField
Sourcepub const fn is_valid(value: i32) -> bool
pub const fn is_valid(value: i32) -> bool
Returns true if value is a variant of CustomIndicatorField.
Sourcepub fn from_i32(value: i32) -> Option<CustomIndicatorField>
👎Deprecated: Use the TryFrom<i32> implementation instead
pub fn from_i32(value: i32) -> Option<CustomIndicatorField>
Use the TryFrom<i32> implementation instead
Converts an i32 to a CustomIndicatorField, or None if value is not a valid variant.
Source§impl CustomIndicatorField
impl CustomIndicatorField
Sourcepub fn as_str_name(&self) -> &'static str
pub fn as_str_name(&self) -> &'static str
String value of the enum field names used in the ProtoBuf definition.
The values are not transformed in any way and thus are considered stable (if the ProtoBuf definition does not change) and safe for programmatic use.
Sourcepub fn from_str_name(value: &str) -> Option<Self>
pub fn from_str_name(value: &str) -> Option<Self>
Creates an enum from field names used in the ProtoBuf definition.
Trait Implementations§
Source§impl Clone for CustomIndicatorField
impl Clone for CustomIndicatorField
Source§fn clone(&self) -> CustomIndicatorField
fn clone(&self) -> CustomIndicatorField
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for CustomIndicatorField
Source§impl Debug for CustomIndicatorField
impl Debug for CustomIndicatorField
Source§impl Default for CustomIndicatorField
impl Default for CustomIndicatorField
Source§fn default() -> CustomIndicatorField
fn default() -> CustomIndicatorField
Source§impl<'de> Deserialize<'de> for CustomIndicatorField
impl<'de> Deserialize<'de> for CustomIndicatorField
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for CustomIndicatorField
Source§impl From<CustomIndicatorField> for i32
impl From<CustomIndicatorField> for i32
Source§fn from(value: CustomIndicatorField) -> i32
fn from(value: CustomIndicatorField) -> i32
Source§impl Hash for CustomIndicatorField
impl Hash for CustomIndicatorField
Source§impl Ord for CustomIndicatorField
impl Ord for CustomIndicatorField
Source§fn cmp(&self, other: &CustomIndicatorField) -> Ordering
fn cmp(&self, other: &CustomIndicatorField) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for CustomIndicatorField
impl PartialEq for CustomIndicatorField
Source§fn eq(&self, other: &CustomIndicatorField) -> bool
fn eq(&self, other: &CustomIndicatorField) -> bool
self and other values to be equal, and is used by ==.