Show Posts
|
Pages: [1] 2 »
|
Entry post was updated. Updated demo builds of trading bot (t_bot)
core was updated to 1.1.06b changelog: - workaround for issue when "GetBalance" request does not work for some c-currencies - enhanced "scalping2" strategy
|
|
|
Entry post was updated. Added demo build of trading bot (t_bot)
t_sim core was updated to 1.1.04b changelog: - refactoring - added new trading strategy : "scalping2", configured by "scalping2StrategyConfig" struct in config.json (format of strategy settings is pretty similar to "scalping" config )
|
|
|
t_sim and history_collector were updated to 1.0.16b changelog: - MacOSX: fixed random crash during trading with several strategies simultaneously - All platforms: fixed several potential memory leaks
|
|
|
Entry post was updated. MacOSX build of tSim was added. Tested with MacOSX 10.13 (High Sierra) HistoryCollector's version was changed to 1.0.15b. Both projects uses same codebase so I do not see reasons to keep separate versioning.
|
|
|
Entry post was updated - MacOSX build of History collector 1.0.15b was added. Tested with MacOSX 10.13 (High Sierra)
|
|
|
tSim was updated to 1.0.15b - now Backtesting mode disabled by default. (You do not need declare ["isBacktester" : false] anymore for realtime simulation) - couple minor improvements
Entry post was updated. Linux builds of tSim and History collector was added. Compiled with gcc 5.4, tested with Ubuntu 16.04.
|
|
|
tSim was updated to 1.0.14b changelog: - backtesting was optimized.
|
|
|
tSim was updated to 1.0.13b changelog: - added backtesting mode.
To enable backtesting mode you should add this line to main config file: "isBacktester" : true, to specify database file with historycal data you should add: "backtestingDataBase" : "cryptopiahistory.sqlite", Where "cryptopiahistory.sqlite" - name of the SQLite database file. It should be located in the same folder as tSim. You can create/fill such file with HistoryCollector1.0.1b.
|
|
|
HistoryCollector was updated to 1.0.1b (link and description was moved to entry post) changelog: - Fixed premature program stop - Added ability to specify timeframes to store in database. If skipped no candles will be stored Example: "historyCollectorConfig" : { "timeframes" : [ { "symbol" : "m5" }, { "symbol" : "m15" }, { "symbol" : "h1" } ] } Supported timeframes: m5, m10, m15, m30, h1, h2, h4, h8, h12, h16, d1, w1
P.S.: tSim + HistoryCollector = seems now I can add support of some kind of backtesting
|
|
|
tSim was updated to 1.0.12b changelog: - fixed premature stop of some strategy due to condition of "allowable losses" if several different strategies run simultaneously - now the profit will be shown only after the completion of all strategies. Work on tSim project is temporary suspended (for several weeks, I believe) Reason: Cryptopia's Public API uses strange and uncommon way to provide historical data. GetMarketHistory method gives list of closed trades (1000 maximum). In practice this means about 2 hours of trading history on high loaded market (like BTC_USDT). Thus, there is no possibility to implement some classic trading strategies based on indicators based on analysis of "candlesticks". Seems like I have to implement separate service(project) to collect historical data from Cryptopia and build "candle" streams for several timeframes (m5, m10, m15, m30 etc), and keep them in local storage. Of course, I could use third-party source of such "candle" history, but in this case we will have to trust one more participant in trading process. I prefer to minimize count of dependencies.
Next update of this thread will relate to new project.
|
|
|
tSim was updated to 1.0.11b changelog: - strategy logging moved to separate log files (scalping.txt, pingpong.txt). [Not sure about it, could be reworked] - couple minor bug fixed (logging)
|
|
|
tSim was updated to 1.0.10b changelog: - Improved stability (on client side) during API failures (on server side)
|
|
|
Following is all the different post parameters i have tried sending: That works for me. Authentication is NOT the issue, or every other private API call would fail as well. Post parameters must also be handled appropriately by my implementation since cancelling a trade (with order_id as post parameter) works just fine. And most of my attempts at getting all balances "work" in the way that they do not throw an error ;
What about API call without params? Do you still get Bad Request in case of "{}"? maybe MD5 hashing incorrect if JSON is only "{}"?(I made such mistake in my code). Or maybe it is due to utf-8 coding? Or just Python specific thing? Can you let me know how your api call looks like?
That is literally HTTP request I send to get balance list(except "<your:authorization:data>", of course): --------start-------------- POST https://www.cryptopia.co.nz/api/getbalance HTTP/1.1 Host: www.cryptopia.co.nzContent-Type: application/json Content-Length: 2 Accept: */* Authorization: amx <your:authorization:data> Connection: close {} --------end--------------
|
|
|
Please let me know when/if it starts working for you again. I am trying a couple times everyday to receive all balances ; still same issue over and over. Only getting $PAC balance.
Private API is working fine right now. Try to test your implementation of API calls. If it steel does not work then probably you should look problem on your side (wrong json format, incorrect computation of authentication header etc)
|
|
|
tSim was updated to 1.0.9b changelog: - added new trading strategy - "scalping". - added settings for new strategy - "scalpingStrategyConfig". format same as "pingpong" settings. - now you can use several strategies. They will run simultaneously. (Do we need parameter for serial/parallel running?) Example: "includeMarkets" : [ { "symbol" : "BTC_USDT", "tradingStrategy" : "scalping" }, { "symbol" : "ZEC_USDT", "tradingStrategy" : "pingpong" } ] Note: logging still goes into one file log.txt, Probably I should split logging by strategies. Due to Cryptopia team's experiments with private API(or issues) last days, I could not check real profitability of "scalping", but simulation shows much better profit than with "pingpong"(or maybe I just got lucky)
|
|
|
So you are able to retrieve all balances? Is your programming language also Python? ...
Yes, I retrieve all balances this way. No, I do not use Python in my practice. My suggestion was: "Check request that you are trying to send to the server". You should compare string that you try to send to the server and said example of GetBalance http request. I do not know how you build your http requests (or it's headers and payload). Also you can compare your code with Python example in https://www.cryptopia.co.nz/Forum/Thread/262 def api_query( method, req = None ): if not req: req = {} ...skipped... post_data = json.dumps( req ); ...skipped... headers = { 'Authorization': header_value, 'Content-Type':'application/json; charset=utf-8' } r = requests.post( url, data = post_data, headers = headers )
Pay attention to this: if not req: req = {} ... I interpret this as follows: Currency parameter OR CurrencyId parameter is required. Do you disagree?
I agree it may be subtle thing but lets compare GetBalance description and GetDepositAddress description GetBalance ... Input: Currency: (optional) The currency symbol of the balance to return e.g. 'DOT' (not required if 'CurrencyId' supplied) CurrencyId: (optional) The Cryptopia currency identifier of the balance to return e.g. '2' (not required if 'Currency' supplied)
GetDepositAddress ... Input: Currency: The currency symbol of the address to return e.g. 'DOT' (not required if 'CurrencyId' supplied) CurrencyId: The Cryptopia currency identifier of the address to return e.g. '2' (not required if 'Currency' supplied)
In GetBalance both parameters are "optional", that means you can skip both if you do not want specify any currency. UPDATE: Cryptopia API has glitches during couple last weeks, your issue can be provoked by experiments of Cryptopia team. I have got today same behavior of GetBalance as you. CancelTrade broken too.
|
|
|
Hey cryptopians and officials! I was wondering if anyone can tell me how i get all my balances with API, and not just a single balance. Currently I am using this implementation of the API and it only has this method I contacted support about it, and got a very generic "look at the documentation" response. Which i have.. Now, waiting for the follow-up reply of my slightly more aggressive update, i thought i'd consult here. I have tried modifying the implementation to not take the coin parameter (formally known as 'Currency' parameter in post request to cryptopia server) so that it doesn't take any specific coin parameter and sends it along as the 'Currency' but rather leaves out the post parameter entirely. This results in a Bad Request response. I have tried passing 'None' as the coin parameter, and also tried passing an empty string as 'Currency' parameter. Both of which acts somewhat weird, in that they return the balances only for $PAC currency. I assume because it's the first currency alphabetically. Anyone know how to do it, or have suggestions to what i could try ; it would be greatly appreciated. Check request that you are trying to send to the server. If you want get all balances you should send POST request without parameters in JSON part. BUT JSON PART MUST BE PRESENTED. I mean If you want get your BTC balance it should be : {Currency: "BTC"}, if you want get all balances it should be : {}. I'm almost sure you got Bad Request response because of missed JSON part. Whole HTTP request should look like this: --------start-------------- POST https://www.cryptopia.co.nz/api/getbalance HTTP/1.1 Host: www.cryptopia.co.nzContent-Type: application/json Content-Length: 2 Accept: */* Authorization: amx <your:authorization:data> Connection: close {} --------end-------------- And "look at the documentation" pretty right advice. Do not neglect it.
|
|
|
tSim was updated to 1.0.8b changelog: - optimized preparation for trading (less http requests) - updated format of trading strategy settings : "totalBaseAmountToTrade" and "orderBaseAmount" are lists now. Example: ... "totalBaseAmountToTrade" : [ { "symbol" : "USDT", "amount" : 10 }, { "symbol" : "BTC", "amount" : 0.10 } ], "orderBaseAmount" : [ { "symbol" : "USDT", "amount" : 2 }, { "symbol" : "BTC", "amount" : 0.001 } ], ...
|
|
|
Very good work OP. But: is there any need of simulating trading on cryptopia where the volumes are low and no many trades will trigger?
I choose Cryptopia mostly because I have an Cryptopia's account, so i can compare simulation of autotrading algorithm and autotrading on real account with same algorithm. Support of new API not so big problem in scale of whole project, i can add another exchange API at any moment(not literally, of course - it can take several days). All last updates are not directly related to API, they more affect usability and bug fixing. Adding support of another exchange does not make sense since "b" in version mean "beta" Or are you practicing your coding skills to make something more valuable in the future? Good luck.
Probably, yes. But I do not worry about my coding skills too much, I have enough experience in software development.
|
|
|
tSim was updated to 1.0.7b changelog: - added exploring status of currency/market before trading start. Warning is displayed when currency/market can be delisted/closed. Example: 
|
|
|
|