kandi background
Explore Kits

vnpy | 基于Python的开源量化交易平台开发框架 | Cryptocurrency library

 by   vnpy Python Version: 2.9.0 License: MIT

 by   vnpy Python Version: 2.9.0 License: MIT

Download this library from

kandi X-RAY | vnpy Summary

vnpy is a Python library typically used in Blockchain, Cryptocurrency applications. vnpy has no bugs, it has no vulnerabilities, it has build file available, it has a Permissive License and it has medium support. You can install using 'pip install vnpy' or download it from GitHub, PyPI.
基于Python的开源量化交易平台开发框架
Support
Support
Quality
Quality
Security
Security
License
License
Reuse
Reuse

kandi-support Support

  • vnpy has a medium active ecosystem.
  • It has 17636 star(s) with 7074 fork(s). There are 1338 watchers for this library.
  • There were 3 major release(s) in the last 12 months.
  • There are 9 open issues and 1860 have been closed. On average issues are closed in 54 days. There are 1 open pull requests and 0 closed requests.
  • It has a neutral sentiment in the developer community.
  • The latest version of vnpy is 2.9.0
vnpy Support
Best in #Cryptocurrency
Average in #Cryptocurrency
vnpy Support
Best in #Cryptocurrency
Average in #Cryptocurrency

quality kandi Quality

  • vnpy has 0 bugs and 0 code smells.
vnpy Quality
Best in #Cryptocurrency
Average in #Cryptocurrency
vnpy Quality
Best in #Cryptocurrency
Average in #Cryptocurrency

securitySecurity

  • vnpy has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
  • vnpy code analysis shows 0 unresolved vulnerabilities.
  • There are 0 security hotspots that need review.
vnpy Security
Best in #Cryptocurrency
Average in #Cryptocurrency
vnpy Security
Best in #Cryptocurrency
Average in #Cryptocurrency

license License

  • vnpy is licensed under the MIT License. This license is Permissive.
  • Permissive licenses have the least restrictions, and you can use them in most projects.
vnpy License
Best in #Cryptocurrency
Average in #Cryptocurrency
vnpy License
Best in #Cryptocurrency
Average in #Cryptocurrency

buildReuse

  • vnpy releases are available to install and integrate.
  • Deployable package is available in PyPI.
  • Build file is available. You can build the component from source.
  • Installation instructions are not available. Examples and code snippets are available.
  • It has 5323 lines of code, 470 functions and 98 files.
  • It has medium code complexity. Code complexity directly impacts maintainability of the code.
vnpy Reuse
Best in #Cryptocurrency
Average in #Cryptocurrency
vnpy Reuse
Best in #Cryptocurrency
Average in #Cryptocurrency
Top functions reviewed by kandi - BETA

Coming Soon for all Libraries!

Currently covering the most popular Java, JavaScript and Python libraries. See a SAMPLE HERE.
kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.

vnpy Key Features

基于Python的开源量化交易平台开发框架

安装步骤

copy iconCopydownload iconDownload
install.bat

脚本运行

copy iconCopydownload iconDownload
from vnpy.event import EventEngine
from vnpy.trader.engine import MainEngine
from vnpy.trader.ui import MainWindow, create_qapp
from vnpy.gateway.ctp import CtpGateway
from vnpy.app.cta_strategy import CtaStrategyApp
from vnpy.app.cta_backtester import CtaBacktesterApp

def main():
    """Start Veighna Trader"""
    qapp = create_qapp()

    event_engine = EventEngine()
    main_engine = MainEngine(event_engine)
    
    main_engine.add_gateway(CtpGateway)
    main_engine.add_app(CtaStrategyApp)
    main_engine.add_app(CtaBacktesterApp)

    main_window = MainWindow(main_engine, event_engine)
    main_window.showMaximized()

    qapp.exec()

if __name__ == "__main__":
    main()

Community Discussions

Trending Discussions on Cryptocurrency
  • Why on printing I get value of null from API call in Loop
  • How to connect Metamask to Web3J (java)
  • Binance API: status: 400, error code: -1013, error message: Filter failure: PRICE_FILTER
  • Solana: Parse Token Data
  • Pinescript security function for colour boolean with mutable variable
  • How do you close a websocket connection if the API page is invalid
  • What token type is ETH on the Polygon network?
  • How to programmatically validate Tether (TRC20) Wallet Addresses in PHP?
  • Multiple NFTs from the same source
  • `ValueError: x and y must be the same size` when calling mplfinance
Trending Discussions on Cryptocurrency

QUESTION

Why on printing I get value of null from API call in Loop

Asked 2022-Apr-16 at 03:06

COIN LIST is an array of crypto coins(["BTCUSDT",...]). I try to get the price using getPriceAction and RSI from getRSI and these two functions are working when I try to console DATA. But when I try to print the response after the completion of the loop. It prints the empty array and the length is 0 of this array. I want to store the DATA object (consisting of SYMBOL, closing price and RSI) as an element in the response array

 import { COIN_LIST } from "./COIN_LIST.js";
    import { getPriceAction } from "./PRICE_ACTION.js";
    import { getRSI } from "./RSI.js";

async function main() {
  try {
    let response = await [];
    await COIN_LIST.forEach((element, i) => {
      setTimeout(() => {
        let data = { symbol: element };
        getPriceAction(element, "4h").then((res) => {
          data.closingPrice = res;
          getRSI(res).then((res) => {
            data.RSI = res.reverse();
            data.closingPrice = data.closingPrice.reverse();
            response.push(data);
            console.log(data)
          });
        });
      }, i * 1000);
    });
    console.log(response);
  } catch (error) {
    console.log(error.message);
  }
}
main();

ANSWER

Answered 2022-Apr-16 at 02:43

After the completion of the loop, the promises didn't get resolved yet, that's why it print an empty array. One way to achieve what you need is using await for(...), or wait for all promises to be resolved, and then print the results.

import { COIN_LIST } from "./COIN_LIST.js";
import { getPriceAction } from "./PRICE_ACTION.js";
import { getRSI } from "./RSI.js";

async function main() {
  try {
    let response = []; //---> don't need that `await`
    const promises = []; //---> array of promises
    COIN_LIST.forEach((element, i) => {
      setTimeout(() => {
        let data = { symbol: element };
        const promise = getPriceAction(element, "4h").then((res) => {
          data.closingPrice = res;
          getRSI(res).then((res) => {
            data.RSI = res.reverse();
            data.closingPrice = data.closingPrice.reverse();
            response.push(data);
            console.log(data)
          });
        });
        promises.push(promise) //---> save the reference to a promise
      }, i * 1000);
    });
    await Promise.all(promises) //---> await for all promises to be resolved, then print the result
    console.log(response);
  } catch (error) {
    console.log(error.message);
  }
}
main();

Source https://stackoverflow.com/questions/71890607

Community Discussions, Code Snippets contain sources that include Stack Exchange Network

Vulnerabilities

No vulnerabilities reported

Install vnpy

You can install using 'pip install vnpy' or download it from GitHub, PyPI.
You can use vnpy like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.

Support

For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .

DOWNLOAD this Library from

Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
over 430 million Knowledge Items
Find more libraries
Reuse Solution Kits and Libraries Curated by Popular Use Cases

Save this library and start creating your kit

Explore Related Topics

Share this Page

share link
Consider Popular Cryptocurrency Libraries
Compare Cryptocurrency Libraries with Highest Support
Compare Cryptocurrency Libraries with Highest Quality
Compare Cryptocurrency Libraries with Highest Security
Compare Cryptocurrency Libraries with Highest Reuse
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
over 430 million Knowledge Items
Find more libraries
Reuse Solution Kits and Libraries Curated by Popular Use Cases

Save this library and start creating your kit

  • © 2022 Open Weaver Inc.