Pages:
Author

Topic: Trading Bots - page 2. (Read 12990 times)

donator
Activity: 848
Merit: 1078
April 11, 2012, 12:57:33 AM
#64
indeed, atm it is live and in operation but only with a tiny amount of BTC.

My algorithm is to basic atm, but I have all the structure there. Currently Im working on making the trading algo modular so I can run simulations on multiple algo's.

Mine just plays the spread with stop orders at medium-term technical support and resistance.  When we move big, my stop makes sure I catch most of the move with enough of my capital.  Then, it goes back to liquidity-bot mode and I adjust the stops.  I haven't really backtested it, but it has a decent amount of live testing with small amounts.

What languages are you guys using with your trading algos? I'm using PHP in mine but it lacks some of the statistical analysis tools that I need for trading the basic technical indicators.
mem
hero member
Activity: 644
Merit: 501
Herp Derp PTY LTD
April 11, 2012, 12:45:19 AM
#63
if you want ~3weeks of time,buy,sell logs for running sims send me a PM Smiley
legendary
Activity: 1904
Merit: 1002
April 10, 2012, 10:59:02 PM
#62
indeed, atm it is live and in operation but only with a tiny amount of BTC.

My algorithm is to basic atm, but I have all the structure there. Currently Im working on making the trading algo modular so I can run simulations on multiple algo's.

Mine just plays the spread with stop orders at medium-term technical support and resistance.  When we move big, my stop makes sure I catch most of the move with enough of my capital.  Then, it goes back to liquidity-bot mode and I adjust the stops.  I haven't really backtested it, but it has a decent amount of live testing with small amounts.
mem
hero member
Activity: 644
Merit: 501
Herp Derp PTY LTD
April 10, 2012, 10:53:05 PM
#61
indeed, atm it is live and in operation but only with a tiny amount of BTC.

My algorithm is to basic atm, but I have all the structure there. Currently Im working on making the trading algo modular so I can run simulations on multiple algo's.
legendary
Activity: 1904
Merit: 1002
April 10, 2012, 10:21:30 PM
#60
Maybe this is the wrong section, but I think you guys can help me here. I want to make a trading bot that will execute trades based on parameters I set according to technical indicators. Thing is, I have almost zero experience with coding. I don't just want to use someone else's code though, I want to build this from scratch, using custom and unique indicators. Is there any resource that I could use that would teach me how to go about creating and implementing this bot?

TL;DR Noob coder needs help building trading bot.

I have already written one, its called bitperl.pl but atm is a private only release.

On a good day it earns 0.7% of capital.

What about a bad day?

The worst Ive seen is it flat line waiting to sell coins for 4 days (back when he had  a good sized slump to 4.60). Once  the price came back  to normal it resumed its micro trading.

I see... careful with that type of strategy.  If it moves too far and you don't have a stop you'll miss the big moves.
mem
hero member
Activity: 644
Merit: 501
Herp Derp PTY LTD
April 10, 2012, 10:17:05 PM
#59
Maybe this is the wrong section, but I think you guys can help me here. I want to make a trading bot that will execute trades based on parameters I set according to technical indicators. Thing is, I have almost zero experience with coding. I don't just want to use someone else's code though, I want to build this from scratch, using custom and unique indicators. Is there any resource that I could use that would teach me how to go about creating and implementing this bot?

TL;DR Noob coder needs help building trading bot.

I have already written one, its called bitperl.pl but atm is a private only release.

On a good day it earns 0.7% of capital.

What about a bad day?

The worst Ive seen is it flat line waiting to sell coins for 4 days (back when he had  a good sized slump to 4.60). Once  the price came back  to normal it resumed its micro trading.

Currently supports:

  • Simulations
  • Uploads charts output of: profit ph, profit total, buy, sell, target, target break even. Example:
  • Logs historical Data. (for simulations)
  • The most basic buy low sell high algorithm (more coming).
  • Forcing a sell/buy remotely.
  • tweets changes and transactions: https://twitter.com/#!/bitperl
  • Factors MTGOX transaction charges

Todo:

  • Nicer web UI
  • modular trading algo's

Good luck with your trading bot Smiley

My advice is thread or daemonize everything to avoid any lag between transactions and mtgox live price.
I used to have everything pushed into a single loop - was easy to follow but a simple tweet was enough to miss a good price.
legendary
Activity: 1904
Merit: 1002
April 10, 2012, 10:14:55 PM
#58
Maybe this is the wrong section, but I think you guys can help me here. I want to make a trading bot that will execute trades based on parameters I set according to technical indicators. Thing is, I have almost zero experience with coding. I don't just want to use someone else's code though, I want to build this from scratch, using custom and unique indicators. Is there any resource that I could use that would teach me how to go about creating and implementing this bot?

TL;DR Noob coder needs help building trading bot.

I have already written one, its called bitperl.pl but atm is a private only release.

On a good day it earns 0.7% of capital.

What about a bad day?
mem
hero member
Activity: 644
Merit: 501
Herp Derp PTY LTD
April 10, 2012, 10:13:26 PM
#57
Maybe this is the wrong section, but I think you guys can help me here. I want to make a trading bot that will execute trades based on parameters I set according to technical indicators. Thing is, I have almost zero experience with coding. I don't just want to use someone else's code though, I want to build this from scratch, using custom and unique indicators. Is there any resource that I could use that would teach me how to go about creating and implementing this bot?

TL;DR Noob coder needs help building trading bot.

I have already written one, its called bitperl.pl but atm is a private only release.

On a good day it earns 0.7% of capital.
legendary
Activity: 1190
Merit: 1004
April 09, 2012, 11:48:01 AM
#56
Yep, allocation with malloc works fine.

Except now I have OpenCL errors, will fix those...

Quote
Then look at the libs you use. What is openCL good for? Do you really need it?

Testing many combinations on an algorithm at once.
sr. member
Activity: 420
Merit: 250
bool eval(bool b){return b ? b==true : b==false;}
April 09, 2012, 07:04:28 AM
#55
Maybe be you should take a closer look at your data structures.

What do you think a trade looks like?
Do you need to store the trades? For what purpose?

Is the decision to buy different from a decision to sell? If yes what is the difference?
Is this to be modelled as a struct or function? (could be both)

Is your bot meant to run on a single exchange or will it serve several different exchanges?
Thus you have to model the synopsis for the(se) exchange(s).

Then look at the libs you use. What is openCL good for? Do you really need it?
It prevents you from using function pointers. Which could be handy when dealing with different exchanges and modelling the decision as a function.
legendary
Activity: 1904
Merit: 1002
April 08, 2012, 08:56:17 PM
#54
Stack overflow... Now I'll know to be weary of static variables. I'll try replacing large static arrays with allocated memory and hopefully it will work... I thought the stack size would grow to meet larger variables... It would be nice if there was some error or warning when this happens.

That's it... don't make static variables over a few hundered bytes.  Just don't.
legendary
Activity: 1190
Merit: 1004
April 08, 2012, 08:50:08 PM
#53
Stack overflow... Now I'll know to be weary of static variables. I'll try replacing large static arrays with allocated memory and hopefully it will work... I thought the stack size would grow to meet larger variables... It would be nice if there was some error or warning when this happens.
legendary
Activity: 1190
Merit: 1004
April 08, 2012, 08:22:55 PM
#52
I fiddled with the code and slowly removed parts until I got a super small program that crashes:

Quote
#include

int main () {
   if (!errno) {
      int bar[2096159];
   }
   return 0;
}

This gives:

Code:
(null):Parrallel BitCoin Trading Algorithm matt$ gcc -g test.c -o test
(null):Parrallel BitCoin Trading Algorithm matt$ gdb test
GNU gdb 6.3.50-20050815 (Apple version gdb-1708) (Mon Aug 15 16:03:10 UTC 2011)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin"...Reading symbols for shared libraries .. done

(gdb) run
Starting program: /Users/matt/Programming/Bit Coin algorithm/Parrallel BitCoin Trading Algorithm/test
Reading symbols for shared libraries +. done

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x00007fff5f3ffff8
0x00007fff5fc1404c in __dyld__ZNK26ImageLoaderMachOCompressed18findExportedSymbolEPKcPPK11ImageLoader ()
(gdb)

But if the array is one smaller:

Code:
#include 

int main () {
if (!errno) {
int bar[2096158];
}
return 0;
}

Then this happens:

Code:
(null):Parrallel BitCoin Trading Algorithm matt$ gcc -g test.c -o test
(null):Parrallel BitCoin Trading Algorithm matt$ gdb test
GNU gdb 6.3.50-20050815 (Apple version gdb-1708) (Mon Aug 15 16:03:10 UTC 2011)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin"...Reading symbols for shared libraries .. done

(gdb) run
Starting program: /Users/matt/Programming/Bit Coin algorithm/Parrallel BitCoin Trading Algorithm/test
Reading symbols for shared libraries +. done

Program exited normally.
(gdb)

Stack trace:

Code:
(gdb) bt
#0  0x00007fff5fc1404c in __dyld__ZNK26ImageLoaderMachOCompressed18findExportedSymbolEPKcPPK11ImageLoader ()
#1  0x00007fff5fc0f141 in __dyld__ZNK16ImageLoaderMachO18findExportedSymbolEPKcbPPK11ImageLoader ()
#2  0x00007fff5fc12b34 in __dyld__ZN26ImageLoaderMachOCompressed15resolveTwolevelERKN11ImageLoader11LinkContextEPKS0_bPKcPS5_ ()
#3  0x00007fff5fc12dd0 in __dyld__ZN26ImageLoaderMachOCompressed7resolveERKN11ImageLoader11LinkContextEPKchiPPKS0_PNS_10LastLookupE ()
#4  0x00007fff5fc1699e in __dyld__ZN26ImageLoaderMachOCompressed20doBindFastLazySymbolEjRKN11ImageLoader11LinkContextE ()
#5  0x00007fff5fc0478f in __dyld__ZN4dyld18fastBindLazySymbolEPP11ImageLoaderm ()
#6  0x00007fff8812800a in dyld_stub_binder ()
#7  0x0000000100001030 in pvars ()
#8  0x0000000100000ef4 in start ()

Well I'm stumped...
legendary
Activity: 1190
Merit: 1004
April 08, 2012, 07:08:01 PM
#51
At this point in the program nothing is initialised since it's at the main function entry. I ran gdb again and it shows 0xbea7d7cc again. No idea where it came from. What I'll try to do is make and share a minimalist version of the program that replicates the problem...
sr. member
Activity: 420
Merit: 250
bool eval(bool b){return b ? b==true : b==false;}
April 08, 2012, 03:25:21 PM
#50
Code:
Reason: KERN_PROTECTION_FAILURE at address: 0xbea7d7cc
wtf is located at 0xbea7d7cc?
Is it stack or heap? Did you init it? When did you release that address?
Is it always this specific address? ... if yes, why? Where did it come from?
legendary
Activity: 1190
Merit: 1004
April 08, 2012, 11:31:34 AM
#49
Well I just tried compiling and running outside of Xcode and I get the same thing...

Code:
Matthew-Mitchell:Parrallel BitCoin Trading Algorithm matt$ gcc -g cmain.c -o test -lcurl -framework OpenCL -std=c99 -arch i386
Matthew-Mitchell:Parrallel BitCoin Trading Algorithm matt$ gdb testGNU gdb 6.3.50-20050815 (Apple version gdb-1708) (Mon Aug 15 16:03:10 UTC 2011)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin"...Reading symbols for shared libraries .... done

(gdb) run
Starting program: /Users/matt/Programming/Bit Coin algorithm/Parrallel BitCoin Trading Algorithm/test
Reading symbols for shared libraries .+++.................................................................. done

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0xbea7d7cc
0x00003e9a in main (argc=0, argv=0x1000) at cmain.c:572
572 int main (int argc, const char * argv[]) {
(gdb)

Sad Also when running directly in the command line, it returns instantly.
sr. member
Activity: 420
Merit: 250
bool eval(bool b){return b ? b==true : b==false;}
April 07, 2012, 01:35:06 PM
#48
Fine so far.
Now find the lib or the combination causing trouble and feed that to agony aunt google.

btw. if your first line of code would have been:
Code:
long satoshi = 0;
It would have crashed there, so could be RAII isn´t too bad for pure C either.
sr. member
Activity: 327
Merit: 250
we are legion
April 07, 2012, 01:30:05 PM
#47
A IDE / Compiler can be broken. Its possible.
Try Compiling on a clean, fresh System. - or at least reinstall xcode.
Also check environment variables.. these are very important for most Compilers.
legendary
Activity: 1190
Merit: 1004
April 07, 2012, 11:57:32 AM
#46
I removed all optimisation and now the line during the crash is shown at entering the main function...

I removed all curllib and the same problem occurs...

I removed all of the OpenCL and the same problem occurs... What? Is Xcode broken...

I replaced the entire program with:

Code:
#include 
#include

int main(){
printf(":O");
return EXIT_SUCCESS;
}

It works... Time to scratch my head...
sr. member
Activity: 420
Merit: 250
bool eval(bool b){return b ? b==true : b==false;}
April 07, 2012, 11:05:50 AM
#45
No, it crashes on intializing a lib.
Remove all optimizations (compiler + linker) include debug infos and step by step remove one lib after the other.
Pages:
Jump to: