From 669095c405b4b700378d93d996826dfa86329205 Mon Sep 17 00:00:00 2001 From: HojouFotytu <36724681+HojouFotytu@users.noreply.github.com> Date: Tue, 19 Oct 2021 16:13:50 +0900 Subject: [PATCH 1/8] optional pbl --- Monitor/Pages/_get/DashboardTop.cshtml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Monitor/Pages/_get/DashboardTop.cshtml b/Monitor/Pages/_get/DashboardTop.cshtml index 9bdb3b4..28435eb 100644 --- a/Monitor/Pages/_get/DashboardTop.cshtml +++ b/Monitor/Pages/_get/DashboardTop.cshtml @@ -5,7 +5,9 @@ }
-
+ @if (Model.PTMagicConfiguration.GeneralSettings.Monitor.MaxDashboardBuyEntries>0) + { +

Possible Buys (@Model.PTData.BuyLog.Count)more

@if (Model.PTData.BuyLog.Count == 0) @@ -79,8 +81,9 @@ }
- -
+ } + +

Pairs / DCA / Pending (@Model.PTData.DCALog.Count)more

From c26a13082168621c5be41bacd6d798c27625c85a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 8 Dec 2022 09:01:40 +0000 Subject: [PATCH 2/8] Bump Newtonsoft.Json from 12.0.3 to 13.0.2 in /Core Bumps [Newtonsoft.Json](https://github.com/JamesNK/Newtonsoft.Json) from 12.0.3 to 13.0.2. - [Release notes](https://github.com/JamesNK/Newtonsoft.Json/releases) - [Commits](https://github.com/JamesNK/Newtonsoft.Json/compare/12.0.3...13.0.2) --- updated-dependencies: - dependency-name: Newtonsoft.Json dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- Core/Core.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/Core.csproj b/Core/Core.csproj index ab8a35b..1533bfb 100644 --- a/Core/Core.csproj +++ b/Core/Core.csproj @@ -6,7 +6,7 @@ - + From 45fe404a7a2a330f9af59eeb0b66c6c54d7ce24c Mon Sep 17 00:00:00 2001 From: HojouFotytu Date: Thu, 22 Jun 2023 18:35:43 +0900 Subject: [PATCH 3/8] Revert "Bump Newtonsoft.Json from 12.0.3 to 13.0.2 in /Core" --- .github/ISSUE_TEMPLATE/bug_report.md | 38 ----------------------- .github/ISSUE_TEMPLATE/feature_request.md | 20 ------------ .github/ISSUE_TEMPLATE/other.md | 14 --------- CONTRIBUTING.md | 4 +-- Core/Core.csproj | 2 +- README.md | 4 +-- 6 files changed, 5 insertions(+), 77 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/bug_report.md delete mode 100644 .github/ISSUE_TEMPLATE/feature_request.md delete mode 100644 .github/ISSUE_TEMPLATE/other.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index dd84ea7..0000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,38 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve -title: '' -labels: '' -assignees: '' - ---- - -**Describe the bug** -A clear and concise description of what the bug is. - -**To Reproduce** -Steps to reproduce the behavior: -1. Go to '...' -2. Click on '....' -3. Scroll down to '....' -4. See error - -**Expected behavior** -A clear and concise description of what you expected to happen. - -**Screenshots** -If applicable, add screenshots to help explain your problem. - -**Desktop (please complete the following information):** - - OS: [e.g. iOS] - - Browser [e.g. chrome, safari] - - Version [e.g. 22] - -**Smartphone (please complete the following information):** - - Device: [e.g. iPhone6] - - OS: [e.g. iOS8.1] - - Browser [e.g. stock browser, safari] - - Version [e.g. 22] - -**Additional context** -Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index bbcbbe7..0000000 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -name: Feature request -about: Suggest an idea for this project -title: '' -labels: '' -assignees: '' - ---- - -**Is your feature request related to a problem? Please describe.** -A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] - -**Describe the solution you'd like** -A clear and concise description of what you want to happen. - -**Describe alternatives you've considered** -A clear and concise description of any alternative solutions or features you've considered. - -**Additional context** -Add any other context or screenshots about the feature request here. diff --git a/.github/ISSUE_TEMPLATE/other.md b/.github/ISSUE_TEMPLATE/other.md deleted file mode 100644 index 4220ff5..0000000 --- a/.github/ISSUE_TEMPLATE/other.md +++ /dev/null @@ -1,14 +0,0 @@ ---- -name: Other -about: 'For trouble-shooting and other questions, visit our Discord server: https://discord.gg/KYmHMfk' -title: '' -labels: '' -assignees: '' - ---- - -Posts in the Issues section should be limited to: -- Bug Reports -- Feature Requests - -If you have general questions, please visit our Discord server at: https://discord.gg/KYmHMfk diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ab96d2d..f756ee6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,8 +4,8 @@ ## What we expect from users who want to contribute a pull request - Read the file [_Development/README.md](https://github.com/PTMagicians/PTMagic/blob/master/_Development/README.md) and follow the instructions carefully -- Knowledge of the project PT Magic and what it is supposed to do -- Knowledge of the architecture, the different parts and layers of PT Magic +- In depth knowledge of the project PT Magic and what it is supposed to do +- In depth knowledge of the architecture, the different parts and layers of PT Magic ## What main goal should I follow when I want to implement something and submit my pull request? PT Magic is a project/addon that supports the trading experience of several users of Profit Trailer. diff --git a/Core/Core.csproj b/Core/Core.csproj index 1533bfb..ab8a35b 100644 --- a/Core/Core.csproj +++ b/Core/Core.csproj @@ -6,7 +6,7 @@ - + diff --git a/README.md b/README.md index db3d911..b52f488 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Profit Trailer Magic -[Go here](https://github.com/PTMagicians/PTMagic/releases) to download the latest version. +[Visit the wiki](https://github.com/PTMagicians/PT-Magic/wiki) to learn about this project. -[Visit the wiki](https://github.com/PTMagicians/PT-Magic/wiki) for instructions, and to learn more about this project. +[Go here](https://github.com/PTMagicians/PTMagic/releases) to download the latest version. From aa75e030e0ff37a4aea9636554d38ed8c891dfce Mon Sep 17 00:00:00 2001 From: HojouFotytu <36724681+HojouFotytu@users.noreply.github.com> Date: Thu, 22 Jun 2023 18:46:47 +0900 Subject: [PATCH 4/8] remove pending --- Core/DataObjects/ProfitTrailerData.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/DataObjects/ProfitTrailerData.cs b/Core/DataObjects/ProfitTrailerData.cs index df01a9a..8a9aed5 100644 --- a/Core/DataObjects/ProfitTrailerData.cs +++ b/Core/DataObjects/ProfitTrailerData.cs @@ -384,7 +384,7 @@ namespace Core.Main.DataObjects _dcaLog.AddRange(ParsePairsData(rawPairsLogData, false)); // Parse pending pairs data - _dcaLog.AddRange(ParsePairsData(rawPendingLogData, false)); + //_dcaLog.AddRange(ParsePairsData(rawPendingLogData, false)); // Parse watch only pairs data _dcaLog.AddRange(ParsePairsData(rawWatchModeLogData, false)); From af0c56d901af833ab8d251b1c450880b14f43c66 Mon Sep 17 00:00:00 2001 From: HojouFotytu Date: Thu, 22 Jun 2023 18:57:47 +0900 Subject: [PATCH 5/8] Revert "remove pending orders" --- Core/DataObjects/ProfitTrailerData.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/DataObjects/ProfitTrailerData.cs b/Core/DataObjects/ProfitTrailerData.cs index 8a9aed5..df01a9a 100644 --- a/Core/DataObjects/ProfitTrailerData.cs +++ b/Core/DataObjects/ProfitTrailerData.cs @@ -384,7 +384,7 @@ namespace Core.Main.DataObjects _dcaLog.AddRange(ParsePairsData(rawPairsLogData, false)); // Parse pending pairs data - //_dcaLog.AddRange(ParsePairsData(rawPendingLogData, false)); + _dcaLog.AddRange(ParsePairsData(rawPendingLogData, false)); // Parse watch only pairs data _dcaLog.AddRange(ParsePairsData(rawWatchModeLogData, false)); From 05626b5321964de811fda05ce868ab51b0ab8f1d Mon Sep 17 00:00:00 2001 From: HojouFotytu <36724681+HojouFotytu@users.noreply.github.com> Date: Mon, 26 Jun 2023 17:23:47 +0900 Subject: [PATCH 6/8] 2.6.1 --- Core/Core.csproj | 14 +++--- Core/MarketAnalyzer/Binance.cs | 8 ++-- Core/MarketAnalyzer/BinanceFutures.cs | 8 ++-- Core/MarketAnalyzer/BinanceUS.cs | 8 ++-- Monitor/Monitor.csproj | 4 +- Monitor/Pages/_get/DashboardTop.cshtml | 62 +++++++++++++++++--------- PTMagic/PTMagic.csproj | 2 +- PTMagic/Program.cs | 2 +- 8 files changed, 65 insertions(+), 43 deletions(-) diff --git a/Core/Core.csproj b/Core/Core.csproj index ab8a35b..6d671c2 100644 --- a/Core/Core.csproj +++ b/Core/Core.csproj @@ -1,18 +1,18 @@ - netcoreapp3.1 + netcoreapp7.0 - - + + - - - - + + + + diff --git a/Core/MarketAnalyzer/Binance.cs b/Core/MarketAnalyzer/Binance.cs index 3d28203..1317075 100644 --- a/Core/MarketAnalyzer/Binance.cs +++ b/Core/MarketAnalyzer/Binance.cs @@ -360,12 +360,12 @@ namespace Core.MarketAnalyzer log.DoLogDebug("Binance - Getting ticks for '" + markets.Count + "' markets"); ConcurrentDictionary> marketTicks = new ConcurrentDictionary>(); - int ParallelThrottle = 4; - if (systemConfiguration.AnalyzerSettings.MarketAnalyzer.StoreDataMaxHours > 50) + int ParallelThrottle = 2; + if (systemConfiguration.AnalyzerSettings.MarketAnalyzer.StoreDataMaxHours > 6) { - ParallelThrottle = 2; + ParallelThrottle = 1; log.DoLogInfo("----------------------------------------------------------------------------"); - log.DoLogInfo("StoreDataMaxHours is greater than 50. Historical data requests will be"); + log.DoLogInfo("StoreDataMaxHours is greater than 6. Historical data requests will be"); log.DoLogInfo("throttled to avoid exceeding exchange request limits. This initial "); log.DoLogInfo("run could take more than 30 minutes. Please go outside for a walk..."); log.DoLogInfo("----------------------------------------------------------------------------"); diff --git a/Core/MarketAnalyzer/BinanceFutures.cs b/Core/MarketAnalyzer/BinanceFutures.cs index 1552a66..85e2117 100644 --- a/Core/MarketAnalyzer/BinanceFutures.cs +++ b/Core/MarketAnalyzer/BinanceFutures.cs @@ -357,12 +357,12 @@ namespace Core.MarketAnalyzer log.DoLogDebug("BinanceFutures - Getting ticks for '" + markets.Count + "' markets"); ConcurrentDictionary> marketTicks = new ConcurrentDictionary>(); - int ParallelThrottle = 4; - if (systemConfiguration.AnalyzerSettings.MarketAnalyzer.StoreDataMaxHours > 50) + int ParallelThrottle = 2; + if (systemConfiguration.AnalyzerSettings.MarketAnalyzer.StoreDataMaxHours > 6) { - ParallelThrottle = 2; + ParallelThrottle = 1; log.DoLogInfo("----------------------------------------------------------------------------"); - log.DoLogInfo("StoreDataMaxHours is greater than 50. Historical data requests will be"); + log.DoLogInfo("StoreDataMaxHours is greater than 6. Historical data requests will be"); log.DoLogInfo("throttled to avoid exceeding exchange data request limits. This initial "); log.DoLogInfo("run could take more than 30 minutes. Please go outside for a walk..."); log.DoLogInfo("----------------------------------------------------------------------------"); diff --git a/Core/MarketAnalyzer/BinanceUS.cs b/Core/MarketAnalyzer/BinanceUS.cs index 0b09180..ad72827 100644 --- a/Core/MarketAnalyzer/BinanceUS.cs +++ b/Core/MarketAnalyzer/BinanceUS.cs @@ -370,12 +370,12 @@ namespace Core.MarketAnalyzer log.DoLogDebug("BinanceUS - Getting ticks for '" + markets.Count + "' markets"); ConcurrentDictionary> marketTicks = new ConcurrentDictionary>(); - int ParallelThrottle = 4; - if (systemConfiguration.AnalyzerSettings.MarketAnalyzer.StoreDataMaxHours > 200) + int ParallelThrottle = 2; + if (systemConfiguration.AnalyzerSettings.MarketAnalyzer.StoreDataMaxHours > 6) { - ParallelThrottle = 2; + ParallelThrottle = 1; log.DoLogInfo("----------------------------------------------------------------------------"); - log.DoLogInfo("StoreDataMaxHours is greater than 200. Historical data requests will be"); + log.DoLogInfo("StoreDataMaxHours is greater than 6. Historical data requests will be"); log.DoLogInfo("throttled to avoid exceeding exchange data request limits. This initial "); log.DoLogInfo("run could take more than 30 minutes. Please go outside for a walk..."); log.DoLogInfo("----------------------------------------------------------------------------"); diff --git a/Monitor/Monitor.csproj b/Monitor/Monitor.csproj index ce2658c..a851ef0 100644 --- a/Monitor/Monitor.csproj +++ b/Monitor/Monitor.csproj @@ -1,6 +1,6 @@ - netcoreapp3.1 + netcoreapp7.0 @@ -19,7 +19,7 @@ - + diff --git a/Monitor/Pages/_get/DashboardTop.cshtml b/Monitor/Pages/_get/DashboardTop.cshtml index 28435eb..3a0b262 100644 --- a/Monitor/Pages/_get/DashboardTop.cshtml +++ b/Monitor/Pages/_get/DashboardTop.cshtml @@ -111,6 +111,7 @@ @foreach (Core.Main.DataObjects.PTMagicData.DCALogData dcaLogEntry in Model.PTData.DCALog.OrderByDescending(d => d.ProfitPercent).Take(Model.PTMagicConfiguration.GeneralSettings.Monitor.MaxDashboardBagEntries)) { // Loop through the pairs preparing the data for display Core.Main.DataObjects.PTMagicData.MarketPairSummary mps = null; + if (Model.Summary.MarketSummary.ContainsKey(dcaLogEntry.Market)) { mps = Model.Summary.MarketSummary[dcaLogEntry.Market]; } @@ -149,22 +150,26 @@ // Check for when PT loses the value of a pair bool lostValue = false; - lostValue = (dcaLogEntry.TotalCost == 0.0) || (dcaLogEntry.AverageBuyPrice == 0.0); + lostValue = !(sellStrategyText.Contains("WATCHMODE")) && !(sellStrategyText.Contains("PENDING")) && ((dcaLogEntry.TotalCost == 0.0) || (dcaLogEntry.AverageBuyPrice == 0.0)); // Profit percentage var profitPercentage = dcaLogEntry.ProfitPercent; - if (dcaLogEntry.SellStrategies != null) - { - var gainStrategy = dcaLogEntry.SellStrategies.FirstOrDefault(x => x.Name.Contains(" GAIN", StringComparison.InvariantCultureIgnoreCase)); - if (gainStrategy != null) - { - // Use the gain percentage value as it is accurate to what can be achieved with the order book! - profitPercentage = gainStrategy.CurrentValue; - } - } + // if (dcaLogEntry.SellStrategies != null) + // { + // var gainStrategy = dcaLogEntry.SellStrategies.FirstOrDefault(x => x.Name.Contains(" GAIN", StringComparison.InvariantCultureIgnoreCase)); + // if (gainStrategy != null) + // { + // // Use the gain percentage value as it is accurate to what can be achieved with the order book! + // profitPercentage = gainStrategy.CurrentValue; + // } + // } // Render the row + + if (!sellStrategyText.Contains("PENDING-BUY")) + { + @@ -207,8 +212,8 @@ @if (!@lostValue) { - @if (!sellStrategyText.Contains("WATCHMODE")) - { + //@if (!sellStrategyText.Contains("WATCHMODE")) + //{ @if (sellStrategyText.Contains("CROSSED")) // if leverage, recalculate profit target { @@ -222,17 +227,31 @@ leverage = leverageText.Remove(leverageText.IndexOf(".0)"), leverageText.Length - leverageText.IndexOf(".0)")); leverageValue = double.Parse(leverage); } - profitPercentage = profitPercentage * leverageValue; - double TargetGain = leverageValue * dcaLogEntry.TargetGainValue.Value; - @TargetGain.ToString("#,#0.00", new System.Globalization.CultureInfo("en-US"))% -
-
@profitPercentage.ToString("#,#0.00", new System.Globalization.CultureInfo("en-US"))%
- - } + //profitPercentage = profitPercentage * leverageValue; + + @if ( !(sellStrategyText.Contains("WATCHMODE")) && !(sellStrategyText.Contains("PENDING"))) + { + double TargetGain = leverageValue * dcaLogEntry.TargetGainValue.Value; + @TargetGain.ToString("#,#0.00", new System.Globalization.CultureInfo("en-US"))% +
+
@profitPercentage.ToString("#,#0.00", new System.Globalization.CultureInfo("en-US"))%
+ + } + else + { + +
None
+
+
@profitPercentage.ToString("#,#0.00", new System.Globalization.CultureInfo("en-US"))%
+ + } + + + //} } else { - No Value! + Lost Value! } @@ -243,6 +262,9 @@ Model.TotalBagCost = Model.TotalBagCost + dcaLogEntry.TotalCost; Model.TotalBagGain = Model.TotalBagGain + bagGain; } + + } + } Totals: diff --git a/PTMagic/PTMagic.csproj b/PTMagic/PTMagic.csproj index 10054ea..68d6734 100644 --- a/PTMagic/PTMagic.csproj +++ b/PTMagic/PTMagic.csproj @@ -1,7 +1,7 @@ - netcoreapp3.1 + netcoreapp7.0 diff --git a/PTMagic/Program.cs b/PTMagic/Program.cs index a4be87c..c12762a 100644 --- a/PTMagic/Program.cs +++ b/PTMagic/Program.cs @@ -6,7 +6,7 @@ using Core.Helper; using Microsoft.Extensions.DependencyInjection; -[assembly: AssemblyVersion("2.5.12")] +[assembly: AssemblyVersion("2.6.1")] [assembly: AssemblyProduct("PT Magic")] namespace PTMagic From 35f8aeeb31b4430e394b9cababe77caa047c6005 Mon Sep 17 00:00:00 2001 From: HojouFotytu <36724681+HojouFotytu@users.noreply.github.com> Date: Sat, 1 Jul 2023 12:44:26 +0900 Subject: [PATCH 7/8] BinFutures incorrect markets --- Core/MarketAnalyzer/BinanceFutures.cs | 11 +++++++++-- Monitor/Pages/MarketAnalyzer.cshtml | 3 +++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Core/MarketAnalyzer/BinanceFutures.cs b/Core/MarketAnalyzer/BinanceFutures.cs index 85e2117..b27beb7 100644 --- a/Core/MarketAnalyzer/BinanceFutures.cs +++ b/Core/MarketAnalyzer/BinanceFutures.cs @@ -71,7 +71,7 @@ namespace Core.MarketAnalyzer //New variables for filtering out bad markets float marketLastPrice = currencyTicker["lastPrice"].ToObject(); float marketVolume = currencyTicker["volume"].ToObject(); - if (marketLastPrice > 0 && marketVolume > 0) + if (marketLastPrice > 0 && marketVolume > 0 && marketName.EndsWith(mainMarket)) { // Set last values in case any error occurs @@ -92,8 +92,15 @@ namespace Core.MarketAnalyzer } else { - //Let the user know that the problem market was ignored. + //Let the user know that a problem market was ignored. + if (!marketName.EndsWith(mainMarket)) + { + log.DoLogInfo("BinanceFutures - Incorrect base currency: " + marketName + " ignored"); + } + else + { log.DoLogInfo("BinanceFutures - Ignoring bad market data for " + marketName); + } } } diff --git a/Monitor/Pages/MarketAnalyzer.cshtml b/Monitor/Pages/MarketAnalyzer.cshtml index 15bd1d1..826d417 100644 --- a/Monitor/Pages/MarketAnalyzer.cshtml +++ b/Monitor/Pages/MarketAnalyzer.cshtml @@ -250,6 +250,8 @@ else @foreach (string market in Model.Summary.MarketSummary.Keys.OrderBy(m => m)) { + if (market.EndsWith(Model.Summary.MainMarket)) + { Core.Main.DataObjects.PTMagicData.MarketPairSummary mps = Model.Summary.MarketSummary[market]; int marketTrendsDisplayed = 0; @@ -294,6 +296,7 @@ else } + } } From d1370bf2890651931b995b57d91a6781e06e2e2b Mon Sep 17 00:00:00 2001 From: HojouFotytu <36724681+HojouFotytu@users.noreply.github.com> Date: Sat, 1 Jul 2023 14:45:51 +0900 Subject: [PATCH 8/8] removed obsolete permission flag --- Monitor/Program.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Monitor/Program.cs b/Monitor/Program.cs index 4d9066d..607610a 100644 --- a/Monitor/Program.cs +++ b/Monitor/Program.cs @@ -10,7 +10,7 @@ namespace Monitor public class Program { // Main entry point - [SecurityPermission(SecurityAction.Demand, Flags = SecurityPermissionFlag.ControlAppDomain)] + //[SecurityPermission(SecurityAction.Demand, Flags = SecurityPermissionFlag.ControlAppDomain)] public static void Main(string[] args) { // Register a global exception handler