sthewissen / Mynt

An Azure Functions-based crypto currency trading bot; featuring 10 exchanges, 25 indicators, custom strategy support, backtester and more

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Problem with installation and configuration

raphaelpessanha opened this issue · comments

Hello!
I'm using the master version, but I think the bot is not working.

I'm running in the cloud. I followed the installation and configuration step by step, I created all the resources and sql server database, but no table was created. I configurated it to receive the notifications by the telegram, but I did not receive any.

Can you help me identify the problem?
app_settings
resources

When you expand the SellTimer in the left side menu there's an option with a search icon next to it called Monitor. This is the logging for Azure, does it say anything there to what might be the cause?

2018-05-21 22:01:00.012 +00:00 [Information] Starting processing...
2018-05-21 22:01:00.012 +00:00 [Error] Error on BuyTimer
System.ArgumentNullException: Value cannot be null.
Parameter name: connectionString
at Microsoft.WindowsAzure.Storage.CloudStorageAccount.Parse(String connectionString)
at Mynt.Data.AzureTableStorage.AzureTableStorageDataStore.d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Mynt.Data.AzureTableStorage.AzureTableStorageDataStore.d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Mynt.Core.TradeManagers.PaperTradeManager.d__9.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Mynt.Core.TradeManagers.PaperTradeManager.d__20.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Mynt.Functions.SellTimer.d__1.MoveNext()
System.ArgumentNullException : Value cannot be null.
Parameter name: connectionString
at Microsoft.WindowsAzure.Storage.CloudStorageAccount.Parse(String connectionString)
at async Mynt.Data.AzureTableStorage.AzureTableStorageDataSto…

This suggests that a AzureDataStore is being initialized with an empty connection string. Since you want to use SqlServerDataStore you probably didn't change these lines:

https://github.com/sthewissen/Mynt/blob/master/src/Mynt.AzureFunctions/BuyTimer.cs#L53
https://github.com/sthewissen/Mynt/blob/master/src/Mynt.AzureFunctions/SellTimer.cs#L60

They should use SqlServerDataStore instead of AzureTableStorageDataStore.

I added a reference to Mynt.Data.SqlServer to the Mynt.Funtions project and changed the datastore, but it is giving error.

sql_server_error

I did a test using AzureTableStorage and I think it worked.
This is the SellTimer log:

2018-05-22 12: 58: 00.014 + 00: 00 [Information] Starting processing ...
2018-05-22 12: 58: 00.076 +00: 00 [Information] Done ...

But with SqlServer I could not.
I'm also not receiving any messages on the telegram.

Thank you for your help.

This specific error is due to the fact that you're inserting the class name instead of an instance into the SqlServerDataStore. Change that line to:

dataStore: new SqlServerDataStore(new SqlServerOptions()),

Sorry, my mistake...
Now I have these two version errors:

sql_server_error2

Is it really necessary to use SqlServer or does TableStorage work in the same way?

If TableStorage works for you, give it a shot. Doesn't really matter for how the bot works. This error is solved in develop I believe. Think it's becoming time again to push develop into master sometime soon because most of the stuff currently happens on the develop branch.

I really appreciate your attention, I will continue to use TableStorage.

This is the current BuyTimer log, I think it's okay:

2018-05-22 14: 01: 09.940 +00: 00 [Information] Starting processing ...
2018-05-22 14: 01: 09.972 +00: 00 [Information] Currently 10 traders out of 10 ...
2018-05-22 14: 02: 10: 305 +00: 00 [Warning] Not enough candle data for "TUSDBTC" ...
2018-05-22 14: 03: 57.041 +00: 00 [Information] No trade opportunities found ...
2018-05-22 14: 03: 57.041 +00: 00 [Information] Done ...

On the notifications in the Telegram, do I have to do something besides insert the TelegramBotToken and TelegramChatId in the Application settings?

As long as you have set everything up correctly in Telegram you do not. That means you need to create a bot there and figure out your chat ID but I'm guessing you have that figured out already. The bot only sends messages when it buys or sells something though, so perhaps you haven't gotten a message yet because it hasn't done that yet?

That's correct, I already created and configured the telegram bot correctly, but no purchase or sale has yet been made.
I will transfer a small amount of BTC to test in real environment.
Thank you very much for your attention.

Default it uses the PaperTradeManager (a few lines above the SQL configuration). This one doesn't need real money to function so you can test without losing money if you want to.

I understood, much better then ...
And if I want to run in real-world environment, just replace PaperTradeManager with LiveTradeManager at BuyTimer.cs and SellTimer.cs?

Totally correct!

Thank you very much, i 'll now close this issue.