thoeve / ptnotifications

41 stars 2 forks source link

PT Notifications

A official ProfitTrailer addon.
The solution to tracking your daily ProfitTrailer profit on the go.

Features and commands

PT Notifications video

Features

Commands

Getting Started

These instructions will get you a copy of the project up and running on your local machine or server.

Prerequisites

What things you need to install the software and how to install them

If you already have ProfitTrailer running on the same machine you can ignore this.

Make sure you have Java 8 (1.8.0_131 and up) installed on your computer. (Java 9 will not work).
Windows & Linux require Java 8 JRE - Download.
Mac OSX requires Java 8 JDK - Download.

License

To run PT Notifications you need to have a valid ProfitTrailer PRO license.

Creating bots

Telegram

Discord

Installing

Download the latest version from the releases page.

Quick notes to success

Prepare your ProfitTrailer instances
Update the PT Notifications settings
#Amount of PT instances you have running
profitTrailer_instances = 1

profitTrailer_address_1 = 
profitTrailer_license_key_1 = 
#Make sure it matches the server.api_token variable in application.properties of your PT instance
profitTrailer_instance_api_token_1 = 
#telegram_channel_id_1 = 
#discord_channel_id_1 =

#Example
#profitTrailer_address_2 = http://localhost:8082
#profitTrailer_license_key_2 = 1234567abcd8910
#profitTrailer_instance_api_token_2 = bot_api_token
#telegram_channel_id_2 = 
#discord_channel_id_2 =

#Enable or disable Telegram notifications
telegram_enabled = true/false
telegram_bot_token = 
telegram_channel_id = 

#Enable or disable Discord notifications
discord_enabled = true/false
discord_bot_token = 
discord_channel_id = 

#Enable or disable Telegram silent notifications (no sound)
silent_notifications = false
#Enable or disable Sell notifications
sell_notifications = true
#Enable or disable Buy notifications
buy_notifications = true
#Enable or disable Sell Only Mode notifications
som_notifications = true
#Enable or disable Profit Trailer error notifications
error_notifications = true
#Enable or disable release/update notifications
update_notifications = true
#Enable or disable access to settings
enable_settings = true
#Add error messages that need to be ignored seperated by a comma i.e. SomeKindOfExchangeError,AnotherExchangeError
error_filter = BinanceWebSocketAdapterKline,APIKEY_INVALID

#Custom buy messages
#Available variables: dcaCount, instanceName, quantity, rate, avgCost, total, percentage        
discord_buy_message_format = <b>Bought {market} </b> ({dcaCount}),\
                            ```ml\nInstance:   {instanceName},\
                            Quantity:   {quantity},\
                            Rate:       {rate},\
                            Avg cost:   {avgCost},\
                            Total:      {total} ({dcaCount}),\
                            Profit:     {percentage}```

telegram_buy_message_format = <b>Bought {market} </b> ({dcaCount}),\
                            Instance: {instanceName},\
                            Quantity: {quantity},\
                            Rate: {rate},\
                            Avg cost: {avgCost},\
                            Total: {total} ({dcaCount}),\
                            Profit: {percentage}

#Custom sell messages
#Available variables: dcaCount, instanceName, strategies, quantity, rate, total, profit, dollar, boughtDate, percentage                     
discord_sell_message_format = <b>Sold {market} </b> ({dcaCount}),\
                            ```ml\nInstance:   {instanceName},\
                            Strategies: {strategies},\
                            Quantity:   {quantity},\
                            Rate:       {rate},\
                            Avg cost:   {avgCost},\
                            Total:      {total} ({dcaCount}),\
                            Profit:     {profit} ({dollar}),\
                            Bought on:  {boughtDate},\
                            Percentage: {percentage}```

telegram_sell_message_format = <b>Sold {market} </b> ({dcaCount}),\
                            Instance: {instanceName},\
                            Strategies: {strategies},\
                            Quantity: {quantity},\
                            Rate: {rate},\
                            Avg cost: {avgCost},\
                            Total: {total} ({dcaCount}),\
                            Profit: {profit} ({dollar}),\
                            Bought on: {boughtDate},\
                            Percentage: {percentage}
Modify buy and sell notifications format

Version 1.2.0 supports the modification of the buy and sell notifications. This can be done by changing the sell_message_format and buy_message_format variables in settings.properties.

The included examples use all of the currently available variables. These variables can be used by including the name of the variable between two brackets as followed {profit}. When creating your own custom message format make sure to end every line in settings.properties with ,\ to indicate the end of a line.

Besides those variables all other format options supported by the chat client can be included. This for example goes for Emoticons and Discord/Telegram text formatting, more info on text formatting can be found here:

Telegram text formatting Discord text formatting

Please avoid using $ and \ characters as that will break the custom format.

Getting PT Notifications to run

Windows

Simply run the Start_windows.cmd file in the zip.

macOS & Linux

Simply run the Start_linux.sh file in the zip.
Or
Open terminal > navigate to the folder containing the .jar.

Run the jar using:
java -jar PTNotifications.jar -XX:+UseG1GC -XX:+UseStringDeduplication -XX:StringDeduplicationAgeThreshold=1 -Xmx128m