Merge pull request #157 from PTMagicians/develop

Bug Fixes
This commit is contained in:
HojouFotytu 2019-10-20 00:18:06 +09:00 committed by GitHub
commit b404f2080d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 86 additions and 444 deletions

View File

@ -21,17 +21,38 @@ namespace Core.Main.DataObjects
private string _ptmBasePath = "";
private PTMagicConfiguration _systemConfiguration = null;
private TransactionData _transactionData = null;
private DateTimeOffset _dateTimeNow = Constants.confMinDate;
private DateTime _buyLogRefresh = DateTime.UtcNow, _sellLogRefresh = DateTime.UtcNow, _dcaLogRefresh = DateTime.UtcNow, _summaryRefresh = DateTime.UtcNow;
private volatile object _buyLock = new object(), _sellLock = new object(), _dcaLock = new object(), _summaryLock = new object();
private TimeSpan? _offsetTimeSpan = null;
// Constructor
public ProfitTrailerData(PTMagicConfiguration systemConfiguration)
{
_systemConfiguration = systemConfiguration;
}
// Convert local offset time to UTC
TimeSpan offsetTimeSpan = TimeSpan.Parse(systemConfiguration.GeneralSettings.Application.TimezoneOffset.Replace("+", ""));
_dateTimeNow = DateTimeOffset.UtcNow.ToOffset(offsetTimeSpan);
// Get a time span for the UTC offset from the settings
private TimeSpan OffsetTimeSpan
{
get
{
if (!_offsetTimeSpan.HasValue)
{
// Get offset for settings.
_offsetTimeSpan = TimeSpan.Parse(_systemConfiguration.GeneralSettings.Application.TimezoneOffset.Replace("+", ""));
}
return _offsetTimeSpan.Value;
}
}
// Get the time with the settings UTC offset applied
private DateTimeOffset LocalizedTime
{
get
{
return DateTimeOffset.UtcNow.ToOffset(OffsetTimeSpan);
}
}
public SummaryData Summary
@ -80,7 +101,7 @@ namespace Core.Main.DataObjects
{
get
{
return SellLog.FindAll(sl => sl.SoldDate.Date == _dateTimeNow.DateTime.Date);
return SellLog.FindAll(sl => sl.SoldDate.Date == LocalizedTime.DateTime.Date);
}
}
@ -88,7 +109,7 @@ namespace Core.Main.DataObjects
{
get
{
return SellLog.FindAll(sl => sl.SoldDate.Date == _dateTimeNow.DateTime.AddDays(-1).Date);
return SellLog.FindAll(sl => sl.SoldDate.Date == LocalizedTime.DateTime.AddDays(-1).Date);
}
}
@ -96,7 +117,7 @@ namespace Core.Main.DataObjects
{
get
{
return SellLog.FindAll(sl => sl.SoldDate.Date >= _dateTimeNow.DateTime.AddDays(-7).Date);
return SellLog.FindAll(sl => sl.SoldDate.Date >= LocalizedTime.DateTime.AddDays(-7).Date);
}
}
@ -104,7 +125,7 @@ namespace Core.Main.DataObjects
{
get
{
return SellLog.FindAll(sl => sl.SoldDate.Date >= _dateTimeNow.DateTime.AddDays(-30).Date);
return SellLog.FindAll(sl => sl.SoldDate.Date >= LocalizedTime.DateTime.AddDays(-30).Date);
}
}
@ -296,8 +317,7 @@ namespace Core.Main.DataObjects
DateTimeOffset ptSoldDate = DateTimeOffset.Parse(dtDateTime.Year.ToString() + "-" + dtDateTime.Month.ToString("00") + "-" + dtDateTime.Day.ToString("00") + "T" + dtDateTime.Hour.ToString("00") + ":" + dtDateTime.Minute.ToString("00") + ":" + dtDateTime.Second.ToString("00"), CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal);
// Convert UTC sales time to local offset time
TimeSpan offsetTimeSpan = TimeSpan.Parse(_systemConfiguration.GeneralSettings.Application.TimezoneOffset.Replace("+", ""));
ptSoldDate = ptSoldDate.ToOffset(offsetTimeSpan);
ptSoldDate = ptSoldDate.ToOffset(OffsetTimeSpan);
sellLogData.SoldDate = ptSoldDate.DateTime;
@ -387,8 +407,7 @@ namespace Core.Main.DataObjects
DateTimeOffset ptFirstBoughtDate = DateTimeOffset.Parse(rdldDateTime.Year.ToString() + "-" + rdldDateTime.Month.ToString("00") + "-" + rdldDateTime.Day.ToString("00") + "T" + rdldDateTime.Hour.ToString("00") + ":" + rdldDateTime.Minute.ToString("00") + ":" + rdldDateTime.Second.ToString("00"), CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal);
// Convert UTC bought time to local offset time
TimeSpan offsetTimeSpan = TimeSpan.Parse(_systemConfiguration.GeneralSettings.Application.TimezoneOffset.Replace("+", ""));
ptFirstBoughtDate = ptFirstBoughtDate.ToOffset(offsetTimeSpan);
ptFirstBoughtDate = ptFirstBoughtDate.ToOffset(OffsetTimeSpan);
dcaLogData.FirstBoughtDate = ptFirstBoughtDate.DateTime;
}
@ -447,8 +466,7 @@ namespace Core.Main.DataObjects
DateTimeOffset ptFirstBoughtDate = DateTimeOffset.Parse(rpldDateTime.Year.ToString() + "-" + rpldDateTime.Month.ToString("00") + "-" + rpldDateTime.Day.ToString("00") + "T" + rpldDateTime.Hour.ToString("00") + ":" + rpldDateTime.Minute.ToString("00") + ":" + rpldDateTime.Second.ToString("00"), CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal);
// Convert UTC bought time to local offset time
TimeSpan offsetTimeSpan = TimeSpan.Parse(_systemConfiguration.GeneralSettings.Application.TimezoneOffset.Replace("+", ""));
ptFirstBoughtDate = ptFirstBoughtDate.ToOffset(offsetTimeSpan);
ptFirstBoughtDate = ptFirstBoughtDate.ToOffset(OffsetTimeSpan);
dcaLogData.FirstBoughtDate = ptFirstBoughtDate.DateTime;
}
@ -507,8 +525,7 @@ namespace Core.Main.DataObjects
DateTimeOffset ptFirstBoughtDate = DateTimeOffset.Parse(rpldDateTime.Year.ToString() + "-" + rpldDateTime.Month.ToString("00") + "-" + rpldDateTime.Day.ToString("00") + "T" + rpldDateTime.Hour.ToString("00") + ":" + rpldDateTime.Minute.ToString("00") + ":" + rpldDateTime.Second.ToString("00"), CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal);
// Convert UTC bought time to local offset time
TimeSpan offsetTimeSpan = TimeSpan.Parse(_systemConfiguration.GeneralSettings.Application.TimezoneOffset.Replace("+", ""));
ptFirstBoughtDate = ptFirstBoughtDate.ToOffset(offsetTimeSpan);
ptFirstBoughtDate = ptFirstBoughtDate.ToOffset(OffsetTimeSpan);
dcaLogData.FirstBoughtDate = ptFirstBoughtDate.DateTime;
}
@ -567,8 +584,7 @@ namespace Core.Main.DataObjects
DateTimeOffset ptFirstBoughtDate = DateTimeOffset.Parse(rpldDateTime.Year.ToString() + "-" + rpldDateTime.Month.ToString("00") + "-" + rpldDateTime.Day.ToString("00") + "T" + rpldDateTime.Hour.ToString("00") + ":" + rpldDateTime.Minute.ToString("00") + ":" + rpldDateTime.Second.ToString("00"), CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal);
// Convert UTC bought time to local offset time
TimeSpan offsetTimeSpan = TimeSpan.Parse(_systemConfiguration.GeneralSettings.Application.TimezoneOffset.Replace("+", ""));
ptFirstBoughtDate = ptFirstBoughtDate.ToOffset(offsetTimeSpan);
ptFirstBoughtDate = ptFirstBoughtDate.ToOffset(OffsetTimeSpan);
dcaLogData.FirstBoughtDate = ptFirstBoughtDate.DateTime;
}

View File

@ -59,8 +59,16 @@ namespace Core.ProfitTrailer
double offsetValue = SystemHelper.TextToDouble(newValueString, 0, "en-US");
if (offsetValue != 0)
{
bool ContainsPercent = false;
if (oldValueString.Contains("%")) {
ContainsPercent = true;
oldValueString = oldValueString.Substring(0, oldValueString.Length - 1);
}
double oldValue = SystemHelper.TextToDouble(oldValueString, 0, "en-US");
result = Math.Round((oldValue + offsetValue), 8).ToString(new System.Globalization.CultureInfo("en-US"));
if (ContainsPercent){
result = result +"%";
}
}
break;
@ -69,11 +77,16 @@ namespace Core.ProfitTrailer
double offsetValuePercent = SystemHelper.TextToDouble(newValueString, 0, "en-US");
if (offsetValuePercent != 0)
{
bool ContainsPercent = false;
if (oldValueString.Contains("%")) {
ContainsPercent = true;
oldValueString = oldValueString.Substring(0, oldValueString.Length - 1);
}
double oldValue = SystemHelper.TextToDouble(oldValueString, 0, "en-US");
if (oldValue < 0) offsetValuePercent = offsetValuePercent * -1;
double oldValueOffset = (oldValue * (offsetValuePercent / 100));
// Use integers for timeout and pairs properties, otherwise double
// Ensure integers for timeout and pairs properties, otherwise double
if (configPropertyKey.Contains("timeout", StringComparison.InvariantCultureIgnoreCase)
|| configPropertyKey.Contains("trading_pairs", StringComparison.InvariantCultureIgnoreCase)
|| configPropertyKey.Contains("buy_volume", StringComparison.InvariantCultureIgnoreCase)
@ -82,7 +95,6 @@ namespace Core.ProfitTrailer
|| configPropertyKey.Contains("rebuy_count", StringComparison.InvariantCultureIgnoreCase)
|| configPropertyKey.Contains("buy_volume", StringComparison.InvariantCultureIgnoreCase))
{
// Ensure some values are rounded up to integers for PT comaptability
result = ((int)(Math.Round((oldValue + oldValueOffset), MidpointRounding.AwayFromZero) + .5)).ToString(new System.Globalization.CultureInfo("en-US"));
}
else
@ -90,6 +102,9 @@ namespace Core.ProfitTrailer
// Use double to calculate
result = Math.Round((oldValue + oldValueOffset), 8).ToString(new System.Globalization.CultureInfo("en-US"));
}
if (ContainsPercent){
result = result +"%";
}
}
break;
default:

View File

@ -67,12 +67,12 @@ namespace Monitor.Pages
PTMagicConfiguration.GeneralSettings.Application.IsEnabled = HttpContext.Request.Form["Application_IsEnabled"].Equals("on");
PTMagicConfiguration.GeneralSettings.Application.TestMode = HttpContext.Request.Form["Application_TestMode"].Equals("on");
PTMagicConfiguration.GeneralSettings.Application.Exchange = HttpContext.Request.Form["Application_Exchange"];
PTMagicConfiguration.GeneralSettings.Application.StartBalance = SystemHelper.TextToDouble(HttpContext.Request.Form["Application_StartBalance"], PTMagicConfiguration.GeneralSettings.Application.StartBalance, "en-US");
PTMagicConfiguration.GeneralSettings.Application.TimezoneOffset = HttpContext.Request.Form["Application_TimezoneOffset"].ToString().Replace(" ", "");
PTMagicConfiguration.GeneralSettings.Application.ProfitTrailerDefaultSettingName = HttpContext.Request.Form["Application_ProfitTrailerDefaultSettingName"];
PTMagicConfiguration.GeneralSettings.Application.FloodProtectionMinutes = SystemHelper.TextToInteger(HttpContext.Request.Form["Application_FloodProtectionMinutes"], PTMagicConfiguration.GeneralSettings.Application.FloodProtectionMinutes);
PTMagicConfiguration.GeneralSettings.Application.InstanceName = HttpContext.Request.Form["Application_InstanceName"];
PTMagicConfiguration.GeneralSettings.Application.CoinMarketCapAPIKey = HttpContext.Request.Form["Application_CoinMarketCapAPIKey"];
PTMagicConfiguration.GeneralSettings.Application.FreeCurrencyConverterAPIKey = HttpContext.Request.Form["Application_FreeCurrencyConverterAPIKey"];
PTMagicConfiguration.GeneralSettings.Monitor.IsPasswordProtected = HttpContext.Request.Form["Monitor_IsPasswordProtected"].Equals("on");
PTMagicConfiguration.GeneralSettings.Monitor.OpenBrowserOnStart = HttpContext.Request.Form["Monitor_OpenBrowserOnStart"].Equals("on");

View File

@ -86,7 +86,10 @@
@if (mps != null && (mps.ActiveSingleSettings == null || mps.ActiveSingleSettings.Count == 0)) {
<th class="align-top"><a href="@Core.Helper.SystemHelper.GetMarketLink(Model.PTMagicConfiguration.GeneralSettings.Monitor.LinkPlatform,Model.PTMagicConfiguration.GeneralSettings.Application.Exchange, dcaLogEntry.Market, Model.Summary.MainMarket)" target="_blank">@dcaLogEntry.Market</a></th>
} else {
<th class="align-top"><a href="@Core.Helper.SystemHelper.GetMarketLink(Model.PTMagicConfiguration.GeneralSettings.Monitor.LinkPlatform,Model.PTMagicConfiguration.GeneralSettings.Application.Exchange, dcaLogEntry.Market, Model.Summary.MainMarket)" target="_blank">@dcaLogEntry.Market</a> <i class="fa fa-exclamation-triangle text-highlight" data-toggle="tooltip" data-placement="top" data-html="true" title="@await Component.InvokeAsync("PairIcon", mps)" data-template="<div class='tooltip' role='tooltip'><div class='tooltip-arrow'></div><div class='tooltip-inner pair-tooltip'></div></div>"></i></th>
<th class="align-top"><a href="@Core.Helper.SystemHelper.GetMarketLink(Model.PTMagicConfiguration.GeneralSettings.Monitor.LinkPlatform,Model.PTMagicConfiguration.GeneralSettings.Application.Exchange, dcaLogEntry.Market, Model.Summary.MainMarket)" target="_blank">@dcaLogEntry.Market</a>
<i class="fa fa-exclamation-triangle text-highlight" data-toggle="tooltip" data-placement="top" data-html="true" title="@await Component.InvokeAsync("PairIcon", mps)" data-template="<div class='tooltip' role='tooltip'><div class='tooltip-arrow'></div><div class='tooltip-inner pair-tooltip'></div></div>">
</i>
</th>
}
// Trend

File diff suppressed because one or more lines are too long

View File

@ -7,7 +7,7 @@ using Core.Helper;
using Core.Main.DataObjects.PTMagicData;
using Microsoft.Extensions.DependencyInjection;
[assembly: AssemblyVersion("2.2.7")]
[assembly: AssemblyVersion("2.2.8")]
[assembly: AssemblyProduct("PT Magic")]
namespace PTMagic

View File

@ -1,326 +0,0 @@
//
// The settings below offer a basic example of some of the options available when using PTMagic.
// You should take your time and adjust these settings according to your own personal preferences.
// Always test your PTMagic settings by running a Profit Trailer bot in TESTMODE, to make sure
// it is performing as you expect.
//
// For more information on these settings, see the wiki at: https://github.com/PTMagicians/PTMagic/wiki/settings.analyzer
{
"AnalyzerSettings": {
"MarketAnalyzer": {
"StoreDataMaxHours": 48, // Number of hours to store market data
"IntervalMinutes": 2, // Interval in minutes for PTMagic to check market trends and triggers
"ExcludeMainCurrency": true, // Excludes the main currency (for example BTC) from market trend analysis
"MarketTrends": [
{
"Name": "15m", // UNIQUE market trend name (to be referenced by your triggers below)
"Platform": "Exchange", // Platform to grab prices from (Allowed values are: CoinMarketCap, Exchange)
"MaxMarkets": 50, // Number of markets/pairs to analyze sorted by 24h volume
"TrendMinutes": 15, // Number of minutes to build a trend (1440 = 24h, 720 = 12h, 60 = 1h)
"TrendCurrency": "Market", // Trend Currency to build the trend against. If set to "Fiat", the trend will
// take the USD value of your main currency into account to build the trend.
// (Allowed values are: Fiat, Market)
"DisplayGraph": false, // Use this trend in the graph on the PTM Monitor dashboard and market analyzer
"DisplayOnMarketAnalyzerList": false // Disply this trend for all coins on the PTM Monitor market analyzer
},
{
"Name": "1h",
"Platform": "Exchange",
"MaxMarkets": 50,
"TrendMinutes": 60,
"TrendCurrency": "Market",
"DisplayGraph": true,
"DisplayOnMarketAnalyzerList": true
},
{
"Name": "6h",
"Platform": "Exchange",
"MaxMarkets": 50,
"TrendMinutes": 360,
"TrendCurrency": "Market",
"DisplayGraph": true,
"DisplayOnMarketAnalyzerList": true
},
{
"Name": "12h",
"Platform": "Exchange",
"MaxMarkets": 50,
"TrendMinutes": 720,
"TrendCurrency": "Market",
"DisplayGraph": true,
"DisplayOnMarketAnalyzerList": true
},
{
"Name": "24h",
"Platform": "Exchange",
"MaxMarkets": 50,
"TrendMinutes": 1440,
"TrendCurrency": "Market",
"DisplayGraph": true,
"DisplayOnMarketAnalyzerList": true
}
]
},
// ================================ GLOBAL SETTINGS ================================
//
"GlobalSettings": [ // Global settings for Profit Trailer properties
//
// -----------------------------
{
"SettingName": "EndOfTheWorld", // ANY UNIQUE name of your setting
"TriggerConnection": "AND", // Define if triggers will be connected by AND or OR
"Triggers": [ // Your triggers for this setting. You can use any of your defined trends from above
{
"MarketTrendName": "1h", // Reference to the market trend specified above
"MaxChange": 0 // The maximum value for this trigger to be true. (Any value below "0" will trigger this)
},
{
"MarketTrendName": "12h",
"MaxChange": -2
},
{
"MarketTrendName": "24h",
"MaxChange": -5
}
],
"PairsProperties": { // Properties for PAIRS.PROPERTIES
// Any valid setting from https://wiki.profittrailer.com/doku.php?id=pairs.properties can be used here.
// You can use a specific value, or apply a discrete OFFSET or OFFSETPERCENT to the value in your default PAIRS setting.
"DEFAULT_sell_only_mode_enabled": true,
"DEFAULT_trailing_profit_OFFSETPERCENT": -50
},
"DCAProperties": { // Properties for DCA.PROPERTIES
"DEFAULT_DCA_trailing_profit_OFFSETPERCENT": -75
}
},
// -----------------------------
{
"SettingName": "TankingDown",
"TriggerConnection": "AND",
"Triggers": [
{
"MarketTrendName": "15m",
"MaxChange": 0
},
{
"MarketTrendName": "1h",
"MaxChange": 0
},
{
"MarketTrendName": "12h",
"MaxChange": 0
},
{
"MarketTrendName": "24h", // Any value between -5 and -3 will make this trigger true.
"MaxChange": -3,
"MinChange": -5 // The minimum value for this trigger to be true. (Any value above "-5" will trigger this)
}
],
"PairsProperties": {
"max_trading_pairs_OFFSET": -2,
"DEFAULT_min_buy_volume_OFFSETPERCENT": 100,
//"DEFAULT_initial_cost_OFFSETPERCENT": -50,
//"DEFAULT_initial_cost_percentage_OFFSETPERCENT": -50,
"DEFAULT_trailing_buy_OFFSETPERCENT": 25,
"DEFAULT_trailing_profit_OFFSETPERCENT": -25
},
"DCAProperties": {
//"DEFAULT_DCA_rebuy_timeout_OFFSETPERCENT": 100,
"DEFAULT_DCA_trailing_buy_OFFSETPERCENT": 25,
"DEFAULT_DCA_trailing_profit_OFFSETPERCENT": -50
},
"IndicatorsProperties": {
}
},
// -----------------------------
{
"SettingName": "BearSighted",
"TriggerConnection": "AND",
"Triggers": [
{
"MarketTrendName": "1h",
"MaxChange": 1
},
{
"MarketTrendName": "12h",
"MaxChange": 0
},
{
"MarketTrendName": "24h",
"MaxChange": -1,
"MinChange": -3
}
],
"PairsProperties": {
"max_trading_pairs_OFFSET": -1,
//"DEFAULT_initial_cost_OFFSETPERCENT": -25,
//"DEFAULT_initial_cost_percentage_OFFSETPERCENT": -25,
"DEFAULT_trailing_buy_OFFSETPERCENT": 10,
"DEFAULT_trailing_profit_OFFSETPERCENT": -10
},
"DCAProperties": {
"DEFAULT_DCA_trailing_buy_OFFSETPERCENT": 10,
"DEFAULT_DCA_trailing_profit_OFFSETPERCENT": -10,
},
"IndicatorsProperties": {
}
},
// -----------------------------
{
"SettingName": "ReadyForLiftOff",
"TriggerConnection": "AND",
"Triggers": [
{
"MarketTrendName": "1h",
"MinChange": 0
},
{
"MarketTrendName": "12h",
"MinChange": 0
},
{
"MarketTrendName": "24h",
"MinChange": 1,
"MaxChange": 3
}
],
"PairsProperties": {
"max_trading_pairs_OFFSET": 1,
//"DEFAULT_initial_cost_OFFSETPERCENT": 10,
//"DEFAULT_initial_cost_percentage_OFFSETPERCENT": 10,
"DEFAULT_trailing_buy_OFFSETPERCENT": -10,
"DEFAULT_A_sell_value_OFFSETPERCENT": 10
},
"DCAProperties": {
"DEFAULT_DCA_trailing_buy_OFFSETPERCENT": -10,
"DEFAULT_DCA_trailing_profit_OFFSETPERCENT": 10,
},
"IndicatorsProperties": {
}
},
// -----------------------------
{
"SettingName": "ToTheMoon",
"TriggerConnection": "AND",
"Triggers": [
{
"MarketTrendName": "1h",
"MinChange": 1
},
{
"MarketTrendName": "12h",
"MinChange": 1
},
{
"MarketTrendName": "24h",
"MinChange": 3
}
],
"PairsProperties": {
"max_trading_pairs_OFFSET": 2,
//"DEFAULT_initial_cost_OFFSETPERCENT": 20,
//"DEFAULT_initial_cost_percentage_OFFSETPERCENT": 20,
"DEFAULT_trailing_buy_OFFSETPERCENT": -10,
"DEFAULT_A_sell_value_OFFSETPERCENT": 20
},
"DCAProperties": {
"DEFAULT_DCA_trailing_buy_OFFSETPERCENT": -20,
"DEFAULT_DCA_trailing_profit_OFFSETPERCENT": 20,
},
"IndicatorsProperties": {
}
},
// -----------------------------
{
"SettingName": "Default",
"PairsProperties": {
"File": "PAIRS.properties"
},
"DCAProperties": {
"File": "DCA.properties"
},
"IndicatorsProperties": {
"File": "INDICATORS.properties"
}
}
],
// ================================ COIN-SPECIFIC SETTINGS ================================
//
"SingleMarketSettings": [ // Single market/pair settings for Profit Trailer properties
// Any setting from https://wiki.profittrailer.com/doku.php?id=pairs.properties
// marked as CS (coin-specific) can be used here.
// Only coins that meet the triggered conditions will have the settings applied.
{
"SettingName": "BlacklistCoins",
"StopProcessWhenTriggered": true,
"Triggers": [
{
"AgeDaysLowerThan": 21
}
],
"PairsProperties": {
"DEFAULT_trading_enabled": false,
"DEFAULT_sell_only_mode_enabled": true,
"DEFAULT_DCA_enabled": false
}
},
// -----------------------------
{
"SettingName": "PumpNDumpProtection",
"TriggerConnection": "OR",
"Triggers": [
{
"MarketTrendName": "1h",
"MarketTrendRelation": "Relative", // The relation of the single market trend. Relative = Single market
// trend compared relative to the market trend
// Absolute = Single market trend viewed on its own
"MinChange": 8
},
{
"MarketTrendName": "12h",
"MarketTrendRelation": "Relative",
"MinChange": 10
},
{
"MarketTrendName": "24h",
"MarketTrendRelation": "Relative",
"MinChange": 12
}
],
"OffTriggers": [
{
"HoursSinceTriggered": 3 // Any coin that triggers this setting, will remain under this setting
// for 3 hours, since the last time it triggered.
}
],
"PairsProperties": {
"DEFAULT_sell_only_mode_enabled": true,
"DEFAULT_DCA_enabled": false
}
},
// -----------------------------
{
"SettingName": "FreefallBlock",
"TriggerConnection": "OR",
"Triggers": [
{
"MarketTrendName": "1h",
"MarketTrendRelation": "Absolute",
"MaxChange": -5
}
],
"OffTriggers": [
{
"HoursSinceTriggered": 1
}
],
"PairsProperties": {
"DEFAULT_sell_only_mode_enabled": true,
"DEFAULT_DCA_enabled": false
}
}
]
}
}

View File

@ -1,9 +0,0 @@
{
"PTMagicBasePath": "YOUR PT MAGIC PATH", // Path to your Profit Trailer Magic main directory (use double backslashes for windows like C:\\PTMagic\\)
"Logging": {
"IncludeScopes": false,
"LogLevel": {
"Default": "Warning"
}
}
}

View File

@ -1,28 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- XSD manual extracted from package NLog.Schema: https://www.nuget.org/packages/NLog.Schema-->
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xsi:schemaLocation="NLog NLog.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
autoReload="true"
internalLogLevel="Info" >
<!-- the targets to write to -->
<targets>
<!-- write logs to file -->
<target xsi:type="File" name="File" fileName="${basedir}/_logs/${shortdate}.txt"
layout="${date} ${level:uppercase=true} - ${message} ${exception:format=type,message,stacktrace}"
archiveEvery="Day"
archiveNumbering="Rolling"
maxArchiveFiles="7" />
<target xsi:type="ColoredConsole" name="Console"
layout="${date} ${level:uppercase=true} - ${message} ${exception:format=type,message,stacktrace}" />
</targets>
<!-- rules to map from logger name to target -->
<rules>
<logger name="*" minlevel="Info" writeTo="Console" />
<logger name="*" minlevel="Info" writeTo="File" />
</rules>
</nlog>

View File

@ -1,48 +0,0 @@
{
"GeneralSettings": {
"Application": {
"IsEnabled": true, // Enables the PTMagic bot (needs restart to take effect)
"TestMode": false, // If TestMode is active, no properties files will be changed
"ProfitTrailerPath": "YOUR PROFIT TRAILER PATH", // Path to your Profit Trailer main directory (use double backslashes for windows like C:\\ProfitTrailer\\)
"ProfitTrailerLicense": "YOUR PROFIT TRAILER LICENSE KEY", // Your Profit Trailer license key (needed to change your settings for PT 2.0 and above)
"ProfitTrailerServerAPIToken": "", //Your Profit Trailer Server API Token
"ProfitTrailerMonitorURL": "http://localhost:8081/", // The URL to your profit trailer monitor (needed to change your settings for PT 2.0 and above)
"ProfitTrailerDefaultSettingName": "default", // Your Profit Trailer default setting name (needed to change your settings for PT 2.0 and above)
"Exchange": "Bittrex", // The exchange your are running Profit Trailer on
"StartBalance": 0, // The balance you had in your wallet when you started working with Profit Trailer
"TimezoneOffset": "+0:00", // Your timezone offset from UTC time
"MainFiatCurrency": "USD", // Your main fiat currency that will be used in the monitor
"FloodProtectionMinutes": 0, // If a price trend is just zig-zagging around its trigger, you may want to protect your settings from getting switched back and forth every minute
"InstanceName": "PT Magic", // The name of the instance of this bot. This will be used in your monitor and your Telegram messages. In case you are running more than one bot, you may set different names to separate them
"CoinMarketCapAPIKey": "", //CoinMarketCap Api
"FreeCurrencyConverterAPIKey": "" // If "MainFiatCurrency" above is anything other than USD, you must obtain an API key from https://free.currencyconverterapi.com/free-api-key
},
"Monitor": {
"IsPasswordProtected": true, // Defines if your monitor will be asking to setup a password on its first start
"OpenBrowserOnStart": false, // If active, a browser window will open as soon as you start the monitor
"Port": 5000, // The port you want to run your monitor on
"RootUrl": "/", // The root Url of your monitor
"GraphIntervalMinutes": 60, // The interval for the monitor market trend graph to draw points
"GraphMaxTimeframeHours": 24, // This will enable you to define the timeframe that your graph for market trends covers
"RefreshSeconds": 30, // The refresh interval of your monitor main page
"LinkPlatform": "TradingView", // The platform to which the pair name will link if you click on it
"MaxTopMarkets": 20, // The amount of top markets being shown in your Sales Analyzer
"MaxDailySummaries": 10, // The amount of "Last Days" being shown in your Sales Analyzer
"MaxMonthlySummaries": 10, // The amount of "Last Months" being shown in your Sales Analyzer
"TvStudyA": "BB@tv-basicstudies", // See available STUDIES at https://www.tradingview.com/wiki/Widget:TradingView_Widget
"TvStudyB": "",
"TvStudyC": "",
"TvStudyD": ""
},
"Backup": {
"IsEnabled": true, // Enables a backup procedure for your properties files. Before every switch PTMagic will backup the current properties
"MaxHours": 12 // Max number of hours to keep backup files
},
"Telegram": {
"IsEnabled": false, // Enables PT Magic to send Telegram messages
"BotToken": "", // Your Telegram bot token
"ChatId": 0, // Your Telegram Chat ID
"SilentMode": false // If SilentMode is active, no notification sound or vibration will happen when the bot sends a Telegram message
}
}
}

View File

@ -1,7 +1,8 @@
//
// The settings below offer a basic example of some of the options available when using PTMagic.
// The settings below offer a simple example of some of the options available when using PTMagic.
// You should take your time and adjust these settings according to your own personal preferences.
// Always test your PTMagic settings by running a Profit Trailer bot in TESTMODE, to make sure
//
// ALWAYS test your PTMagic settings by running a Profit Trailer bot in TESTMODE, to make sure
// it is performing as you expect.
//
// For more information on these settings, see the wiki at: https://github.com/PTMagicians/PTMagic/wiki/settings.analyzer
@ -30,6 +31,15 @@
"Platform": "Exchange",
"MaxMarkets": 50,
"TrendMinutes": 60,
"TrendCurrency": "Market",
"DisplayGraph": false,
"DisplayOnMarketAnalyzerList": true
},
{
"Name": "3h",
"Platform": "Exchange",
"MaxMarkets": 50,
"TrendMinutes": 180,
"TrendCurrency": "Market",
"DisplayGraph": true,
"DisplayOnMarketAnalyzerList": true
@ -58,7 +68,16 @@
"MaxMarkets": 50,
"TrendMinutes": 1440,
"TrendCurrency": "Market",
"DisplayGraph": true,
"DisplayGraph": false,
"DisplayOnMarketAnalyzerList": true
},
{
"Name": "3d",
"Platform": "Exchange",
"MaxMarkets": 50,
"TrendMinutes": 4320,
"TrendCurrency": "Market",
"DisplayGraph": false,
"DisplayOnMarketAnalyzerList": true
}
]
@ -86,7 +105,7 @@
}
],
"PairsProperties": { // Properties for PAIRS.PROPERTIES
// Any valid setting from https://wiki.profittrailer.com/doku.php?id=pairs.properties can be used here.
// Any valid setting from https://wiki.profittrailer.com/doku.php?id=pairs_config can be used here.
// You can use a specific value, or apply a discrete OFFSET or OFFSETPERCENT to the value in your default PAIRS setting.
"DEFAULT_sell_only_mode_enabled": true,
"DEFAULT_trailing_profit_OFFSETPERCENT": -50
@ -249,7 +268,7 @@
// ================================ COIN-SPECIFIC SETTINGS ================================
//
"SingleMarketSettings": [ // Single market/pair settings for Profit Trailer properties
// Any setting from https://wiki.profittrailer.com/doku.php?id=pairs.properties
// Any setting from https://wiki.profittrailer.com/doku.php?id=pairs_config
// marked as CS (coin-specific) can be used here.
// Only coins that meet the triggered conditions will have the settings applied.
{
@ -292,7 +311,7 @@
"OffTriggers": [
{
"HoursSinceTriggered": 3 // Any coin that triggers this setting, will remain under this setting
// for 3 hours, since the last time it triggered.
// for 3 hours even if the trends are no longer true.
}
],
"PairsProperties": {