Bitcoin Forum
May 13, 2024, 10:03:29 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: « 1 2 3 4 5 6 7 8 [9] 10 11 »  All
  Print  
Author Topic: ncurses based MtGox live monitor and trading-bot-framework  (Read 33817 times)
hugolp
Legendary
*
Offline Offline

Activity: 1148
Merit: 1001


Radix-The Decentralized Finance Protocol


View Profile
May 02, 2013, 04:47:48 PM
 #161

can anyone help me with coding a strategy for this tool...

I need to calc the EMAs and want to use the differance in my stratagy...
I have no clue atm how to do this....

Im looking to create a macd stratagy on the dema from mtgox

Pm me pls, as I dont want to derail the thread, thx

MtQuid already showed how to include ta-lib in a strategy. Look early pages in this thread.


               ▄████████▄
               ██▀▀▀▀▀▀▀▀
              ██▀
             ███
▄▄▄▄▄       ███
██████     ███
    ▀██▄  ▄██
     ▀██▄▄██▀
       ████▀
        ▀█▀
The Radix DeFi Protocol is
R A D I X

███████████████████████████████████

The Decentralized

Finance Protocol
Scalable
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
██▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀██
██                   ██
██                   ██
████████████████     ██
██            ██     ██
██            ██     ██
██▄▄▄▄▄▄      ██     ██
██▀▀▀▀██      ██     ██
██    ██      ██     
██    ██      ██
███████████████████████

███
Secure
      ▄▄▄▄▄
    █████████
   ██▀     ▀██
  ███       ███

▄▄███▄▄▄▄▄▄▄███▄▄
██▀▀▀▀▀▀▀▀▀▀▀▀▀██
██             ██
██             ██
██             ██
██             ██
██             ██
██    ███████████

███
Community Driven
      ▄█   ▄▄
      ██ ██████▄▄
      ▀▀▄█▀   ▀▀██▄
     ▄▄ ██       ▀███▄▄██
    ██ ██▀          ▀▀██▀
    ██ ██▄            ██
   ██ ██████▄▄       ██▀
  ▄██       ▀██▄     ██
  ██▀         ▀███▄▄██▀
 ▄██             ▀▀▀▀
 ██▀
▄██
▄▄
██
███▄
▀███▄
 ▀███▄
  ▀████
    ████
     ████▄
      ▀███▄
       ▀███▄
        ▀████
          ███
           ██
           ▀▀

███
Radix is using our significant technology
innovations to be the first layer 1 protocol
specifically built to serve the rapidly growing DeFi.
Radix is the future of DeFi
█████████████████████████████████████

   ▄▄█████
  ▄████▀▀▀
  █████
█████████▀
▀▀█████▀▀
  ████
  ████
  ████

Facebook

███

             ▄▄
       ▄▄▄█████
  ▄▄▄███▀▀▄███
▀▀███▀ ▄██████
    █ ███████
     ██▀▀▀███
           ▀▀

Telegram

███

▄      ▄███▄▄
██▄▄▄ ██████▀
████████████
 ██████████▀
   ███████▀
 ▄█████▀▀

Twitter

██████

...Get Tokens...
1715594609
Hero Member
*
Offline Offline

Posts: 1715594609

View Profile Personal Message (Offline)

Ignore
1715594609
Reply with quote  #2

1715594609
Report to moderator
Be very wary of relying on JavaScript for security on crypto sites. The site can change the JavaScript at any time unless you take unusual precautions, and browsers are not generally known for their airtight security.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715594609
Hero Member
*
Offline Offline

Posts: 1715594609

View Profile Personal Message (Offline)

Ignore
1715594609
Reply with quote  #2

1715594609
Report to moderator
1715594609
Hero Member
*
Offline Offline

Posts: 1715594609

View Profile Personal Message (Offline)

Ignore
1715594609
Reply with quote  #2

1715594609
Report to moderator
evilscoop
Sr. Member
****
Offline Offline

Activity: 350
Merit: 250



View Profile
May 02, 2013, 11:05:34 PM
 #162

ahh thx ill look into it
hugolp
Legendary
*
Offline Offline

Activity: 1148
Merit: 1001


Radix-The Decentralized Finance Protocol


View Profile
May 04, 2013, 12:53:29 AM
 #163

I hit a problem with my bot and its that the last days the number of trades has increased a lot at mtgox so downloading two days of data everytime I load the bot takes for ever. So Ive been programming a way to save the trades in a database. It obviously saves the trades in the database, but also on load my strategy checks the first received trade and the oldest trade in the database and downloads the trades missing between them so the history is always complete. The idea is to use it for backtesting as well. If anyone is interested I can share the code.

Also, with more datapoints the hourly ema formula gives almost exacts results to bitcoincharts (as suspected) so thats good.


               ▄████████▄
               ██▀▀▀▀▀▀▀▀
              ██▀
             ███
▄▄▄▄▄       ███
██████     ███
    ▀██▄  ▄██
     ▀██▄▄██▀
       ████▀
        ▀█▀
The Radix DeFi Protocol is
R A D I X

███████████████████████████████████

The Decentralized

Finance Protocol
Scalable
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
██▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀██
██                   ██
██                   ██
████████████████     ██
██            ██     ██
██            ██     ██
██▄▄▄▄▄▄      ██     ██
██▀▀▀▀██      ██     ██
██    ██      ██     
██    ██      ██
███████████████████████

███
Secure
      ▄▄▄▄▄
    █████████
   ██▀     ▀██
  ███       ███

▄▄███▄▄▄▄▄▄▄███▄▄
██▀▀▀▀▀▀▀▀▀▀▀▀▀██
██             ██
██             ██
██             ██
██             ██
██             ██
██    ███████████

███
Community Driven
      ▄█   ▄▄
      ██ ██████▄▄
      ▀▀▄█▀   ▀▀██▄
     ▄▄ ██       ▀███▄▄██
    ██ ██▀          ▀▀██▀
    ██ ██▄            ██
   ██ ██████▄▄       ██▀
  ▄██       ▀██▄     ██
  ██▀         ▀███▄▄██▀
 ▄██             ▀▀▀▀
 ██▀
▄██
▄▄
██
███▄
▀███▄
 ▀███▄
  ▀████
    ████
     ████▄
      ▀███▄
       ▀███▄
        ▀████
          ███
           ██
           ▀▀

███
Radix is using our significant technology
innovations to be the first layer 1 protocol
specifically built to serve the rapidly growing DeFi.
Radix is the future of DeFi
█████████████████████████████████████

   ▄▄█████
  ▄████▀▀▀
  █████
█████████▀
▀▀█████▀▀
  ████
  ████
  ████

Facebook

███

             ▄▄
       ▄▄▄█████
  ▄▄▄███▀▀▄███
▀▀███▀ ▄██████
    █ ███████
     ██▀▀▀███
           ▀▀

Telegram

███

▄      ▄███▄▄
██▄▄▄ ██████▀
████████████
 ██████████▀
   ███████▀
 ▄█████▀▀

Twitter

██████

...Get Tokens...
FoxMURDER
Newbie
*
Offline Offline

Activity: 49
Merit: 0


View Profile
May 05, 2013, 09:07:06 AM
Last edit: May 05, 2013, 09:29:13 AM by FoxMURDER
 #164

I never liked how depth/tick messages keep flooding the console window. At first I was disabling those. But today I tried to hack it into a separate console window (I am using a large screen and half the console window was unused anyway).

So I got something like this: http://www.imagehosting.cz/thumbs/goxtool1.png

At the moment it is rather an ugly hack. And the question is: anyone else interested? Should I clean it up?
prof7bit (OP)
Hero Member
*****
Offline Offline

Activity: 938
Merit: 500


https://youengine.io/


View Profile WWW
May 05, 2013, 09:33:45 AM
 #165

So I got something like this:
Did you change the character that is used for the depth bars or is that the way putty displays the ACS_CKBOARD character?

(Also from your screenshot it seems you are still using the socketio server, you should switch to websocket, much better experience, faster connect and no disconnects anymore)

FoxMURDER
Newbie
*
Offline Offline

Activity: 49
Merit: 0


View Profile
May 05, 2013, 09:50:45 AM
 #166

That is just a mess from misconfigured (not using UTF8) putty. I use it just to check if I broke something before pushing to my server. The "real thing" is running in different window and bars are just fine. Just trying to figure out what protocol I'm using there.
prof7bit (OP)
Hero Member
*****
Offline Offline

Activity: 938
Merit: 500


https://youengine.io/


View Profile WWW
May 05, 2013, 10:36:39 AM
 #167

Ok, I'm quickly inserting this post here before I forget it, this might be of interest for others trying to use goxtool with putty (there seem to be a lot), After seeing the screenshot I did some quick experiments with the Linux version of putty myself and line-drawing and other special characters looked totally screwed up here too. There seem to be the following few important settings that must be changed from the default, this will also solve the problem with F4 key not working:

Terminal > Keyboard > "Function keys and keypad" : Xterm R6
Wndow > Tranlation > "use font encoding"
Wndow > Tranlation > "[_] Override with UTF-8"  (remove the checkmark)

the equivalent options in the session settings file are:

LinuxFunctionKeys=2
LineCodePage=Use font encoding
UTF8Override=0

PS: It also seems that the UTF-8 problem will not occur when running goxtool through screen, screen seems to handle the character translation a different way but if not running through screen then these settings should help.

supert
Full Member
***
Offline Offline

Activity: 160
Merit: 100



View Profile
May 05, 2013, 06:05:09 PM
 #168

Some beer money on the way to prof7bit from me.
supert
Full Member
***
Offline Offline

Activity: 160
Merit: 100



View Profile
May 05, 2013, 08:27:55 PM
 #169

Having been mightily impressed by MtQuid's .js tomfoolery, perhaps someone is interested in using something like this to display the orderbook history:
http://code.google.com/p/javascript-surface-plot/
MtQuid
Newbie
*
Offline Offline

Activity: 24
Merit: 0



View Profile
May 08, 2013, 01:42:35 PM
Last edit: May 08, 2013, 09:32:21 PM by MtQuid
 #170

Having been mightily impressed by MtQuid's .js tomfoolery, perhaps someone is interested in using something like this to display the orderbook history:
http://code.google.com/p/javascript-surface-plot/

Ok I tried this out and got it working even though I think there must be better ways to represent the data.
See the files
https://github.com/MtQuid/goxtool/blob/master/strategies/dump_order_book.py
https://github.com/MtQuid/goxtool/blob/master/www-root/orderbook-3d.html

It can take some time to calculate the points within the browser window so I'm sure the solution can be optimised, though it is a lot faster when var fillPly = false;
Default settings are added to goxtool.ini on first load.  I have used this config solution in other strategies and I like it because all the configs are in one file.
If you want to keep the same folder layout then have a look at some of my other commits.

http://www.imagehosting.cz/thumbs/3dorderboo.png

See what you think and tell me if there are any bugs.
c0inbuster
Member
**
Offline Offline

Activity: 105
Merit: 10



View Profile WWW
May 08, 2013, 06:31:01 PM
 #171

Hello,

I don't see why using a 3D plot for a problem with only 2 variables (price, volume)...
unless third variable is time Huh (but I'm not sure that it's what you are drawing)

In my mind it will be a much better idea to work on a Qt widget to display
candlesticks (like Highcharts Highstock) and also a Qt widget to display orderbook depth
Qwt could be help http://qwt.sourceforge.net/
or this project https://code.google.com/p/candelabro/
so it could be add to goxgui https://bitcointalk.org/index.php?topic=176489.0

On my side, I have now historical data M1, M5, M15, M30, H1, H2, H6, H12, D1, W1 data
for mtgoxBTCUSD.

I've done all the work to test if data are ok (no missing data, no overlapping data, constant timeframe)

I'm now working on a script to generate pseudo tick data (generate control points from candlestick).

I will release this soon...

Kind regards

Download free softwares! - crypto mining profit calculator - crypto triangular arbitrage tools - crypto stocks tools...
https://sites.google.com/site/working4coins/
MtQuid
Newbie
*
Offline Offline

Activity: 24
Merit: 0



View Profile
May 08, 2013, 09:25:11 PM
Last edit: May 08, 2013, 09:45:39 PM by MtQuid
 #172

Hello,

I don't see why using a 3D plot for a problem with only 2 variables (price, volume)...
unless third variable is time Huh (but I'm not sure that it's what you are drawing)

Yep it's time.
Here is a graphic of an hours worth of change on the orderbook using rickshaw.
I just think these things look cool.

http://www.imagehosting.cz/thumbs/3dordebsb.png

I'll have a look at the Qt but I'm having fun messing around with python and js at the moment.
I hadn't looked at that project before - now exploring.
c0inbuster
Member
**
Offline Offline

Activity: 105
Merit: 10



View Profile WWW
May 09, 2013, 06:57:38 AM
 #173

Ok very well !!! in fact I prefer 2D version with colormap to display much recent orderbook depth darker
you should use opacity (if you can)

Quote
I hadn't looked at that project before - now exploring.

Which project are you talking of ?
  • Qt
  • Qwt
  • Candelabro
  • Goxgui

Download free softwares! - crypto mining profit calculator - crypto triangular arbitrage tools - crypto stocks tools...
https://sites.google.com/site/working4coins/
supert
Full Member
***
Offline Offline

Activity: 160
Merit: 100



View Profile
May 09, 2013, 09:37:44 AM
 #174

MtQuid your work is awesome and I look forward to playing with it this weekend.
MtQuid
Newbie
*
Offline Offline

Activity: 24
Merit: 0



View Profile
May 10, 2013, 02:57:17 PM
Last edit: May 10, 2013, 04:38:27 PM by MtQuid
 #175

Which project are you talking of ?

goxgui
I had seen it before but when looking for a trading framework I skipped over it as I wasn't looking for a GUI.
In fact I still don't really need anything other than goxtool but I'll keep goxgui in mind when playing around.
What I really like about goxtool is that it's not a lot of source code and it's not hard to digest the whole lot.
If you plan to build a bot that plays dice with your own money then you really must look at all the code and have a feel for it.
Also goxtool is not compiled, or anything like that, and once you have examined the source you can safely use it and only
have to review each new commit.
There are many things I really like about goxtool.

I just tried goxgui but it was too big for my laptop screen and I couldn't shrink the dialog any more.
Not a great start....

Anyway I've been working on a buy/sell helper bot that could be useful to some people and I'm just finishing of the testing.
My plan is to have this advanced buying/selling being controlled by a strategy bot that takes inputs from other providers like
lumptrade/lag/ta-lib/...  Have it all modular.  I'll release it all when I'm happy it works as planned.

Would be nice to have a fake MtGox to test out the buying and selling on and simulate market events.  Less cost and less time.

And at the moment in that bot I'm using key-press with feedback in the log file but it would be nice to be able to pop up some ncursors
dialogs from inside a strategy.

Also we should think about what to do with multiple accounts or accounts trading in different quotes and bases
Should each account need another instance of goxgui running? If so at least a colour change would be useful for recognising an account.
Colours in goxtool.ini anyone??
Maybe an account selector via command line argument or start-up prompt.  With each account able to colourise the gui, along with inline switching.
I know I'm saying goxtool is lean but this does not add much weight.


Lots to play about with Smiley

Edit: Scrap the online account switching idea as this would be a nightmare for the bots...I have been drunk.
I think all that's needed is select config from command line argument and have some limited colour options in the config.
c0inbuster
Member
**
Offline Offline

Activity: 105
Merit: 10



View Profile WWW
May 10, 2013, 04:41:48 PM
Last edit: May 10, 2013, 05:47:02 PM by c0inbuster
 #176

I don't think having differents instances of goxtool will be a very good idea...
because you can design a strategy which need to know price of both mtgox|BTC/USD and mtgox|BTC/EUR.
for now, we can't (in my mind) have such a strategy implemented

Download free softwares! - crypto mining profit calculator - crypto triangular arbitrage tools - crypto stocks tools...
https://sites.google.com/site/working4coins/
jbsnyder
Newbie
*
Offline Offline

Activity: 9
Merit: 0


View Profile
May 11, 2013, 02:10:18 AM
Last edit: May 11, 2013, 02:27:36 AM by jbsnyder
 #177

Been lurking for a bit, mainly because it took a while to get out of newbie jail.

I've been playing around with some strategies using the pandas python module and EMAs.  As I think prof7bit noted somewhere, things like this seem to work well in some cases but then fall apart in others resulting in somewhat of a wash.  The latest thing I've given a try adds thresholding based on volume on top of using EMA crossovers.  We'll see :-)

One thing that might be of interest to those on here developing such algorithms might be quantopian.com which is a Python-based stackexchange-ish online forum for backtesting and discussing algorithms (they'll run the algorithms online and generate some nice plots/stats).  Their main data sources do not include bitcoin, but they do provide an ability to pull in CSV data from anywhere and there's at least one database that will provide daily data for that that one can test against it:

https://www.quantopian.com/posts/anyway-to-import-bitcoin-data

It might be interesting to build an adapter within a template to match the API here, or perhaps one of the other backtesting frameworks out there to be able to test algorithms.

Edit: Also, regarding GUIs why not use something based on matplotlib or maybe Enthought's Chaco which is designed for interactive plotting:
http://code.enthought.com/chaco/

Edit2: quantopian's backend is built around the zipline module, so perhaps that could figure into offline backtesting:
https://github.com/quantopian/zipline
limpbrains
Newbie
*
Offline Offline

Activity: 58
Merit: 0


View Profile
May 11, 2013, 08:36:07 AM
 #178

Been lurking for a bit, mainly because it took a while to get out of newbie jail.

I've been playing around with some strategies using the pandas python module and EMAs.  As I think prof7bit noted somewhere, things like this seem to work well in some cases but then fall apart in others resulting in somewhat of a wash.  The latest thing I've given a try adds thresholding based on volume on top of using EMA crossovers.  We'll see :-)

One thing that might be of interest to those on here developing such algorithms might be quantopian.com which is a Python-based stackexchange-ish online forum for backtesting and discussing algorithms (they'll run the algorithms online and generate some nice plots/stats).  Their main data sources do not include bitcoin, but they do provide an ability to pull in CSV data from anywhere and there's at least one database that will provide daily data for that that one can test against it:

https://www.quantopian.com/posts/anyway-to-import-bitcoin-data

It might be interesting to build an adapter within a template to match the API here, or perhaps one of the other backtesting frameworks out there to be able to test algorithms.

Edit: Also, regarding GUIs why not use something based on matplotlib or maybe Enthought's Chaco which is designed for interactive plotting:
http://code.enthought.com/chaco/

Edit2: quantopian's backend is built around the zipline module, so perhaps that could figure into offline backtesting:
https://github.com/quantopian/zipline
Thanks for great links

Good video to understand how to work with zipline and ipython
http://vimeo.com/53064082
If you want to try it, you should run ipython with pylab inline
Code:
ipython notebook --pylab inline

Have anybody succeed to load mtgox data into it?
c0inbuster
Member
**
Offline Offline

Activity: 105
Merit: 10



View Profile WWW
May 11, 2013, 09:00:14 AM
 #179

zipline seems to be exactly what I was looking for !!!
a python algo trading environment for backtesting (but event-driven !)

Download free softwares! - crypto mining profit calculator - crypto triangular arbitrage tools - crypto stocks tools...
https://sites.google.com/site/working4coins/
MtQuid
Newbie
*
Offline Offline

Activity: 24
Merit: 0



View Profile
May 12, 2013, 12:47:43 AM
 #180

Great links with the zipline stuff

Here is my notebook with dual moving average on bitcoin data with 20/10 day windows.
http://nbviewer.ipython.org/5561936
I just don't know why I have to add 2 items to the moving average lists.

Though this stuff does not really belong in this goxtool thread..ooOOO  what to do?
In fact I only post in this thread so I don't care, the rest of the forum is the wild west to me.
And this stuff will belong in here when we make zipline work with a goxtool strategy.

Someone make a new thread..I'm going to bed... Undecided
Pages: « 1 2 3 4 5 6 7 8 [9] 10 11 »  All
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!