Giter Site home page Giter Site logo

flashfunk's Introduction

FlashFunk

High Frequency Trading Framework

Why choose Rust

fast, safe and avoid ub

Support API

  • ctp 上期所标准API c++ bindings封装 等待开源
  • ctp_mini2 上期所标准API c++ bindings封装 等待开源
  • REM 盛立纯socket对接 -> 未开源

Install

See Install

系统要求

  • stable-x86_64-unknown-linux-gnu - rustc 1.56.0 (09c42c458 2021-10-18) and later

  • linux

  • windows visual studio and llvm

Easy Start

#![allow(dead_code, unused_imports, unused_must_use, unused_variables)]

use std::fmt::Pointer;
use std::thread;

use chrono::{Local, NaiveDateTime};
use flashfunk_level::CtpMdApi;
use flashfunk_level::CtpTdApi;
use flashfunk_core::prelude::*;

struct Strategy {
    local_symbol: Vec<String>,
}

impl Ac for Strategy {
    // tick 信息回报 
    fn on_tick(&mut self, tick: &TickData, ctx: &mut Context) { 
        println!("price: {}", tick.last_price);
    }
    fn codes(&mut self) -> Vec<String> { // 订阅的代码 
        self.local_symbol.iter().clone()
    }
    fn flash_name(&mut self) -> String {  // 名称
        "flashfunk".to_string()
    }
}

fn main() {
    let login_form = LoginForm::new()
        .user_id("089131")
        .password("350888")
        .broke_id("9999")
        .app_id("simnow_client_test")
        .md_address("tcp://218.202.237.33:10213")
        .td_address("tcp://218.202.237.33:10203")
        .auth_code("0000000000000000")
        .production_info("");
    let strategy_1 = Strategy {
        local_symbol: vec!["rb2110".to_string()]
    };
    Flash::builder::<CtpMdApi, CtpTdApi, _>("ctpbee")
        .strategies(vec![Box::new(strategy_1)])
        .id("flashfunk")
        .login_form(login_form)
        .start();
}

flashfunk's People

Contributors

somewheve avatar fakeshadow avatar thesupermyo avatar qzm avatar duckquant avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.