oanda-v20-openapi 0.2.1

The full OANDA v20 API Specification. This specification defines how to interact with v20 Accounts, Trades, Orders, Pricing and more.
Documentation
/*
 * OANDA v20 API
 *
 * The full OANDA v20 API Specification. This specification defines how to interact with v20 Accounts, Trades, Orders, Pricing and more.
 *
 * The version of the OpenAPI document: 0.2.1
 * Contact: jmicoud02@gmail.com
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

/// CalculatedTradeState : The dynamic (calculated) state of an open Trade
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CalculatedTradeState {
    /// The Trade's ID.
    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
    pub id: Option<i32>,
    /// The Trade's unrealized profit/loss.
    #[serde(rename = "unrealizedPL", skip_serializing_if = "Option::is_none")]
    pub unrealized_pl: Option<f64>,
    /// Margin currently used by the Trade.
    #[serde(rename = "marginUsed", skip_serializing_if = "Option::is_none")]
    pub margin_used: Option<f64>,
}

impl CalculatedTradeState {
    /// The dynamic (calculated) state of an open Trade
    pub fn new() -> CalculatedTradeState {
        CalculatedTradeState {
            id: None,
            unrealized_pl: None,
            margin_used: None,
        }
    }
}