Skip to content

Commit

Permalink
add Account events
Browse files Browse the repository at this point in the history
  • Loading branch information
filipmacek committed Nov 28, 2023
1 parent 825799e commit 4b813ee
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
16 changes: 16 additions & 0 deletions nautilus_core/model/src/events/account/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// -------------------------------------------------------------------------------------------------
// Copyright (C) 2015-2023 Nautech Systems Pty Ltd. All rights reserved.
// https://nautechsystems.io
//
// Licensed under the GNU Lesser General Public License Version 3.0 (the "License");
// You may not use this file except in compliance with the License.
// You may obtain a copy of the License at https://www.gnu.org/licenses/lgpl-3.0.en.html
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// -------------------------------------------------------------------------------------------------

pub mod state;
36 changes: 36 additions & 0 deletions nautilus_core/model/src/events/account/state.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// -------------------------------------------------------------------------------------------------
// Copyright (C) 2015-2023 Nautech Systems Pty Ltd. All rights reserved.
// https://nautechsystems.io
//
// Licensed under the GNU Lesser General Public License Version 3.0 (the "License");
// You may not use this file except in compliance with the License.
// You may obtain a copy of the License at https://www.gnu.org/licenses/lgpl-3.0.en.html
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

Check warning on line 13 in nautilus_core/model/src/events/account/state.rs

View workflow job for this annotation

GitHub Actions / build - Python 3.11 (x64 ubuntu-latest)

Diff in /home/runner/work/nautilus_trader/nautilus_trader/nautilus_core/model/src/events/account/state.rs

Check warning on line 13 in nautilus_core/model/src/events/account/state.rs

View workflow job for this annotation

GitHub Actions / build - Python 3.10 (x64 ubuntu-latest)

Diff in /home/runner/work/nautilus_trader/nautilus_trader/nautilus_core/model/src/events/account/state.rs

Check warning on line 13 in nautilus_core/model/src/events/account/state.rs

View workflow job for this annotation

GitHub Actions / build - Python 3.12 (x64 ubuntu-latest)

Diff in /home/runner/work/nautilus_trader/nautilus_trader/nautilus_core/model/src/events/account/state.rs

Check warning on line 13 in nautilus_core/model/src/events/account/state.rs

View workflow job for this annotation

GitHub Actions / build - Python 3.12 (x64 windows-latest)

Diff in \\?\D:\a\nautilus_trader\nautilus_trader\nautilus_core\model\src\events\account\state.rs

Check warning on line 13 in nautilus_core/model/src/events/account/state.rs

View workflow job for this annotation

GitHub Actions / build - Python 3.11 (x64 windows-latest)

Diff in \\?\D:\a\nautilus_trader\nautilus_trader\nautilus_core\model\src\events\account\state.rs

Check warning on line 13 in nautilus_core/model/src/events/account/state.rs

View workflow job for this annotation

GitHub Actions / build - Python 3.10 (x64 windows-latest)

Diff in \\?\D:\a\nautilus_trader\nautilus_trader\nautilus_core\model\src\events\account\state.rs
// -------------------------------------------------------------------------------------------------

use nautilus_core::time::UnixNanos;
use nautilus_core::uuid::UUID4;
use crate::enums::AccountType;
use crate::identifiers::account_id::AccountId;
use crate::types::balance::{AccountBalance, MarginBalance};
use crate::types::currency::Currency;

Check warning on line 21 in nautilus_core/model/src/events/account/state.rs

View workflow job for this annotation

GitHub Actions / build - Python 3.11 (x64 ubuntu-latest)

Diff in /home/runner/work/nautilus_trader/nautilus_trader/nautilus_core/model/src/events/account/state.rs

Check warning on line 21 in nautilus_core/model/src/events/account/state.rs

View workflow job for this annotation

GitHub Actions / build - Python 3.10 (x64 ubuntu-latest)

Diff in /home/runner/work/nautilus_trader/nautilus_trader/nautilus_core/model/src/events/account/state.rs

Check warning on line 21 in nautilus_core/model/src/events/account/state.rs

View workflow job for this annotation

GitHub Actions / build - Python 3.12 (x64 ubuntu-latest)

Diff in /home/runner/work/nautilus_trader/nautilus_trader/nautilus_core/model/src/events/account/state.rs

Check warning on line 21 in nautilus_core/model/src/events/account/state.rs

View workflow job for this annotation

GitHub Actions / build - Python 3.12 (x64 windows-latest)

Diff in \\?\D:\a\nautilus_trader\nautilus_trader\nautilus_core\model\src\events\account\state.rs

Check warning on line 21 in nautilus_core/model/src/events/account/state.rs

View workflow job for this annotation

GitHub Actions / build - Python 3.11 (x64 windows-latest)

Diff in \\?\D:\a\nautilus_trader\nautilus_trader\nautilus_core\model\src\events\account\state.rs

Check warning on line 21 in nautilus_core/model/src/events/account/state.rs

View workflow job for this annotation

GitHub Actions / build - Python 3.10 (x64 windows-latest)

Diff in \\?\D:\a\nautilus_trader\nautilus_trader\nautilus_core\model\src\events\account\state.rs

#[repr(C)]
#[derive(Debug)]
pub struct AccountState{

Check warning on line 25 in nautilus_core/model/src/events/account/state.rs

View workflow job for this annotation

GitHub Actions / build - Python 3.11 (x64 ubuntu-latest)

Diff in /home/runner/work/nautilus_trader/nautilus_trader/nautilus_core/model/src/events/account/state.rs

Check warning on line 25 in nautilus_core/model/src/events/account/state.rs

View workflow job for this annotation

GitHub Actions / build - Python 3.10 (x64 ubuntu-latest)

Diff in /home/runner/work/nautilus_trader/nautilus_trader/nautilus_core/model/src/events/account/state.rs

Check warning on line 25 in nautilus_core/model/src/events/account/state.rs

View workflow job for this annotation

GitHub Actions / build - Python 3.12 (x64 ubuntu-latest)

Diff in /home/runner/work/nautilus_trader/nautilus_trader/nautilus_core/model/src/events/account/state.rs

Check warning on line 25 in nautilus_core/model/src/events/account/state.rs

View workflow job for this annotation

GitHub Actions / build - Python 3.12 (x64 windows-latest)

Diff in \\?\D:\a\nautilus_trader\nautilus_trader\nautilus_core\model\src\events\account\state.rs

Check warning on line 25 in nautilus_core/model/src/events/account/state.rs

View workflow job for this annotation

GitHub Actions / build - Python 3.11 (x64 windows-latest)

Diff in \\?\D:\a\nautilus_trader\nautilus_trader\nautilus_core\model\src\events\account\state.rs

Check warning on line 25 in nautilus_core/model/src/events/account/state.rs

View workflow job for this annotation

GitHub Actions / build - Python 3.10 (x64 windows-latest)

Diff in \\?\D:\a\nautilus_trader\nautilus_trader\nautilus_core\model\src\events\account\state.rs
account_id: AccountId,
account_type: AccountType,
base_currency: Currency,
balances: Vec<AccountBalance>,
margins: Vec<MarginBalance>,
is_reported: bool,
event_idt: UUID4,
ts_event: UnixNanos,
ts_init: UnixNanos,
}

0 comments on commit 4b813ee

Please sign in to comment.