Skip to main content

A package for predicting buy and sell signals

Project description

Machine Learning MlEvx

This is a simplified version of regpredict package used to generate buy and sell signals for crypto and conventional stock markets based on the excess volume indicator(EVX). EVX is a concept where the bid-ask spread is estimated inherently from current market prices.

You can read more about Evx in the whitepaper here

Installation

Install mlevx with python3 -m pip install mlevx

Usage

In your python script simply import the module and use as follows:

from mlevx.regbot import signal
print(signal(20,65,utcdatetime,'long'))

The above methods take an assets opening and closing prices of the asset based on the time interval you have chosen. The third option is the datetime in utc as a string, and the last option is the decision to long or short the trade. A zero classification output would instruct the user to sell, while one output means don't sell or buy if the asset is not already present in the orders.

NB: The arguments can only be one between 'enter' or exit.

Testing an entire dataframe

Testing of a dataframe for correct buy, sell signals is as simple as applying the function as follows:

import pandas as pd
from mlevx.regbot import signal, Regbot

df = pd.read_csv('../../../path/to/your/csvfile.csv')

y_pred = []
def getSignal(open,close,utctime,dir):
    return signal(open,close,utctime,dir)

df['weekday'] = df['date'].apply(lambda x: Regbot.getWeekDay(x))


df = df[df['enter_short'] == 0]
print(df.head())


#df['enter_long_pred'] = df.apply(lambda row: getSignal(row['open'], row['close'], str(row['date']),'long'), axis=1)
df['enter_short_pred'] = df.apply(lambda row: getSignal(row['open'], row['close'], str(row['date']),'short'), axis=1)

print(df.tail(20))

#print(len(df[df['enter_long_pred'] == df['enter_long']]), len(df))
print(len(df[df['enter_short_pred'] == df['enter_short']]), len(df))

Your original data must already have some presumed 'long' or 'short' signal.

Warning

This is not financial advise. MlEVX is entirely on its preliminary stages. Use it at your own risk.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mlevx-0.0.4.tar.gz (404.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mlevx-0.0.4-py3-none-any.whl (414.6 kB view details)

Uploaded Python 3

File details

Details for the file mlevx-0.0.4.tar.gz.

File metadata

  • Download URL: mlevx-0.0.4.tar.gz
  • Upload date:
  • Size: 404.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.4

File hashes

Hashes for mlevx-0.0.4.tar.gz
Algorithm Hash digest
SHA256 96ac655f3979b2997417ab4e8faa328bf92ffd405b5dfb029af9052e5ff9e592
MD5 20e2e12dbbdcacd8e4338b103583e393
BLAKE2b-256 7e9cacd9f8c6dd9ebf84faffcf65390423c26d91862d58b6a248169fcc62e7b3

See more details on using hashes here.

File details

Details for the file mlevx-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: mlevx-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 414.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.4

File hashes

Hashes for mlevx-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 f035adb4238bc734d379184e7f1ff4438eb716e6e14777b8ec0eb0f5396f7826
MD5 7f1c108719170f6c57d3b208154d3654
BLAKE2b-256 8f2d149f8e35003e64b41ecb3cbe4bb5ec563fcb05abb3e7752746442da98615

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page