GithubHelp home page GithubHelp logo

ilyakrotov / bitmex-simple-trading-robot Goto Github PK

View Code? Open in Web Editor NEW
109.0 17.0 52.0 11 KB

Simple BitMEX trading robot.

License: MIT License

Jupyter Notebook 60.08% Python 39.92%
bitmex trading-robot strategy trading trading-strategies trading-algorithms trading-platform bitcoin

bitmex-simple-trading-robot's People

Contributors

ilyakrotov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bitmex-simple-trading-robot's Issues

KeyError: '10d'

tanzeel@tanzeel-HP-Compaq-dx7500-SFF:~/BitMEX-simple-trading-robot$ python3 main_loop.py 
Traceback (most recent call last):
  File "main_loop.py", line 19, in <module>
    if round(time.time()) % time_to_wait_new_trade[TIMEFRAME] == 0:
KeyError: '10d'
tanzeel@tanzeel-HP-Compaq-dx7500-SFF:~/BitMEX-simple-trading-robot$ 

how to run

what command do you have to type to run this?
how do you stop the bot as well?

SyntaxError: invalid syntax

tanzeel@tanzeel-HP-Compaq-dx7500-SFF:~/BitMEX-simple-trading-robot$ python3 main_loop.py 
Traceback (most recent call last):
  File "main_loop.py", line 7, in <module>
    from trader import Trader
  File "/home/tanzeel/BitMEX-simple-trading-robot/trader.py", line 12
    print(f"Last prediction: {prediction}")
                                         ^
SyntaxError: invalid syntax
tanzeel@tanzeel-HP-Compaq-dx7500-SFF:~/BitMEX-simple-trading-robot$ 

RuntimeWarning ... Expected 96, got 88

/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88
return f(*args, **kwds)

Any idea how to get around this? Running main_loop.py on MacOS with Python 3.6

Something Went Wrong

I have edited the strategy, and the prediction is printing but order are not placed.
I am not using ta-Lib, created functions for indicators.
Screenshot (63)
Screenshot (64)

Also if this get fixed, how can run it on a 15min candle, as it is invalid bin size.

Last prediction: 0 always zero

tanzeel@tanzeel-HP-Compaq-dx7500-SFF:~/BitMEX-simple-trading-robot$ python3 main_loop.py 
Last prediction: {prediction} 0
Last prediction: {prediction} 0
Last prediction: {prediction} -1
/home/tanzeel/.local/lib/python3.5/site-packages/bravado_core/spec.py:271: Warning: guid format is not registered with bravado-core!
  category=Warning,
Last prediction: {prediction} 0
Last prediction: {prediction} 0
Last prediction: {prediction} 0
Last prediction: {prediction} 0
Last prediction: {prediction} 0
Last prediction: {prediction} 0
Last prediction: {prediction} 0

What am i doing wrong ?
my configuration.py is :


TEST_EXCHANGE=True
API_KEY="XXXXXXXXXXXXXXXXXX"
API_SECRET="XXXXXXXXXXXXXXXXXXXXXX"

AMOUNT_MONEY_TO_TRADE=200 #$
LEVERAGE=25

TIMEFRAME = '1m'

time_to_wait_new_trade = {'1m': 60,
                          '5m': 60*5,
                          '1h': 60*60,
                          '1d': 60*60*24}


bitmex is not defined

Hello, thank you for developing this. I am trying to run the notebook file but when ever I run it I get:


NameError Traceback (most recent call last)
in ()
----> 1 client = bitmex.bitmex(
2 test=True,
3 api_key="",
4 api_secret=""
5 )

NameError: name 'bitmex' is not defined

I am new to python and I got no idea of how to fix this any help?

ImportError: No module named bitmex

tanzeel@tanzeel-HP-Compaq-dx7500-SFF:~/BitMEX-simple-trading-robot$ python main_loop.py
Traceback (most recent call last):
File "main_loop.py", line 1, in
import bitmex
ImportError: No module named bitmex

Issues

Strategy.py
Traceback (most recent call last):
File "C:\Users\PB\Desktop\BitMEX-simple-trading-robot-master\strategy.py", line 1, in
import talib
ImportError: No module named talib

Current directory:
C:\Users\PB

Command to be executed:
"C:\WINDOWS\system32\cmd.exe" /C "C:\Users\PB\Desktop\BitMEX-simple-trading-robot-master\strategy.py"


Trader.py
File "C:\Users\PB\Desktop\BitMEX-simple-trading-robot-master\trader.py", line 12
print(f"Last prediction: {prediction}")
^
SyntaxError: invalid syntax

Current directory:
C:\Users\PB

Command to be executed:
"C:\WINDOWS\system32\cmd.exe" /C "C:\Users\PB\Desktop\BitMEX-simple-trading-robot-master\trader.py"


Main_loop.py
Traceback (most recent call last):
File "C:\Users\PB\Desktop\BitMEX-simple-trading-robot-master\main_loop.py", line 1, in
import bitmex
ImportError: No module named bitmex

Current directory:
C:\Users\PB

Command to be executed:
"C:\WINDOWS\system32\cmd.exe" /C "C:\Users\PB\Desktop\BitMEX-simple-trading-robot-master\main_loop.py"

ohlcv df needs to be flipped

thx for the code! (especially for the insight to divide timestamp by waitingtime :))

I noticed that the output of ohlcv_candles needs to be flipped (ohlcv_candles.iloc[::-1]) to get the last values with [-1] and [-2]

regards

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.