timolson / cointrader

Coin Trader is a Java-based backend for algorithmically trading cryptocurrencies. It provides data collection and export, complex event processing and triggering, and backtesting - paper trading - live trading.
Other
450 stars 166 forks source link

How to Add an XChange #152

Closed IanWorthington closed 4 years ago

IanWorthington commented 6 years ago

I'm looking at adding support for cryptopia.

On Tim's page "How to Add an XChange", item no 2 is:

o add a singleton entry to Markets

Is this page maybe out of date? I can't find a Markets, nor a list of singletons that represent markets. Does he maybe mean Exchanges.java, which does seem to contain a list of some but not all exchanges (gdax for instance isn't there but does appear to work)?

douggie commented 6 years ago

1) add to pom.xml `

org.knowm.xchange
        <artifactId>xchange-[exchange]</artifactId>
        <version>${xchange.version}</version>
    </dependency>`

2) add static to Exchanges.java i.e. public static final Exchange = Exchange.forSymbolOrCreate("BITMEX", 1, 0.002, 0.002, 0, 0, FeeMethod.PercentagePerUnit, 0.25, 0, FeeMethod.PercentagePerUnit, false); } 3) create helper class to handle any exchange specific logic (there is always some especially on the order side of things so best to add it now!) 3) Add to cointrader.properties `xchange.bittrex.class=org.knowm.xchange.bittrex.BittrexExchange xchange.kraken.helper.class=

fires queries every 30 seconds 20 at a time

xchange.bittrex.rate.queries=2 xchange.bittrex.rate.period=8 xchange.bittrex.listings=XRP.BTC,ETH.BTC,LTC.BTC,NXT.BTC,DCR.BTC,XLM.BTC,QTUM.BTC,WAVES.BTC,MAID.BTC,SALT.BTC,PAY.BTC,XZC.BTC,PIVX.BTC,DCR.BTC,STEEM.BTC,ADA.BTC,REP.BTC,CVC.BTC,BAT.BTC,GNO.BTC 5) update logback.xml with ` to allow logging of all post requests for debugging 6) use the command line to test entering, and cancelling orders.

IanWorthington commented 6 years ago

What does that static in Exchanges actually do? The (admittedly limited, certainly no orders) testing I've done to date doesn't seem to object to it missing.

douggie commented 6 years ago

allows you to define exchange specific parameters such as fees, margin rates, fee methods, margin methods, miniumum order sizes etc.

On Mon, Apr 2, 2018 at 1:40 AM, IanWorthington notifications@github.com wrote:

What does that static in Exchanges actually do? The (admittedly limited, certainly no orders) testing I've done to date doesn't seem to object to it missing.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/timolson/cointrader/issues/152#issuecomment-377829557, or mute the thread https://github.com/notifications/unsubscribe-auth/AENHauRBSGXRR3b6cN6UpcQb0PBpSnq6ks5tkXOXgaJpZM4TC8DD .

douggie commented 6 years ago

or you can just add/updaye such params to the exchange, market or prompt tables at a later date.

On Mon, 2 Apr 2018, 06:45 Douggie melville-clarke, < douggie@melvilleclarke.com> wrote:

allows you to define exchange specific parameters such as fees, margin rates, fee methods, margin methods, miniumum order sizes etc.

On Mon, Apr 2, 2018 at 1:40 AM, IanWorthington notifications@github.com wrote:

What does that static in Exchanges actually do? The (admittedly limited, certainly no orders) testing I've done to date doesn't seem to object to it missing.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/timolson/cointrader/issues/152#issuecomment-377829557, or mute the thread https://github.com/notifications/unsubscribe-auth/AENHauRBSGXRR3b6cN6UpcQb0PBpSnq6ks5tkXOXgaJpZM4TC8DD .