Bitcoin Forum
June 21, 2024, 05:39:51 PM *
News: Voting for pizza day contest
 
   Home   Help Search Login Register More  
Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 [24] 25 26 27 28 29 30 31 32 33 34 »
  Print  
Author Topic: Gekko - a javascript trading bot and backtesting platform  (Read 147808 times)
wizzardTim
Legendary
*
Offline Offline

Activity: 1708
Merit: 1000


Reality is stranger than fiction


View Profile
June 26, 2014, 05:51:12 PM
 #461

So can someone suggest me parameter values for use with bitstamp? eg EMA? I am new to trading.

This chart from the "Goomboo's Journal" thread has a nice chart showing examples of how the simulations worked out based on the data they personally backtested against.

The EMA settings themselves are based on TA (technical analysis) theory, so you might be able to figure out how certain settings perform by looking at historical data using a charting tool which supports TA indicators such as the charts provided on:
...

Thank you very much for your answer. I need to study first and try out cex.io

Behold the Tangle Mysteries! Dare to know It's truth.

- Excerpt from the IOTA Sacred Texts Vol. I
ernie-
Sr. Member
****
Offline Offline

Activity: 252
Merit: 250


View Profile WWW
June 26, 2014, 09:01:06 PM
 #462

How come it says cex.io trading fee will be: 0.75%? cex.io fee is 0.2% usually.

Actually, that workaround is probably no longer needed...

If anyone wants to test this prerelease version (intentionally NOT flagged as "latest") I'd appreciate it:

https://github.com/kuzetsa/gekko/releases/tag/microtrade

I've had it running for a few minutes, but other people are probably using different settings than mine so it'd be good to have more than one tester.

Testing. Is there any way to log the trades to a file? Currently it's just displaying on the console.
kuzetsa
Sr. Member
****
Offline Offline

Activity: 369
Merit: 250


View Profile
June 26, 2014, 10:13:14 PM
 #463

How come it says cex.io trading fee will be: 0.75%? cex.io fee is 0.2% usually.

Actually, that workaround is probably no longer needed...

If anyone wants to test this prerelease version (intentionally NOT flagged as "latest") I'd appreciate it:

https://github.com/kuzetsa/gekko/releases/tag/microtrade

I've had it running for a few minutes, but other people are probably using different settings than mine so it'd be good to have more than one tester.

Testing. Is there any way to log the trades to a file? Currently it's just displaying on the console.


look in the "bin" subfolder at the shell scripts (not sure if you're using linux or not) for inspiration...

note that there is a windows port of the "tee" command available here:

http://gnuwin32.sourceforge.net/packages/coreutils.htm

alternatively, using the 100% microsoft-provided windows powershell "tee-object"
(tee-object even has similar syntax and can be abbreviated "tee" but requires using powershell)

http://technet.microsoft.com/en-us/library/hh849937.aspx
kuzetsa
Sr. Member
****
Offline Offline

Activity: 369
Merit: 250


View Profile
June 26, 2014, 11:37:22 PM
 #464

  • verbose github changelog (showing the actual code changes)

    Quote from: investopedia.com DEMA explanation
    As Mulloy explains in his original article, "the DEMA is not just a double EMA with twice the lag time of a single EMA, but is a composite implementation of single and double EMAs producing another EMA with less lag than either of the original two."

    In other words, the DEMA is not simply two EMAs combined, or a moving average of a moving average, but is a calculation of both single and double EMAs.

    I've been busy today Smiley

    Whee!!!
    (yay calculus & momentum-based calculations)

    Long story short, there's a new method / algorithm I'll be testing for several days. I named it x2MACD since it's a MACD modified to use the DEMA indicator ... Also, there was a filename conflict because for some reason there's code in files named DEMA.js already in the "methods" directory of gekko (old, legacy code) but the algorithm it implements is completely unrelated to Patrick Mulloy's work back in the 90s.
ernie-
Sr. Member
****
Offline Offline

Activity: 252
Merit: 250


View Profile WWW
June 27, 2014, 12:21:00 AM
 #465

How come it says cex.io trading fee will be: 0.75%? cex.io fee is 0.2% usually.

Actually, that workaround is probably no longer needed...

If anyone wants to test this prerelease version (intentionally NOT flagged as "latest") I'd appreciate it:

https://github.com/kuzetsa/gekko/releases/tag/microtrade

I've had it running for a few minutes, but other people are probably using different settings than mine so it'd be good to have more than one tester.

Testing. Is there any way to log the trades to a file? Currently it's just displaying on the console.


look in the "bin" subfolder at the shell scripts (not sure if you're using linux or not) for inspiration...

note that there is a windows port of the "tee" command available here:

http://gnuwin32.sourceforge.net/packages/coreutils.htm

alternatively, using the 100% microsoft-provided windows powershell "tee-object"
(tee-object even has similar syntax and can be abbreviated "tee" but requires using powershell)

http://technet.microsoft.com/en-us/library/hh849937.aspx

I am using linux, I looked at the 4 scripts in the bin folder but they seem to assume there are log files in the log directory. Mine is empty all I get is console messages and no saved logs at all. I have the adviceLogger enabled. I see the launch script with the tee command is that the only method?


kuzetsa
Sr. Member
****
Offline Offline

Activity: 369
Merit: 250


View Profile
June 27, 2014, 02:47:20 AM
Last edit: June 27, 2014, 03:22:41 AM by kuzetsa
 #466

I see the launch script with the tee command is that the only method?

pipe it into tee and specify the filename to output the log to Smiley

tee is easy, just do the do like what this command do the do:

Code:
$ node gekko | tee gekko.log



Edited to add:

alternatively, the launcher I personally use ended up in the git repo for my fork

 (and it's not in the /bin/ directory with all those other scripts. oops)

Code:
$ ./launcher | tee gekko.log

you may or may not need to chmod 744 first if the perms are wrong.



Last comment / going to bed now...

At some point I'll likely do some cleanup and actual testing to make sure all the various included scripts and such work. Sorry gekko is in such a bad state at the moment Sad

lizard.sh

^ The "tee" logging wrapper I'm using now, and it's all I have in me for tonight.

This wrapper (which calls the launcher script) just starts with:

Code:
$ ./lizard.sh

Good luck Smiley
jeezy
Legendary
*
Offline Offline

Activity: 1237
Merit: 1010



View Profile
June 27, 2014, 07:44:08 AM
 #467

Oh hey, this is interesting. I discovered this project a couple weeks back but thought it was dead.

What's the current status of your fork? You write that only CEX.IO is supported but in the config file there are options for Bitstamp/etc.? Also you say DEMA is supported but you opened a ticket where it says only MACD is working?

Maybe it would be best if you opened a new thread for your fork so you can maintain current updates for people to see?

Anyway, if I want to give this a testrun all I have to do is disable "Trader" and enable "ProfitSimulator", correct?

Thanks for your great work Sarah!
cryptcollector
Full Member
***
Offline Offline

Activity: 227
Merit: 100


View Profile
June 27, 2014, 10:13:16 AM
 #468

I have one question about the profit simulator,

I've been using the original fork of Gekko (as of this source) on btc-e USD/BTC market.
I'm in test mode at the moment, but the simulator always gives me a negative profit no matter what I do.

I'm quite new to all this really, and I'm wondering if its just my settings, or if the simulator is broken?

cheers

Follow me on Twitter: https://twitter.com/cryptcollector
BTC Donation Address: 1LxXw9CRunb5mJfa99aTWQMCqmbroVBUxi
kuzetsa
Sr. Member
****
Offline Offline

Activity: 369
Merit: 250


View Profile
June 27, 2014, 12:48:55 PM
 #469

>> 1

What's the current status of your fork? You write that only CEX.IO is supported but in the config file there are options for Bitstamp/etc.? Also you say DEMA is supported but you opened a ticket where it says only MACD is working?

>> 2

Maybe it would be best if you opened a new thread for your fork so you can maintain current updates for people to see?

>> 3

Anyway, if I want to give this a testrun all I have to do is disable "Trader" and enable "ProfitSimulator", correct?

1, current status is a code audit, and cleanups for anything which makes sense, and asking questions and discussing the bits which are confused. Example:

WHAT IS that method in the DEMA.js? I do not know what that code even is. It is not using a "double EMA" of any kind, and I can't seem to find any sort of indicator based on that sort of algorithm. This is how it works:

Code:
~pseudocode~

Calculate a fast and slow EMA average

A = subtract one from the other

B = add one to the other, and divide it by 2

C = 100 times A divided B

based on the value of C, assume positive values mean an uptrend, and negative values mean a downtrend

I ... don't even know what that is. It is not called "DEMA" though I don't think, I've never seen any TA indicator which does that particular combination of things to two different EMAs...

I could have updated the ticket with more info after fixing the PPO code, but was tired last night... PPO has been audited and is now consistent with the new codebase, and I added the x2MACD now as well (which worked correctly overnight) -- updated: https://github.com/kuzetsa/gekko/issues/3

(and thanks for reminding me to look at that)



As for the current status, of "support for non-cex.io" mostly I'm just only supporting cex.io exchange because the API works, and I can only test with what I have available.

/// [[ nearly a decade ago --  My ex pulled a "kinda-sorta identity theft" thing on me out of spite during the breakup, and my bank didn't provide any remedy when I was cleaned out due to a spiteful angry situation, which among other things, left me feeling "not safe" for a couple years. ]]///

... and I do not have good enough credit to be allowed a bank account or otherwise do trades with FIAT-type currency (USD, etc. on bitstamp or whatever)

I will probably add support for things like vircurex or cryptsy, or otherwise exchanges which I'm able to fully test all currency pairs, but I will not be personally maintaining or providing code to support exchanges which support bank transfer.



2) I don't know. What to name, and why make such a new thread?. I have some errands to run today, and am open to suggestions but need to go get dressed right this minute. I'm comfortable with the idea of staying on this thread for a while longer though, since I wasn't the only person working on gekko before the project lost momentum several months ago.

3) the "trader" is disabled by default... "Profit simulator" isn't something I've audited, and it doesn't take into account the concept of reinvesting mined income from cex.io GHS. At this time, this particular code in my fork doesn't support the concept of "buy low / sell high" (or selling at all) so I'm not sure what you hope to achieve by enabling the profit simulator.

I'm open to the idea of making the new behavior "optional" and re-adding code which has "selling" logic...

HOWEVER!!! The main reason I removed it (in favor of a simple "buy and hold") was that the logic for how buy/sell would be handled was different for every trading method. There was no consensus from one method to the next how the logic would work for buy / sell / hold / reinvest / etc. and there were a lot of bugs relating to the different methods using different ways of tracking the state.



Edited to add:

I do not have time to proofread, I have to get dressed like 10 minutes ago.

Sorry for a rough draft, hope there wasn't too bad grammatical errors or spelling mistakes in this
kuzetsa
Sr. Member
****
Offline Offline

Activity: 369
Merit: 250


View Profile
June 27, 2014, 08:02:18 PM
 #470

What's the current status of your fork? You write that only CEX.IO is supported but in the config file there are options for Bitstamp/etc.? Also you say DEMA is supported but you opened a ticket where it says only MACD is working?

Sorry, I want to clarify that I think there's some confusion, ambiguity, and miscommunication:

The config.js (old code) in gekko is a liar:

In the original gekko code (which I forked) there is a "DEMA.js", and some related configuration options which are all completely mislabeled. It is not clear what "that thing" (method or algorithm) even is. One thing is clear though: THAT (old) CODE IS NOT AN ACTUAL DEMA of any kind whatsoever...

... and until this past 48 hours when I wrote a real DEMA implementation, gekko didn't actually implement DEMA at all. The "actually a DEMA-based calculation" code had to be named "x2 <method>" such as "x2MACD" so it wouldn't be confused with the older, (mislabeled, wrongly named) "DEMA.js" based code.



This is why I've been spending so much time on bugfixes and code audits. There are some things in the code which are outright confusing or inaccurately named, despite the fact that they CAN technically be used generate valid advice or even do trading. It's just a peve, and mislabeling something which isn't DEMA as such is kinda weird. Moving forward, as I audit, document, bufix, and clean up everything, I really might just rebrand the forked codebase "lizardbot" or something.

At that point, one of the first things I'll do is delete DEMA.js and all the references to it since it's not actually DEMA:

http://www.investopedia.com/articles/trading/10/double-exponential-moving-average.asp

^ I really did implement some actual DEMA code in the past 48 hours... I didn't call it that though, since it conflicted with the ... thing (whatever it is)

so yes and no.

DEMA works, but I had to call it something else *facepalm*

whatever  Embarrassed
jeezy
Legendary
*
Offline Offline

Activity: 1237
Merit: 1010



View Profile
June 27, 2014, 08:19:44 PM
 #471

Okay, good to know. It's still usable for CEX.IO botting.

Two features would make this bot _REALLY_ usable:

1) Intelligent buying GHS on certain times a day, watching the market and buying when the bot things is cheapest using (MACD|DEMA|X). This could be configurable for instance like just watch and report or even alert via mail when the bot things the time is right. Or just tell the bot to at least try to enforce buy once a certain treshhold is hit, disregarding certain minimal losses just to get the mining going.

2) More importantly: Selling GHS for BTC when the market goes downward a certain % in a certain time period, just to minimize losses. This could be fixed in the config file and should be easy to develop. Just a simple sell API call like "IF GHS<0.0073 RUN EMERGENCYSELLOFF();". The more advanced technique would be that the bot tracks which prices he bought for and you tell him for instance that when the threshhold of your average GHS/BTC value drops below -10% then just sell and hold, wait for admin input.

Thanks Sarah!
kuzetsa
Sr. Member
****
Offline Offline

Activity: 369
Merit: 250


View Profile
June 27, 2014, 09:03:45 PM
 #472

Okay, good to know. It's still usable for CEX.IO botting.

Two features would make this bot _REALLY_ usable:

1) Intelligent buying GHS on certain times a day, watching the market and buying when the bot thinks is cheapest ...

2) More importantly: Selling GHS for BTC ...

1) hehe, it already does that... It always tries to buy at the cheapest price possible, and during a flat or downtrend it just holds out and waits for a better price Smiley

2) yeah, maybe... I guess so? ... at some point I'm thinking of re-adding "sell" logic, but I think it'd be better for the "panic sell" to track the [[ GHS mining profits VS maintenance fees ]] or whatever... Theres a very good chance the market price for GHS might not actually change much whenever the profitability decline gets really bad at some point in the not too distant future...

Bitcoin network difficulty doesn't have to rise very much for 26 cents per month maintenance fee to be too expensive to continue to own GHS cloud mining with cex.io... that "profitability decline" is coming up in just few a months unless:

  • either cex.io upgrades to more energy efficient hardaware so the maintainence fees won't be so bad
  • and/or the price of bitcoin goes WAY WAY up high enough that the tiny mining revenue will still be enough to pay maintenance fees

Just sayin'
jeezy
Legendary
*
Offline Offline

Activity: 1237
Merit: 1010



View Profile
June 27, 2014, 09:21:23 PM
 #473

1) hehe, it already does that... It always tries to buy at the cheapest price possible, and during a flat or downtrend it just holds out and waits for a better price Smiley

Is there a way to test run this with my current live balance?
kuzetsa
Sr. Member
****
Offline Offline

Activity: 369
Merit: 250


View Profile
June 27, 2014, 10:47:00 PM
Last edit: June 27, 2014, 11:11:15 PM by kuzetsa
 #474

1) hehe, it already does that... It always tries to buy at the cheapest price possible, and during a flat or downtrend it just holds out and waits for a better price Smiley

Is there a way to test run this with my current live balance?

No, probably not. I don't think it's ever been done.  Huh

At this time, there's no good way to simulate the GHS cloud mining income, nor the deduction of maintenance fees ... Accurately simulating such things would require a model for the cex.io GHS cloud mining which means the upkeep fee (for electricity & hosting) as well as the income would need to be simulated...

But that's basically impossible since the payouts as well as the fees are pretty random
(multiple times per day, and during that time the prices change CONSTANTLY)

At best, any simulation would be a rough estimate.



I still want to figure out how to implement though Smiley

kuzetsa
Sr. Member
****
Offline Offline

Activity: 369
Merit: 250


View Profile
June 28, 2014, 02:33:13 AM
Last edit: June 28, 2014, 05:36:37 PM by kuzetsa
 #475

((...snip...))

Selling GHS for BTC when the market goes downward a certain % in a certain time period, just to minimize losses. This could be fixed in the config file and should be easy to develop. Just a simple sell API call like "IF GHS<0.0073 RUN EMERGENCYSELLOFF();". The more advanced technique would be that the bot tracks which prices he bought for and you tell him for instance that when the threshhold of your average GHS/BTC value drops below -10% then just sell

Sorry, I thought about it some more, and might be able to help this weekend?

http://www.investopedia.com/terms/p/ppo.asp

^ want to do some testing with the PPO method to see if we can get it to do what you want?


https://github.com/kuzetsa/gekko/releases/tag/microtrade

^ in that prerelease version from yesterday it still has an older version of the PPO method which has "sell" logic in it still. Just be sure to set your indicator trading method thingy to PPO instead of MACD.



oops:

Sorry, actually I just reviewed the code again... and it seems as though a fix for the "stuck state" bug actually prevents PPO or other methods from being able to create a sell order, and this change was intentional at the time.

... I ended up saving myself a lot of hassle not having to worry about anything I may have missed which might cause a panic sell (which I didn't want)

Without a rewrite, I guess there's no easy way to support "no panic sell ever" in addition to "optional panic sell, and/or other reasons for sell orders"... And since this isn't going to be easy, I'm going to just be lazy and give up on the idea of sell orders completely for now.

I don't want to give anyone false hopes in thinking that I'll provide patches, support, and debugging for a live trading (for both buy AND sell) version of gekko at no cost. It's just not something I'm interested in, so I won't be testing it without an incentive to do so.

I'm starting to realize why so many bots are on a recurring subscription basis. Providing ongoing support for more than one strategy is a lot of work.

"buy and hold" / "reinvest only" is the one I personally use though, so that will continue to be well tested & audited Smiley
Alex_green
Newbie
*
Offline Offline

Activity: 19
Merit: 0


View Profile
July 01, 2014, 05:02:11 AM
 #476

What OS are you running?
ernie-
Sr. Member
****
Offline Offline

Activity: 252
Merit: 250


View Profile WWW
July 01, 2014, 05:08:13 AM
 #477



"buy and hold" / "reinvest only" is the one I personally use though, so that will continue to be well tested & audited Smiley
Sounds reasonable, it's is after all a specialized gekko fork for trading on cex.io.

jeezy
Legendary
*
Offline Offline

Activity: 1237
Merit: 1010



View Profile
July 01, 2014, 07:24:48 AM
 #478



"buy and hold" / "reinvest only" is the one I personally use though, so that will continue to be well tested & audited Smiley
Sounds reasonable, it's is after all a specialized gekko fork for trading on cex.io.

That doesn't mean my feature requests are unreasonable, since I'm also trading on cex...  Tongue
wizzardTim
Legendary
*
Offline Offline

Activity: 1708
Merit: 1000


Reality is stranger than fiction


View Profile
July 01, 2014, 12:45:42 PM
Last edit: July 01, 2014, 01:51:28 PM by wizzardTim
 #479

...
This chart from the "Goomboo's Journal" thread has a nice chart showing examples of how the simulations worked out based on the data they personally backtested against.

The EMA settings themselves are based on TA (technical analysis) theory, so you might be able to figure out how certain settings perform by looking at historical data using a charting tool which supports TA indicators such as the charts provided on:

..

I'm not going to try to manage your portfolio for you (not for free, and without a suitable contract)
nor would I want to "basically be a liar" by promising the defaults are suitable for your needs  Undecided

Hello kuzetsa,

Thank you very much for your answer. I've read many posts from the "Goomboo's Journal" thread, it is a very valuable resource.

I've also read a few things regarding TA (EMA etc). I will install your Gekko fork in windows and give it a try.

I have some questions, if you don't mind answering:
  • In the CEX with your Gekko I can only buy GHs and hold them (to generate BTC) or trade them?
  • How will the bot know that I want it to use EMA only and not MACD,2xMACD etc?


Thanks in advance

Behold the Tangle Mysteries! Dare to know It's truth.

- Excerpt from the IOTA Sacred Texts Vol. I
kuzetsa
Sr. Member
****
Offline Offline

Activity: 369
Merit: 250


View Profile
July 01, 2014, 04:06:18 PM
Last edit: July 01, 2014, 05:05:14 PM by kuzetsa
 #480

I've also read a few things regarding TA (EMA etc). I will install your Gekko fork in windows and give it a try.

I have some questions, if you don't mind answering:
  • In the CEX with your Gekko I can only buy GHs and hold them (to generate BTC) or trade them?
  • How will the bot know that I want it to use EMA only and not MACD,2xMACD etc?


Thanks in advance

For clarity, I'll be renaming the old, legacy code (which is currently misnamed) BACK to something more clear as to what it actually is:

It's going to be a few versions:

  • LEGACY -- the original EMA method from about a year ago when it was the only method
  • x2CROSS -- a variant on the original EMA crossover method, using an actua DEMA indicator instead of simple 1x EMA like the legacy method (this is often called a "zerolag" EMA indicator)
  • x3CROSS -- same as above, but using the TEMA zerolag variant

... It's too confusing to have both a single-EMA-based method named DEMA, and then an actual DEMA-based method named x2EMA --- Currently, it's still misnamed "DEMA", so if you were to use gekko in its current state, just keep in mind that the original method which will soon be rebranded as the "LEGACY" method is misnamed:

DEMA ~ AKA "exponential-moving-average-crossovers.js" (this was when it got misnamed)

I think that's confusing. I audited the code and it really is just a simple 1x (vanilla) EMA crossover between a slow and a fast (short / long-term) -- I don't know why it's named that, but i'll be changing the name to LEGACY whenever I get around to updating to add the other EMA crossover variants.
Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 [24] 25 26 27 28 29 30 31 32 33 34 »
  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!