SkillAgentSearch skills...

BlackMirror

A Tool to Semi-Automate the Manual Trading Process.

Install / Use

/learn @darkerego/BlackMirror
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

SemiAutoTrader (Aka "Blackmirror")

<pre> ██████╗ ██╗ █████╗ ██████╗██╗ ██╗███╗ ███╗██╗██████╗ ██████╗ ██████╗ ██████╗ ██╔══██╗██║ ██╔══██╗██╔════╝██║ ██╔╝████╗ ████║██║██╔══██╗██╔══██╗██╔═══██╗██╔══██╗ ██████╔╝██║ ███████║██║ █████╔╝ ██╔████╔██║██║██████╔╝██████╔╝██║ ██║██████╔╝ ██╔══██╗██║ ██╔══██║██║ ██╔═██╗ ██║╚██╔╝██║██║██╔══██╗██╔══██╗██║ ██║██╔══██╗ ██████╔╝███████╗██║ ██║╚██████╗██║ ██╗██║ ╚═╝ ██║██║██║ ██║██║ ██║╚██████╔╝██║ ██║ ╚═════╝ ╚══════╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ FTX Trade Mirroring Platform ~ Darkerego, 2020-2022 ~ version 0.1.1 FTX Referral: https://ftx.com/profile#a=blackmirror </pre>

Note: This is deprecated as FTX is no more

Fixed it!

<p>Note: If autotrader doesn't start, its because the db is corrupt. In that case run: </p> <pre> $ ./app.py --reset </pre> <p> That will reset the pnl and win/loss settings, and you should be good. </p>

About Blackmirror

<p>As requested, I have created a Dockerfile to simplify the installation of this program and get you started. By the way I am looking for people to collaberate on this project. </p>

Trade Signals via MqTT Now Available For Evaluation

<p> I am <no longer, sorry> streaming trade signals for use with this bot. They are available over mqtt at: beta.blackmirror.app:1883

Keep in mind that these signals are pretty alpha right now, but I am actually having some success. There are a couple of different streams you can use:

  • /signals - the main stream. These are sent out when they are generated and only broadcast when they open and close.
  • /stream - these are updated in real time and just keep streaming in.

Here is a sample command you can use to trade with these signals:

./app.py -m -a  -src binance --trade -tp .6  -sl 0.3 -cm market  \
-mc .75 -pc .25 -uri beta.blackmirror.app:1883 -mq -ot limit  -ms 29  -mt /stream -lS

Breakdown of command:

  • enable monitor mode
  • enable auto trader
  • signal data source is binance
  • actually trade
  • take profit at .6%
  • stop loss at .5%
  • close with market (trailing stop) order
  • use 75% of collateral max
  • close 25% of the position at a time
  • connect to the host
  • enable mqtt
  • try to use limit orders
  • min score to enter trade 29% (its a weighted average of indicators)
  • use the live stream
  • gotta enable -lS to use the live stream
</p> ## What's new - 09/13/2022 Hello my dear stargazers! I hope that the bot is making you very wealthy like it has me! (jk I am broke af, consider using my ftx referal code!) Anyway, new features!!!
  • New listing exploitation
<p> has finally been added back! Now you have the option to monitor for and then either go long or short on new perpetual futures the moment that they are added. Which direction you go is up to you, and either is a valid strategy, but I would advise going long. When a new asset is listed, the moment it becomes available on the api, bots start buying it. There is always a big wick. After the wick, they usually crash. So what i recommend is create a separate subaccount for this and fund it.

These are the approximate settings you should use for this (you may also want to use incremental take profit [--cm increment] but with no market history, the results may be unpredictable):

</p> <pre> $ ./app.py -m -a --trade -sa NEW_SUBACCOUNT --long_new_listings -nlp .25 -tp 2 -sl 1 </pre> <p>The only other you need to know is that if the bot is offline for a while you ought to manually update the database of listings. The bot cant tell when a new listing was added. If you leave it always online then you do not need to worry about this, just run it once before you start it:</p> <pre> ./app.py --update_db </pre>

What's new - 07/30/2022

  • Option to use sar as stop loss. Specify period to use: example: use the one minute as a stop: -ssl 60 WARNING: be logical about this. If you enter a long position and the 1 minute sar is saying sell, then don't be surprised when the system immediately closes your position.
  • Fixed a rather dreadful error that was causing duplicates of the trade engine and receiver threads. The system now runs 100x smoother...
  • Began adding support for using Fibonacci retracement levels to calculate take profit and stop loss levels. Not fully implemented just yet. The idea is the user will specify a time period to calculate the standard deviation on and then run a fib retrace on this stdev so that take profit orders will be set around the next level, and (optionally) stop loss can be set at the previous level.
  • Began adding an advanced position logging system. Eventually I will have every position graphed out when the position is closed, showing entrance and exit points along with optional other data. Also every position is stored in an sql db - this is currently implemented.

TODO

  • fix and port web interface back in code
  • finish fib retrace
  • finish position graphing
  • finish anti-liquidation logic

What's New - 04/14/2022

  • Bot is stable!
  • Fixed random api freezes
  • Switched trailing stop to use API
  • Order chasing works
  • Signal engine honors exit signals
  • Countless bugfixes

Feel free to message me on telegram @chev603 you have any questions, comments or concerns. Have fun.

<p> <b>The Case for Blackmirror's Existence</b>

This a tool for semi-automated trading on FTX. I created it because I was tired of loosing money because I was getting distracted and having to leave the computer without having set a top loss, and tired of missing opportunities to take profit for the same reason. Initially, the idea was to create a fully automated trade platform, however at some point I decided to begin focusing on making the system more targeted towards "Semi-Automating the Manual Trade Process" -- Which is why the repo is called "SemiAuto Trader", despite the fact that the bot is actually called "Blackmirror". However, as time went on (and I have been developing this thing for years ...), the project took yet another direction, and now I am working on making this a fully automated system again ...

</p> <p> <b>The Case for Open Sourcing This Project </b>

I open sourced this project for three reasons ... First, I think this is some of my better work, and figured it would look good on my resume (I am available for hire - xelectron at protonmail dot com). Next, and more importantly - I had hoped that by giving this software away, people that found it useful may support my work by using my FTX Referral link. So far, that hasn't happened, but you never know. Finally, the most important reason that I open sourced this project is because this is only half of the project: In development for several years now is a very powerful trade signal engine. It is now nearly completed and in the beta testing phase. In the very near future, I will be selling subscriptions to my trade signals which can be consumed by this bot via mqtt. So, in the meantime -- stay tuned, and enjoy. Remember, if you found this work useful, please consider supporting me by using my FTX Referral code!

</p>

Documentation

Demo of Bot Taking Profit

asciicasthttps://asciinema.org/a/464734

AutoTrader Features:

Autotrader is the "backbone" of the program. This is my signature feature, and the one I am most proud of and find the most useful. Personally I think it is one the coolest things I have written. It assumes multiple functions, from guilded semi-automatic trading (doing thing like taking profit and setting stops). It also has the ability to reopen a position after taking profit. This can be done either incrementally, or all at once. Most of these options are the same as in the last release, with the notable exception is --close_method. This is a lot like -reopen. Essentially you can choose to take profit in increments, potentially maximizing your gains. It is the same idea as "pyramiding" your orders. But now, it happens automatically.

  • Automatic take profit
    • take profit via trailingstop
    • market order
    • limit order
    • incrementally take profit via a series of pyramid limit orders
    • Automatic stop loss
      • If you forget to set one, the program will handle it for you
  • Automatically reopen your position
    • via limit, market, or incrementally (see incremental orders section below)

These features allow you to set a position and walk away from your screen, perhaps even go to sleep in peace!

API Functionality Features:

  • Buy and sell
  • Cancel orders
  • View portfolio
  • Get deposit addresses
  • "Order chase" - keep your limit order on top of the order book
  • Get open orders
  • Set account leverage

Incremental Orders

  • The process is:
    • Bot calculates the standard deviation over the last user supplied period (default 5 minutes)
    • Then the bot sets take profit limit sell orders up the book in this range (for a long)
    • Next, the bot sets limit buy orders orders to reopen your position going down the book in this range (for a long)
    • vice versa for a short
  • Example:
    • $1000 long BTC-PERP entered at 39000 hits target profit of .1% at $40000 - , so your position is now worth $1100
    • Standard deviation for the last 5 minutes is $50 - so it is likely that BTC will move that much again over the next 5 minutes
    • So, we set take profit orders like this:
      • Sell $60.31 at 40012.5
      • Sell $120.63 at 40025.0
      • Sell $250.25 at 40037.5
      • Sell $500.5 at 40050.0
    • This way, your average take profit price increases. This allows your sort of "trade the natural volatility"
    • The same thing happens
View on GitHub
GitHub Stars11
CategoryDevelopment
Updated1y ago
Forks8

Languages

Python

Security Score

65/100

Audited on Aug 12, 2024

No findings