Author

Topic: [Ann] CoinT.Net - An open source trading tool (Bitstamp/BTC-e/Cryptsy) (Read 2943 times)

newbie
Activity: 17
Merit: 0
I just uploaded v 0.0.0.4a, which contains the following
  • Display correct balance for Cryptsy pairs
  • Correct retrieval of links from RSS feeds
  • Fixed crash when currency pairs cannot be retrieved fro Cryptsy
  • Fixed crash when filling Buy Amount when price is 0
  • Display of version number


Thanks again to TheWARLoK for his help via PMs for testing and raising bugs.

Since I can see some serious potential with this project, I'm more than glad to help however I can. Can't wait for the next round.

Keep up the good work!  Grin
newbie
Activity: 10
Merit: 0
I just uploaded v 0.0.0.4a, which contains the following
  • Display correct balance for Cryptsy pairs
  • Correct retrieval of links from RSS feeds
  • Fixed crash when currency pairs cannot be retrieved fro Cryptsy
  • Fixed crash when filling Buy Amount when price is 0
  • Display of version number


Thanks again to TheWARLoK for his help via PMs for testing and raising bugs.
newbie
Activity: 10
Merit: 0
I updated my M$ runtimes to no avail.Downloading VS'13 now.

Also trid your suggestion about the edits. Still crashed with this;

Code:
[05/05/2014 08:35:41] The following exception occurred
Application crashSystem.IO.FileNotFoundException: Could not load file or assembly 'System.Data.SqlServerCe.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified.
File name: 'System.Data.SqlServerCe.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91'
   at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection)
   at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
   at System.Reflection.Assembly.Load(String assemblyString)
   at System.Data.SqlServerCe.ExtensionMethods.SystemDataSqlServerCeSqlCeProviderServices_Instance()

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].


Hope this helps.

I updated the app, this problem should now be fixed. Thanks to TheWARLoK for his precious help. I also fixed a crash for when Cryptsy's pairs cannot be retrieved, and the application should now display up to 8 decimals (if they are present) for numbers
newbie
Activity: 17
Merit: 0
I updated my M$ runtimes to no avail.Downloading VS'13 now.

Also trid your suggestion about the edits. Still crashed with this;

Code:
[05/05/2014 08:35:41] The following exception occurred
Application crashSystem.IO.FileNotFoundException: Could not load file or assembly 'System.Data.SqlServerCe.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified.
File name: 'System.Data.SqlServerCe.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91'
   at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection)
   at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
   at System.Reflection.Assembly.Load(String assemblyString)
   at System.Data.SqlServerCe.ExtensionMethods.SystemDataSqlServerCeSqlCeProviderServices_Instance()

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].


Hope this helps.
newbie
Activity: 10
Merit: 0
Thanks for the tip about the circles. Never would have saw that.

Saw the update on github. On a hunch, downloaded source. Not surprisingly, couldn't load into VS2010Ult. Wonder it that may be part of crash. Missing or outdated runtime library perhaps? Will try another trick to see...



You can use VS Express 2013 for Desktop  (it's free)

http://www.visualstudio.com/downloads/download-visual-studio-vs#d-express-windows-desktop

Regarding the crash, I think it's because SQLCe 4 is not installed on your machine. Would you mind editing the CoinTNet.exe.config and replacing

Code:

  


with
Code:
  
    
      
      
    

  



and see if it works?

Thanks for your feedback Smiley


Edit: the release was compiled as 'Mixed Platform', so it should run on both x86 and x64. However, I know there can be x86/x64 issues when using sqlce.

I don't use SqlCe that much for now, only for news sources and so I could save it in text files. However, I was planning to maybe save candles in a local database, that's why I did not remove it.
newbie
Activity: 17
Merit: 0
Thanks for the tip about the circles. Never would have saw that.

Saw the update on github. On a hunch, downloaded source. Not surprisingly, couldn't load into VS2010Ult. Wonder it that may be part of crash. Missing or outdated runtime library perhaps? Will try another trick to see...

BTW. Is this x86 or x64? Answered my own Qquestio. Not enough coffee yet...  Grin
newbie
Activity: 17
Merit: 0
I just uploaded a new version, with:
  • Added support for Cryptsy
  • List all pairs on BTC-e
  • Multiple bug fixes

Note: I just want to emphasize that is a beta, so there is probably lots if bugs in it. I'd be glad if people trying out this app could report them. I haven't tested thoroughly Cryptsy's API.

Found one... Clicked on News tab, then Manage. News Sources window pops up then BANG.Below is a copy of the error log.
Code:
[04/05/2014 15:33:44] The following exception occurred
Application crashSystem.ArgumentException: Unable to find the requested .Net Framework Data Provider.  It may not be installed.
   at System.Data.Common.DbProviderFactories.GetFactory(String providerInvariantName)
   at System.Data.Entity.Internal.LazyInternalConnection.CreateConnectionFromProviderName(String providerInvariantName)
   at System.Data.Entity.Internal.LazyInternalConnection.InitializeFromConnectionStringSetting(ConnectionStringSettings appConfigConnection)
   at System.Data.Entity.Internal.LazyInternalConnection.TryInitializeFromAppConfig(String name, AppConfig config)
   at System.Data.Entity.Internal.LazyInternalConnection.Initialize()
   at System.Data.Entity.Internal.LazyInternalConnection.get_ProviderName()
   at System.Data.Entity.Internal.LazyInternalContext.InitializeContext()
   at System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType)
   at System.Data.Entity.Internal.Linq.InternalSet`1.Initialize()
   at System.Data.Entity.Internal.Linq.InternalSet`1.get_InternalContext()
   at System.Data.Entity.Infrastructure.DbQuery`1.System.Linq.IQueryable.get_Provider()
   at System.Linq.Queryable.Where[TSource](IQueryable`1 source, Expression`1 predicate)
   at CoinTNet.UI.Forms.NewsSourcesForm.PopulateNewsSourcesList()
   at CoinTNet.UI.Forms.NewsSourcesForm.<.ctor>b__0(Object s, EventArgs e)
   at System.Windows.Forms.Form.OnShown(EventArgs e)
   at System.Windows.Forms.Form.CallShownEvent()
   at System.Windows.Forms.Control.InvokeMarshaledCallbackDo(ThreadMethodEntry tme)
   at System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(Object obj)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Windows.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry tme)
   at System.Windows.Forms.Control.InvokeMarshaledCallbacks()

This is repeatable. Other than that, looks pretty good so far. Will let you know if I find any other problems.
[Update] Also seems you can zoom in a a chart, but can't zoom back out?


Thanks for reporting this crash, I'll have a look.

Regarding the zoom issue, you have to click on the small circles on the left side of the chart, besides the axes. Not convenient, I know. I'll try to add better buttons/keyboard shortcuts.

No I didn't know that, but will have a look. Thanks.

As far as crash, Something missing on my system perhaps?

As to Decimals, was referring to main display, will have another look.

Thanks. Looks very promising. I will let you know if I find anything else.
newbie
Activity: 10
Merit: 0
I just uploaded a new version, with:
  • Added support for Cryptsy
  • List all pairs on BTC-e
  • Multiple bug fixes

Note: I just want to emphasize that is a beta, so there is probably lots if bugs in it. I'd be glad if people trying out this app could report them. I haven't tested thoroughly Cryptsy's API.

Found one... Clicked on News tab, then Manage. News Sources window pops up then BANG.Below is a copy of the error log.
Code:
[04/05/2014 15:33:44] The following exception occurred
Application crashSystem.ArgumentException: Unable to find the requested .Net Framework Data Provider.  It may not be installed.
   at System.Data.Common.DbProviderFactories.GetFactory(String providerInvariantName)
   at System.Data.Entity.Internal.LazyInternalConnection.CreateConnectionFromProviderName(String providerInvariantName)
   at System.Data.Entity.Internal.LazyInternalConnection.InitializeFromConnectionStringSetting(ConnectionStringSettings appConfigConnection)
   at System.Data.Entity.Internal.LazyInternalConnection.TryInitializeFromAppConfig(String name, AppConfig config)
   at System.Data.Entity.Internal.LazyInternalConnection.Initialize()
   at System.Data.Entity.Internal.LazyInternalConnection.get_ProviderName()
   at System.Data.Entity.Internal.LazyInternalContext.InitializeContext()
   at System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType)
   at System.Data.Entity.Internal.Linq.InternalSet`1.Initialize()
   at System.Data.Entity.Internal.Linq.InternalSet`1.get_InternalContext()
   at System.Data.Entity.Infrastructure.DbQuery`1.System.Linq.IQueryable.get_Provider()
   at System.Linq.Queryable.Where[TSource](IQueryable`1 source, Expression`1 predicate)
   at CoinTNet.UI.Forms.NewsSourcesForm.PopulateNewsSourcesList()
   at CoinTNet.UI.Forms.NewsSourcesForm.<.ctor>b__0(Object s, EventArgs e)
   at System.Windows.Forms.Form.OnShown(EventArgs e)
   at System.Windows.Forms.Form.CallShownEvent()
   at System.Windows.Forms.Control.InvokeMarshaledCallbackDo(ThreadMethodEntry tme)
   at System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(Object obj)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Windows.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry tme)
   at System.Windows.Forms.Control.InvokeMarshaledCallbacks()

This is repeatable. Other than that, looks pretty good so far. Will let you know if I find any other problems.
[Update] Also seems you can zoom in a a chart, but can't zoom back out?


Thanks for reporting this crash, I'll have a look.

Regarding the zoom issue, you have to click on the small circles on the left side of the chart, besides the axes. Not convenient, I know. I'll try to add better buttons/keyboard shortcuts.
newbie
Activity: 10
Merit: 0
Question. Why only 2 decimal point resolution rather than 8? Seem it would make it kind of difficult to deal in low value coins or in lower volumes.

Which part of the application are you referring to? The display of decimals is not totally consistent yet, but there is already up to 7 decimals displayed when they are present (not everywhere though, it's sometimes only 5).

For instance, 0.0230000 will be displayed as 0.023, and 0.0230015 will be displayed as 0.0230015.
newbie
Activity: 17
Merit: 0
Question. Why only 2 decimal point resolution rather than 8? Seem it would make it kind of difficult to deal in low value coins or in lower volumes.
newbie
Activity: 17
Merit: 0
I just uploaded a new version, with:
  • Added support for Cryptsy
  • List all pairs on BTC-e
  • Multiple bug fixes

Note: I just want to emphasize that is a beta, so there is probably lots if bugs in it. I'd be glad if people trying out this app could report them. I haven't tested thoroughly Cryptsy's API.

Found one... Clicked on News tab, then Manage. News Sources window pops up then BANG.Below is a copy of the error log.
Code:
[04/05/2014 15:33:44] The following exception occurred
Application crashSystem.ArgumentException: Unable to find the requested .Net Framework Data Provider.  It may not be installed.
   at System.Data.Common.DbProviderFactories.GetFactory(String providerInvariantName)
   at System.Data.Entity.Internal.LazyInternalConnection.CreateConnectionFromProviderName(String providerInvariantName)
   at System.Data.Entity.Internal.LazyInternalConnection.InitializeFromConnectionStringSetting(ConnectionStringSettings appConfigConnection)
   at System.Data.Entity.Internal.LazyInternalConnection.TryInitializeFromAppConfig(String name, AppConfig config)
   at System.Data.Entity.Internal.LazyInternalConnection.Initialize()
   at System.Data.Entity.Internal.LazyInternalConnection.get_ProviderName()
   at System.Data.Entity.Internal.LazyInternalContext.InitializeContext()
   at System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType)
   at System.Data.Entity.Internal.Linq.InternalSet`1.Initialize()
   at System.Data.Entity.Internal.Linq.InternalSet`1.get_InternalContext()
   at System.Data.Entity.Infrastructure.DbQuery`1.System.Linq.IQueryable.get_Provider()
   at System.Linq.Queryable.Where[TSource](IQueryable`1 source, Expression`1 predicate)
   at CoinTNet.UI.Forms.NewsSourcesForm.PopulateNewsSourcesList()
   at CoinTNet.UI.Forms.NewsSourcesForm.<.ctor>b__0(Object s, EventArgs e)
   at System.Windows.Forms.Form.OnShown(EventArgs e)
   at System.Windows.Forms.Form.CallShownEvent()
   at System.Windows.Forms.Control.InvokeMarshaledCallbackDo(ThreadMethodEntry tme)
   at System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(Object obj)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Windows.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry tme)
   at System.Windows.Forms.Control.InvokeMarshaledCallbacks()

This is repeatable. Other than that, looks pretty good so far. Will let you know if I find any other problems.
[Update] Also seems you can zoom in a a chart, but can't zoom back out?
newbie
Activity: 10
Merit: 0
will there be a mac version?

Sorry, I don't plan on developing a Mac version.
newbie
Activity: 9
Merit: 0
will there be a mac version?
sr. member
Activity: 389
Merit: 250
Hi, will have a look, thanks !
newbie
Activity: 10
Merit: 0
I just uploaded a new version, with:
  • Added support for Cryptsy
  • List all pairs on BTC-e
  • Multiple bug fixes

Note: I just want to emphasize that is a beta, so there is probably lots if bugs in it. I'd be glad if people trying out this app could report them. I haven't tested thoroughly Cryptsy's API.
newbie
Activity: 10
Merit: 0
I updated the app to fix a few bugs and add encryption of the API keys
newbie
Activity: 10
Merit: 0
Hello,

https://raw.githubusercontent.com/wishhhmaster/CoinTNet/master/main.png

Source code: https://github.com/wishhhmaster/CoinTNet

Introduction

CoinT.Net is a basic trading application for bitcoins and other altcoins, which enables users to:

  • visualise ticker/candles from exchanges (Bitstamp, Cryptsy and BTC-e for now), with basic indicators (MA, EMA)
  • send buy/sell orders to these exchanges for multiple currencies
  • visualise the order book
  • back test trading strategies (EMA crossing and MACD for now)
  • Retrieve news items from RSS feeds and Twitter

There is also a feature to check forarbitrage opportunities within BTC-e's multiple currencies (but it's just paper trading for now)

This application was mainly inspired by the easybot project:

https://bitcointalksearch.org/topic/ann-easybot-an-opensource-c-trading-tool-354871
https://github.com/codingdna2/easybot

Source Code

CoinT.Net is a Winforms application, developed in C# and Visual Studio 2013 Express (.Net 4.5). The following external libraries are used:

migrap/BitcoinCharts => https://github.com/migrap/BitcoinCharts

DmT021/BtceApi => https://github.com/DmT021/BtceApi

Technical notes

It should not be too hard to add more exchanges, then just need to implement the IExchange interface

The currency pairs that can be traded on BTC-e are hard-coded for now, but it's easy to add more

TODO List

  • Add more exchanges and currencies
  • Add real time trading trading (it's pretty much finished, but has not been tested)
  • Add more indicators
  • Add more trading strategies
  • Use streaming APIs when available

Pre-requisites

Windows OS, with the .Net 4.5 Framework installed

Installation

If you are a developper, you can just use Visual Studio 2013 Express to open the solution and recompile the application.
Otherwise, just extract the following file: https://github.com/wishhhmaster/CoinTNet/raw/master/CointT.Net-Release.zip

Note: I have only tested this app on my 64-bit Win 7 OS, so there might be issues on other versions.

Configuration

There is a configuration file named CoinTNet.exe.config in the executable folder. With that file, you can configure:

  • Bitstamp's API parameters (needed if you want to send orders)
  • BTC-e API's parameters (needed if you want to send orders)
  • Cryptsy's API parameters (needed if you want to send orders)
  • Twitter's parameters (needed if you want to retrieve Tweets)

Warnings

  • The source code is provided as-is. There might be some bugs, so advise you to review the code before using it, especially before making trade orders.
  • Historic data is retrieved from bitcoincharts.com and/or bitcoinwidsom.com, and consequently might not be available (if these websites are down, or if they do not store data for the selected currency pairs, as it is the case with most of Cryptsy's pairs). Most recent data is retrieved directly from the exchanges' APIs, but is often limited to the last few hundred trades (which can span hours or days)
  • The high/low prices for the last 24 hours are not available from Cryptsy's API


Donations

If you find this tool useful, you can show you support with a kind donation:

BTC: 1JctmffLPQtcmTSBEDCDquGDeMprfqxX1k
LTC: LMWkc3JZJLCqWQZLg5wUuWD58tSLtJZZoY


Edit: Added PPC/NMC
Edit 30/04/2014: Added Cryptsy and bug fixes
Jump to: