Skip to content

Commit

Permalink
Merge pull request #338 from PTMagicians/develop
Browse files Browse the repository at this point in the history
2.7.1
  • Loading branch information
HojouFotytu committed Jan 22, 2024
2 parents aaf8c2f + 820c676 commit 111c1b1
Show file tree
Hide file tree
Showing 27 changed files with 2,155 additions and 1,208 deletions.
176 changes: 115 additions & 61 deletions Core/DataObjects/PTMagicData.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;

namespace Core.Main.DataObjects.PTMagicData
{
#region Settings Objects
public class GeneralSettingsWrapper
{
public GeneralSettings GeneralSettings { get; set; }
Expand All @@ -21,7 +19,7 @@ public class SecureSettingsWrapper
public SecureSettings SecureSettings { get; set; }
}

#region GeneralSettings

public class GeneralSettings
{
public Application Application { get; set; }
Expand All @@ -43,12 +41,10 @@ public class Application
public string ProfitTrailerDefaultSettingName { get; set; } = "default";
public int FloodProtectionMinutes { get; set; } = 15;
public string Exchange { get; set; }
public double StartBalance { get; set; } = 0;
public string InstanceName { get; set; } = "PT Magic";
public string TimezoneOffset { get; set; } = "+0:00";
public string MainFiatCurrency { get; set; } = "USD";
public string CoinMarketCapAPIKey { get; set; }
public string FreeCurrencyConverterAPIKey { get; set; }
//public string FreeCurrencyConverterAPIKey { get; set; }
}

public class Monitor
Expand All @@ -61,9 +57,11 @@ public class Monitor
public string AnalyzerChart { get; set; } = "";
public int GraphIntervalMinutes { get; set; } = 60;
public int GraphMaxTimeframeHours { get; set; } = 24;
public int ProfitsMaxTimeframeDays { get; set; } = 60;
public int RefreshSeconds { get; set; } = 30;
public int BagAnalyzerRefreshSeconds { get; set; } = 5;
public int BuyAnalyzerRefreshSeconds { get; set; } = 5;
//public int MaxSalesRecords { get; set; } = 99999;
public int MaxTopMarkets { get; set; } = 20;
public int MaxDailySummaries { get; set; } = 10;
public int MaxMonthlySummaries { get; set; } = 10;
Expand Down Expand Up @@ -105,9 +103,7 @@ public class Telegram
public Int64 ChatId { get; set; }
public bool SilentMode { get; set; } = false;
}
#endregion

#region AnalyzerSettings
public class AnalyzerSettings
{
public MarketAnalyzer MarketAnalyzer { get; set; }
Expand All @@ -130,6 +126,7 @@ public class MarketTrend

[DefaultValue("Market")]
public string TrendCurrency { get; set; } = "Market";
public string SplitCamelCaseName { get; set; }

[DefaultValue(0)]
public int MaxMarkets { get; set; } = 0;
Expand Down Expand Up @@ -243,18 +240,12 @@ public class OffTrigger
[DefaultValue(0)]
public int HoursSinceTriggered { get; set; } = 0;
}
#endregion

#region SecureSettings
public class SecureSettings
{
public string MonitorPassword { get; set; } = "";
}
#endregion

#endregion

#region Market Analyzer Objects
public class Market
{
public int Position;
Expand Down Expand Up @@ -290,9 +281,7 @@ public class MarketInfo
public DateTime FirstSeen = Constants.confMinDate;
public DateTime LastSeen = Constants.confMaxDate;
}
#endregion

#region Summary Objects

public class Summary
{
public string Version { get; set; } = "";
Expand Down Expand Up @@ -323,14 +312,26 @@ public class Summary
public string SellStrategy { get; set; } = "";
public string MainMarket { get; set; } = "";
public double MainMarketPrice { get; set; } = 0;
public string MainFiatCurrency { get; set; } = "USD";
public double MainFiatCurrencyExchangeRate { get; set; } = 1;
private PropertiesData _propertiesData = new PropertiesData();
public string MainFiatCurrency => _propertiesData.Currency;
private MiscData _miscData = new MiscData();
public double MainFiatCurrencyExchangeRate => _miscData.FiatConversionRate;
public List<StrategySummary> BuyStrategies { get; set; } = new List<StrategySummary>();
public List<StrategySummary> SellStrategies { get; set; } = new List<StrategySummary>();
public List<StrategySummary> DCABuyStrategies { get; set; } = new List<StrategySummary>();
public List<StrategySummary> DCASellStrategies { get; set; } = new List<StrategySummary>();
}

public class PropertiesData
{
public string Currency { get; set; } = "";
public bool Shorting { get; set; } = false;
public bool Margin { get; set; } = false;
public string UpTime { get; set; } = "";
public int Port { get; set; } = 0;
public bool IsLeverageExchange { get; set; } = false;
public string BaseUrl { get; set; } = "";
}

public class StrategySummary
{
public string Name { get; set; } = "";
Expand Down Expand Up @@ -363,22 +364,7 @@ public class MarketPairSummary
public List<StrategySummary> DCABuyStrategies { get; set; } = new List<StrategySummary>();
public List<StrategySummary> DCASellStrategies { get; set; } = new List<StrategySummary>();
}
#endregion

#region Properties Objects
public class Properties
{
public string Currency { get; set; } = "";
public bool Shorting { get; set; } = false;
public bool Margin { get; set; } = false;
public string UpTime { get; set; } = "";
public int Port { get; set; } = 0;
public bool IsLeverageExchange { get; set; } = false;
public string BaseUrl { get; set; } = "";
}
#endregion

#region Transaction Objects

public class Transaction
{
public string GUID { get; set; } = "";
Expand All @@ -396,9 +382,7 @@ public DateTime GetLocalDateTime(string offset)
return result.DateTime;
}
}
#endregion

#region SingleMarketSettingSummary Objects

public class SingleMarketSettingSummary
{
public string Market { get; set; } = "";
Expand All @@ -414,24 +398,93 @@ public class TriggerSnapshot
public double LastPrice { get; set; } = 0;
public double Last24hVolume { get; set; } = 0;
}
#endregion

#region Profit Trailer JSON Objects

public class SellLogData
{
public double SoldAmount { get; set; }
public DateTime SoldDate { get; set; }
public int BoughtTimes { get; set; }
public string Market { get; set; }
public double ProfitPercent { get; set; }
public double Profit { get; set; }
public double AverageBuyPrice { get; set; }
public double TotalCost { get; set; }
public double SoldPrice { get; set; }
public double SoldValue { get; set; }
}


// public class SellLogData
// {
// public double SoldAmount { get; set; }
// public DateTime SoldDate { get; set; }
// public int BoughtTimes { get; set; }
// public string Market { get; set; }
// public double ProfitPercent { get; set; }
// public double Profit { get; set; }
// public double AverageBuyPrice { get; set; }
// public double TotalCost { get; set; }
// public double SoldPrice { get; set; }
// public double SoldValue { get; set; }
// public double TotalSales { get; set; }
// }

public class StatsData
{
public double SalesToday { get; set; }
public double ProfitToday { get; set; }
public double ProfitPercToday { get; set; }
public double SalesYesterday { get; set; }
public double ProfitYesterday { get; set; }
public double ProfitPercYesterday { get; set; }
public double SalesWeek { get; set; }
public double ProfitWeek { get; set; }
public double ProfitPercWeek { get; set; }
public double SalesThisMonth { get; set; }
public double ProfitThisMonth { get; set; }
public double ProfitPercThisMonth { get; set; }
public double SalesLastMonth { get; set; }
public double ProfitLastMonth { get; set; }
public double ProfitPercLastMonth { get; set; }
public double TotalProfit { get; set; }
public double TotalSales { get; set; }
public double TotalProfitPerc { get; set; }
public double FundingToday { get; set; }
public double FundingYesterday { get; set; }
public double FundingWeek { get; set; }
public double FundingThisMonth { get; set; }
public double FundingLastMonth { get; set; }
public double FundingTotal { get; set; }
public double TotalFundingPerc { get; set; }
public double TotalFundingPercYesterday { get; set; }
public double TotalFundingPercWeek { get; set; }
public double TotalFundingPercToday { get; set; }
}

public class DailyPNLData
{
public string Date { get; set; }
public double CumulativeProfitCurrency { get; set; }
public double Order { get; set; }

}
public class DailyTCVData
{
public string Date { get; set; }
public double TCV { get; set; }
public double Order { get; set; }

}
public class MonthlyStatsData
{
public string Month { get; set; }
public double TotalProfitCurrency { get; set; }
public double TotalSales { get; set; }
public double AvgGrowth { get; set; }
public double Order { get; set; }
}
public class ProfitablePairsData
{
public string Coin { get; set; }
public double ProfitCurrency { get; set; }
public int SoldTimes { get; set; }
public double Avg { get; set; }
}
public class DailyStatsData
{
public string Date { get; set; }
public int TotalSales { get; set; }
public int TotalBuys { get; set; }
public double TotalProfit { get; set; }
public double AvgProfit { get; set; }

public double AvgGrowth { get; set; }
}
public class PTStrategy
{
public string type { get; set; }
Expand Down Expand Up @@ -507,16 +560,17 @@ public class BuyLogData
public List<Strategy> BuyStrategies { get; set; } = new List<Strategy>();
}

public class SummaryData
{
public class MiscData
{
public double Balance { get; set; }
public double StartBalance { get; set; }
public double FiatConversionRate { get; set; }
public double PairsValue { get; set; }
public double DCAValue { get; set; }
public double PendingValue { get; set; }
public double DustValue { get; set; }
public string Market { get; set; }
public string TotalCurrentValue { get; set; }
public string TimeZoneOffset { get; set; }
}

#endregion
}
Loading

0 comments on commit 111c1b1

Please sign in to comment.