Skip to content

Commit cb43811

Browse files
author
nicehashdev
committed
Update README.md
1 parent 8ad1bb8 commit cb43811

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ NiceHash bot for automatic order management.
55
- [How to run?](#run)
66
- [How to compile?](#compile)
77
- [Tips for programmers](#tips)
8+
- [Create custom order handler](#handler)
89

910
# <a name="features"></a> Features
1011

@@ -16,6 +17,7 @@ NiceHash bot for automatic order management.
1617
- Ability to adjust max price and speed limit for each monitored order
1718
- Pool manager to easily define new pools, remove them or use for orders
1819
- Console window showing all important events or errors
20+
- Custom order handlers
1921

2022
# <a name="run"></a> Instructions on how to run
2123

@@ -33,3 +35,11 @@ NiceHash bot for automatic order management.
3335
# <a name="tips"></a> For programmers
3436

3537
You can easily create your own bot software by reusing this code. NiceHashBotLib is the core of everything - modifications of this library should not be needed. Examine NiceHashBot project to see how NiceHashBotLib is used. You can create your own bot with little coding knowledge by just calling certain methods of OrderInstance class such as 'SetMaximalPrice', 'SetLimit' and 'Stop'. With these methods you have full control of what is happening with the order - NiceHashBotLib takes care of evaluating current orders and adjusting lowest possible price.
38+
39+
# <a name="handler"></a> How to create custom order handler?
40+
41+
NiceHashBot allows you to programmatically adjust 'MaxPrice' and 'Limit' for each order by creating custom C# DLL. Take a look at existing example: https://github.com/nicehash/NiceHashBot/blob/master/src/HandlerExample/HandlerClass.cs
42+
43+
DLL has to contain class 'HandlerClass' and public static method 'HandleOrder' inside that class. Method 'HandleOrder' is called two times per second. It gets parameters statistics of order, current maximal price and current speed limit. Inside the method, you should perform all the logic related to calculation of maximal price and speed limit. After you finish with calculation, just assign new numbers to 'MaxPrice' and/or 'NewLimit' or leave them intact, if you do not wish to change them. The provided example shows, how this is done by calling CoinWarz API, deserializing JSON and setting maximal price according to performed profitability calculation.
44+
45+
You can easily create own order handler. You need to have Visual Studio 2010 or later. Make copy of HandlerExample project (optionally you can rename it), modify code inside 'HandleOrder' method. You can add your own classes, methods and properties, just remember that 'HandleOrder' is called twice per second when NiceHashBot is running and you have set this handler to be order handler for your order. When finished with programming, rebuild project to create DLL. Use this DLL as order handler.

0 commit comments

Comments
 (0)