Skip to content
This repository has been archived by the owner on Feb 15, 2022. It is now read-only.

Order type: allow consumer to specify type of order to use #233

Merged
merged 1 commit into from
Jun 9, 2017
Merged

Order type: allow consumer to specify type of order to use #233

merged 1 commit into from
Jun 9, 2017

Conversation

DeviaVir
Copy link
Owner

@DeviaVir DeviaVir commented Jun 6, 2017

Fixes #220

Allow a consumer to pass --order_type to trade and sim, it specifies how to make orders. See the updated README.md for more info.

@tuxitor
Copy link
Contributor

tuxitor commented Jun 6, 2017

Could have updated conf-sample.js with c.order_type default value as well
The addition of order_type is welcome and appreciated.

@DeviaVir
Copy link
Owner Author

DeviaVir commented Jun 6, 2017

@EigilB good point, updated.

@vitorego
Copy link

vitorego commented Jun 6, 2017

According with gdax website the maximum taker fee is 0.25% and not 0.3%
https://www.gdax.com/fees/BTC-USD
https://www.gdax.com/fees/BTC-EUR

@DeviaVir
Copy link
Owner Author

DeviaVir commented Jun 6, 2017

@vitorego there is no support for multiple fees at this time, so I took the maximum. (ETH and LTC are at 0.3%)

@vitorego
Copy link

vitorego commented Jun 6, 2017

Ok. By the way, the simulation will include the fees on profit calculation?

@DeviaVir
Copy link
Owner Author

DeviaVir commented Jun 6, 2017

@vitorego it should, yep. It uses engine.update which uses the same functions as I updated here https://github.com/carlos8f/zenbot/pull/233/files#diff-a41b519e7979a713e894ef8d1b3fe568R473

sim results:

./zenbot.sh sim --order_type=maker --days=7

end balance: 1178.58656402 (17.86%)
buy hold: 1283.09319115 (28.31%)
vs. buy hold: -8.14%
45 trades over 7 days (avg 6.43 trades/day)
win/loss: 12/33
error rate: 73.33%

./zenbot.sh sim --order_type=taker --days=7

end balance: 1032.27556848 (3.23%)
buy hold: 1283.09319115 (28.31%)
vs. buy hold: -19.55%
45 trades over 7 days (avg 6.43 trades/day)
win/loss: 12/33
error rate: 73.33%

The lower end balance is to be expected, since fees are much higher.

@vitorego
Copy link

vitorego commented Jun 6, 2017

@DeviaVir I got very profitable simulations using short periods and low ema, however in live trading the outcome is not same, even is not profitable at all. I guess with maker type orders the live trading will become profitable on short periods an low ema.

@DeviaVir
Copy link
Owner Author

DeviaVir commented Jun 6, 2017

@vitorego makes sense, in live trading and limit orders you have to deal with slippage and filling delays. With maker orders the sim will be more close to reality, but it will not be profitable on short periods and low ema (as that results in more trades, more trades results in more fees), I would actually suggest higher periods and higher EMA.

@nedievas
Copy link
Contributor

nedievas commented Jun 7, 2017

Maybe it's possible to take dynamic user fees from exchange, like Bitfinex - api.bitfinex.com/v1/account_infos?

@DeviaVir
Copy link
Owner Author

DeviaVir commented Jun 7, 2017

@nedievas certainly a good idea, I created #237

@DeviaVir
Copy link
Owner Author

DeviaVir commented Jun 8, 2017

Currently running this in a live test, if it does what it's supposed to do I'll merge (unless anyone else has any objects, of course).

@DeviaVir DeviaVir mentioned this pull request Jun 8, 2017
DeviaVir pushed a commit that referenced this pull request Jun 9, 2017
* Add files via upload

* Delete bitfinex-master.zip

* Create package.json

* final version

* Bitfinex API credentials

* Bitfinex deps

* // fix

* add takerFee

Support ref #233.
Did not test after update as master is not update to #233

* move to /
@DeviaVir DeviaVir merged commit 6534aad into DeviaVir:master Jun 9, 2017
@DeviaVir DeviaVir deleted the deviavir/exchanges/market-order branch June 9, 2017 09:34
@vitorego
Copy link

I know this pull request was already merged. But I got this idea of having a auto mode on the other type. The boy will start with taker orders (no fee) if the slippage goes over a configured value the bot will close the order using the maker type order. What do you think?

supersabbath pushed a commit to supersabbath/zenbot that referenced this pull request Oct 2, 2017
* Add files via upload

* Delete bitfinex-master.zip

* Create package.json

* final version

* Bitfinex API credentials

* Bitfinex deps

* // fix

* add takerFee

Support ref DeviaVir#233.
Did not test after update as master is not update to DeviaVir#233

* move to /
supersabbath pushed a commit to supersabbath/zenbot that referenced this pull request Oct 2, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants