diff --git a/CHANGELOG.md b/CHANGELOG.md index e5ef3317..04dda9b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,8 +7,9 @@ All notable changes to this project will be documented in this file. - Added the prefix to environment parameter for `TRADINGVIEW` related - [#616](https://github.com/chrisleekr/binance-trading-bot/pull/616) - Fixed the issue with minNotional - [#623](https://github.com/chrisleekr/binance-trading-bot/pull/623) - Add clear symbols button by [@TheSmuks](https://github.com/TheSmuks) - [#626](https://github.com/chrisleekr/binance-trading-bot/pull/626) +- Improved customised setting details by [@rando128](https://github.com/rando128) - [#625](https://github.com/chrisleekr/binance-trading-bot/pull/625) -Thanks [@TheSmuks](https://github.com/TheSmuks) for your great contributions. 💯 :heart: +Thanks [@TheSmuks](https://github.com/TheSmuks) and [@rando128](https://github.com/rando128) for your great contributions. 💯 :heart: ## [0.0.97] - 2023-03-21 diff --git a/public/js/CoinWrapperSetting.js b/public/js/CoinWrapperSetting.js index cf8af2d8..e39921fe 100644 --- a/public/js/CoinWrapperSetting.js +++ b/public/js/CoinWrapperSetting.js @@ -20,6 +20,30 @@ class CoinWrapperSetting extends React.Component { isCustomised = configurationKeyName => configurationKeyName !== 'configuration'; + jsonValueAtPath = (obj, path) => { + // Extract the value of the object at the given path + const value = path.split('.').reduce((acc, key) => { + if (key.includes('[')) { + const index = key.match(/\d+/)[0]; + const arrKey = key.split('[')[0]; + return acc[arrKey][index]; + } else { + if (acc && acc.hasOwnProperty(key)) return acc[key]; + else return -1; + } + }, obj); + return value; + }; + + warnIfAttributeCustomised = (path, globalPath = path) => { + if ( + this.jsonValueAtPath(this.props.symbolInfo.symbolConfiguration, path) !== + this.jsonValueAtPath(this.props.configuration, globalPath) + ) + return 'text-warning'; + else return ''; + }; + render() { const { collapsed } = this.state; const { symbolInfo } = this.props; @@ -44,7 +68,10 @@ class CoinWrapperSetting extends React.Component {
Grid Trade #{i + 1}
-
+
Trigger percentage{' '} @@ -56,25 +83,39 @@ class CoinWrapperSetting extends React.Component { {(parseFloat(grid.triggerPercentage - 1) * 100).toFixed(2)}%
-
+
Stop percentage:
{(parseFloat(grid.stopPercentage - 1) * 100).toFixed(2)}%
-
+
Limit percentage:
{(parseFloat(grid.limitPercentage - 1) * 100).toFixed(2)}%
-
+
Min purchase amount:
{grid.minPurchaseAmount} {quoteAsset}
-
+
Max purchase amount:
{grid.maxPurchaseAmount} {quoteAsset} @@ -93,25 +134,38 @@ class CoinWrapperSetting extends React.Component {
Grid Trade #{i + 1}
-
+
Trigger percentage:
{(parseFloat(grid.triggerPercentage - 1) * 100).toFixed(2)}%
-
+
Stop percentage:
{(parseFloat(grid.stopPercentage - 1) * 100).toFixed(2)}%
-
+
Limit percentage:
{(parseFloat(grid.limitPercentage - 1) * 100).toFixed(2)}%
-
+
Quantity Percentage:
{(parseFloat(grid.quantityPercentage) * 100).toFixed(2)}% @@ -154,13 +208,19 @@ class CoinWrapperSetting extends React.Component { className={`coin-info-content-setting ${collapsed ? 'd-none' : ''}`}>
Candles
-
+
Interval:
{symbolConfiguration.candles.interval}
-
+
Limit:
{symbolConfiguration.candles.limit} @@ -170,7 +230,12 @@ class CoinWrapperSetting extends React.Component {
Buy
-
+
Trading enabled: {symbolConfiguration.buy.enabled ? ( @@ -186,7 +251,10 @@ class CoinWrapperSetting extends React.Component {
Buy - Last buy price removal threshold
-
+
Remove last buy price under: @@ -200,7 +268,10 @@ class CoinWrapperSetting extends React.Component {
Buy - Restriction with ATH
-
+
Restriction Enabled: {symbolConfiguration.buy.athRestriction.enabled ? ( @@ -210,19 +281,28 @@ class CoinWrapperSetting extends React.Component { )}
-
+
Candles - Interval:
{symbolConfiguration.buy.athRestriction.candles.interval}
-
+
Candles - Limit:
{symbolConfiguration.buy.athRestriction.candles.limit}
-
+
Restriction Percentage:
{( @@ -237,7 +317,10 @@ class CoinWrapperSetting extends React.Component {
Buy - TradingView
-
+
Allow when recommendation is Strong buy: @@ -249,7 +332,10 @@ class CoinWrapperSetting extends React.Component { )}
-
+
Allow when recommendation is Buy: @@ -265,7 +351,12 @@ class CoinWrapperSetting extends React.Component {
Sell
-
+
Trading enabled: {symbolConfiguration.sell.enabled ? ( @@ -280,7 +371,10 @@ class CoinWrapperSetting extends React.Component {
Sell - Stop Loss
-
+
Stop Loss Enabled: {symbolConfiguration.sell.stopLoss.enabled ? ( @@ -290,7 +384,10 @@ class CoinWrapperSetting extends React.Component { )}
-
+
Max Loss Percentage:
{( @@ -300,7 +397,10 @@ class CoinWrapperSetting extends React.Component { %
-
+
Temporary disable buy:
{moment @@ -311,7 +411,10 @@ class CoinWrapperSetting extends React.Component { .humanize()}
-
+
Order Type:
{symbolConfiguration.sell.stopLoss.orderType} @@ -321,7 +424,10 @@ class CoinWrapperSetting extends React.Component {
Sell - TradingView
-
+
Force sell when recommendation is Neutral: @@ -334,7 +440,10 @@ class CoinWrapperSetting extends React.Component { )}
-
+
Force sell when recommendation is Sell: @@ -347,7 +456,10 @@ class CoinWrapperSetting extends React.Component { )}
-
+
Force sell when recommendation is Strong sell: @@ -362,11 +474,42 @@ class CoinWrapperSetting extends React.Component {
+
+
Conservative Mode
+
+ + Conservative Sell Enabled: + + + {symbolConfiguration.sell.conservativeMode.enabled ? ( + + ) : ( + + )} + +
+
+ Conservative ratio: +
+ {symbolConfiguration.sell.conservativeMode.factor} +
+
+
+
Bot Options - Auto Trigger Buy
-
+
Enabled: {symbolConfiguration.botOptions.autoTriggerBuy.enabled ? ( @@ -376,7 +519,10 @@ class CoinWrapperSetting extends React.Component { )}
-
+
Trigger after:
{moment @@ -387,7 +533,10 @@ class CoinWrapperSetting extends React.Component { .humanize()}
-
+
Re-schedule when the current price is over ATH restriction: @@ -400,7 +549,10 @@ class CoinWrapperSetting extends React.Component { )}
-
+
Re-schedule when the action is disabled: @@ -413,7 +565,10 @@ class CoinWrapperSetting extends React.Component { )}
-
+
TradingView Overriden Interval: @@ -425,7 +580,10 @@ class CoinWrapperSetting extends React.Component { : 'Use TradingView'}
-
+
Allow when TradingView recommendation is Strong buy : @@ -439,7 +597,10 @@ class CoinWrapperSetting extends React.Component { )}
-
+
Allow when TradingView recommendation is Buy: @@ -456,7 +617,10 @@ class CoinWrapperSetting extends React.Component {
Bot Options - TradingView
-
+
Interval: {symbolConfiguration.botOptions.tradingView.interval !== '' @@ -464,7 +628,10 @@ class CoinWrapperSetting extends React.Component { : symbolConfiguration.candles.interval}
-
+
Use data only updated within: @@ -472,7 +639,10 @@ class CoinWrapperSetting extends React.Component { {symbolConfiguration.botOptions.tradingView.useOnlyWithin}
-
+
If data passed "Use data only updated within":