No description
Find a file
Antonio Hickey 1cbe1643a0
Some checks failed
pre-commit / pre-commit (push) Has been cancelled
build: add .gitignore file
2025-11-19 23:12:40 -05:00
.github/workflows starting point 🦎 2025-05-21 21:29:26 -04:00
examples refactor(lang/std lib): move indicator builder into std lib 2025-07-06 13:52:11 -04:00
src WIP squash me 2025-11-19 23:10:53 -05:00
tests refactor(std lib: Trade): clean up state mutation on trades 2025-10-14 23:18:24 -04:00
.gitignore build: add .gitignore file 2025-11-19 23:12:40 -05:00
.pre-commit-config.yaml starting point 🦎 2025-05-21 21:29:26 -04:00
Cargo.lock refactor(std lib): redesign @Order and @Trade 2025-08-16 14:54:12 -04:00
Cargo.toml feat(lang): a built in time expression 2025-07-04 01:56:37 -04:00
LICENSE prepare for initial release 2025-05-21 23:20:37 -04:00
README.md refactor: fix formatting issues 2025-06-21 13:05:03 -04:00

Vexity 🦎

Vexity is a tiny Domain Specific Language aimed at hacking on abstractions of financial markets.

🚧🦺👷Early Development, things will be breaking frequently 👷🦺🚧

License

This library is licensed under the Apache License 2.0.

Example

Create a simple moving average indicator:

Indicator
  .config({
    # Define a custom configuration for the
    # indicator, this is for static data.

    name: "Simple Moving Average",
    sma_window_size: 50,
    sma_color: "orange"
  })
  .init(|state| {
    # Define the initialization logic for the
    # indicator, this is for dynamic data.

    state bars = []
  })
  .on_bar(|bar, cfg, state| {
    # Define the logic for computing the indicator
    # value of each bar or tick of trading activity.

    # Update the state of the data array
    state.bars.push(bar)

    # Define the data window
    let data_window = state
      .bars
      .last(cfg.sma_window_size)
      .map(|bar| bar.close)

    # Compute the sma value of the data window
    let sma_value = sma(data_window)

    # Return the indicator value
    { time: bar.time, value: sma_value, color: cfg.sma_color }
  })