Skip to content

Commit

Permalink
add suppport overnight order
Browse files Browse the repository at this point in the history
  • Loading branch information
sunli829 committed May 15, 2024
1 parent dd7643d commit e7bd703
Show file tree
Hide file tree
Showing 11 changed files with 25 additions and 2 deletions.
1 change: 1 addition & 0 deletions c/csrc/include/longport.h
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,7 @@ typedef enum lb_outside_rth_t {
* Any time
*/
OutsideRTHAnyTime,
OutsideRTHOvernight,
} lb_outside_rth_t;

/**
Expand Down
2 changes: 2 additions & 0 deletions c/src/trade_context/enum_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,8 @@ pub enum COutsideRTH {
/// Any time
#[c(remote = "AnyTime")]
OutsideRTHAnyTime,
#[c(remote = "Overnight")]
OutsideRTHOvernight,
}

/// Time in force Type
Expand Down
2 changes: 2 additions & 0 deletions cpp/include/types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1311,6 +1311,8 @@ enum class OutsideRTH
RTHOnly,
/// Any time
AnyTime,
/// Overnight
Overnight,
};

/// Order
Expand Down
4 changes: 4 additions & 0 deletions cpp/src/convert.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1162,6 +1162,8 @@ convert(lb_outside_rth_t status)
return OutsideRTH::RTHOnly;
case OutsideRTHAnyTime:
return OutsideRTH::AnyTime;
case OutsideRTHOvernight:
return OutsideRTH::Overnight;
default:
throw std::invalid_argument("unreachable");
}
Expand All @@ -1177,6 +1179,8 @@ convert(OutsideRTH status)
return OutsideRTHOnly;
case OutsideRTH::AnyTime:
return OutsideRTHAnyTime;
case OutsideRTH::Overnight:
return OutsideRTHOvernight;
default:
throw std::invalid_argument("unreachable");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ public enum OutsideRTH {
Unknown,
RTHOnly,
AnyTime,
Overnight,
}
2 changes: 1 addition & 1 deletion java/src/types/enum_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ impl_java_enum!(
impl_java_enum!(
"com/longport/trade/OutsideRTH",
longport::trade::OutsideRTH,
[Unknown, RTHOnly, AnyTime]
[Unknown, RTHOnly, AnyTime, Overnight]
);

impl_java_enum!(
Expand Down
4 changes: 3 additions & 1 deletion nodejs/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,9 @@ export const enum OutsideRTH {
/** Regular trading hour only */
RTHOnly = 1,
/** Any time */
AnyTime = 2
AnyTime = 2,
/** Overnight */
Overnight = 3
}
/** Commission-free Status */
export const enum CommissionFreeStatus {
Expand Down
2 changes: 2 additions & 0 deletions nodejs/src/trade/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,8 @@ pub enum OutsideRTH {
RTHOnly,
/// Any time
AnyTime,
/// Overnight
Overnight,
}

/// Order
Expand Down
4 changes: 4 additions & 0 deletions python/pysrc/longport/openapi.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -3700,6 +3700,10 @@ class OutsideRTH:
Any time
"""

class Overnight(OutsideRTH):
"""
Overnight
"""

class Order:
"""
Expand Down
2 changes: 2 additions & 0 deletions python/src/trade/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,8 @@ pub(crate) enum OutsideRTH {
RTHOnly,
/// Any time
AnyTime,
/// Overnight
Overnight,
}

/// Order
Expand Down
3 changes: 3 additions & 0 deletions rust/src/trade/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,9 @@ pub enum OutsideRTH {
/// Any time
#[strum(serialize = "ANY_TIME")]
AnyTime,
/// Overnight
#[strum(serialize = "OVERNIGHT")]
Overnight,
}

/// Order
Expand Down

0 comments on commit e7bd703

Please sign in to comment.