pub struct GridConfigJson {
pub mode: String,
pub levels: u32,
pub start_price: String,
pub end_price: String,
pub max_investment_quote: String,
pub leverage: String,
pub max_leverage: String,
pub post_only: bool,
pub stop_loss: Option<String>,
pub take_profit: Option<String>,
pub trailing_up_limit: Option<String>,
pub trailing_down_limit: Option<String>,
}Expand description
Grid strategy configuration from JSON
Fields§
§mode: StringGrid mode: “long”, “short”, “neutral”
levels: u32Number of grid levels
start_price: StringStart price of the grid
end_price: StringEnd price of the grid
max_investment_quote: StringMaximum investment in quote currency (USDC)
leverage: StringLeverage to use
max_leverage: StringMaximum leverage allowed (for liquidation calculation)
post_only: boolUse post-only orders
stop_loss: Option<String>Stop loss (optional)
take_profit: Option<String>Take profit (optional)
trailing_up_limit: Option<String>Trailing upper limit price (optional). When set, enables trailing-up: the grid slides up as price rises, until the top of the window would exceed this ceiling.
trailing_down_limit: Option<String>Trailing lower limit price (optional). When set, enables trailing-down: the grid slides down as price falls, until the bottom of the window would go below this floor.
Trait Implementations§
Source§impl Clone for GridConfigJson
impl Clone for GridConfigJson
Source§fn clone(&self) -> GridConfigJson
fn clone(&self) -> GridConfigJson
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GridConfigJson
impl Debug for GridConfigJson
Source§impl<'de> Deserialize<'de> for GridConfigJson
impl<'de> Deserialize<'de> for GridConfigJson
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl JsonSchema for GridConfigJson
impl JsonSchema for GridConfigJson
Source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref keyword. Read moreAuto Trait Implementations§
impl Freeze for GridConfigJson
impl RefUnwindSafe for GridConfigJson
impl Send for GridConfigJson
impl Sync for GridConfigJson
impl Unpin for GridConfigJson
impl UnsafeUnpin for GridConfigJson
impl UnwindSafe for GridConfigJson
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more