discretionary_engine_risk

Crates.iodiscretionary_engine_risk
lib.rsdiscretionary_engine_risk
version1.0.0
created_at2025-12-25 00:31:31.574213+00
updated_at2025-12-25 00:31:31.574213+00
descriptionMy engine for risk-management
homepagehttps://github.com/valeratrades/discretionary_engine_risk
repositoryhttps://github.com/valeratrades/discretionary_engine_risk
max_upload_size
id2004040
size241,519
Valeriy Sakharov (valeratrades)

documentation

https://docs.rs/discretionary_engine_risk

README

discretionary_engine_risk

Minimum Supported Rust Version crates.io docs.rs Lines Of Code
ci errors ci warnings

Usage

discretionary_engine_risk size binance:btc-usdt --percent-sl 2%

can configure using .nix because why wouldn't you be able to. Who needs tomls when you can just nix. The final config form. Ex in [../examples/config.nix]. // You can .toml it too, if you wanna be lame

Roadmap

size command

Goal

want to be able to quickly get correct size I need to use when opening a trade on a given ticker, based on expected volatility (in future based on pattern and my trading history with it too, but that's later).

Args

  • coin (exchange doesn't matter, and we ignore liquidity for now, so neither does pair)

  • --sl | -s % away: convert to exact price, print it (small reduction to possible human error) OR exact: print back % away (also to reduce possible human error) OR None: assume 20%

Steps

  • get total balance (today means bybit and binance, all margins (sapi and fapi))

  • get coin's price

  • risk est, mul the with default % of depo Large, requires a

Plan

  • 0.1: random criterion based on time it took to go same distance last time.

  • 1.0:

  • make a formula to quantify indirectional-vol

  • take entries from 3x back from the distance it last took to go the SL length

  • Exponentially weigh them, feed into da formula

  • trial and error the answer. Get any starting point, use the thing to trade, adjust as the intuition of this develops

Optimisations

  • make all requests in one bunch, then after one comes through, check if we still need to await the rest.

Problems

  • could have existing, correlatory with target, positions (ignore for now)

Blockers

  • way of quantifying indirectional volatility


This repository follows my best practices and Tiger Style (except "proper capitalization for acronyms": (VsrState, not VSRState) and formatting).

License

Licensed under Blue Oak 1.0.0
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be licensed as above, without any additional terms or conditions.
Commit count: 0

cargo fmt