Fix Plot dataframe and plot profit

This commit is contained in:
NewLaptopMSI_Manu 2018-05-13 13:11:30 +02:00
parent 1e119013c8
commit d046b7dd36
3 changed files with 8 additions and 12 deletions

View File

@ -202,8 +202,8 @@ class Backtesting(object):
# record a tuple of pair, current_profit_percent, # record a tuple of pair, current_profit_percent,
# entry-date, duration # entry-date, duration
records.append((pair, trade_entry[1], records.append((pair, trade_entry[1],
row.date.strftime('%s'), str(int(row.date.timestamp())),
row2.date.strftime('%s'), str(int(row2.date.timestamp())),
index, trade_entry[3])) index, trade_entry[3]))
# For now export inside backtest(), maybe change so that backtest() # For now export inside backtest(), maybe change so that backtest()
# returns a tuple like: (dataframe, records, logs, etc) # returns a tuple like: (dataframe, records, logs, etc)

View File

@ -27,11 +27,7 @@ from freqtrade import exchange
import freqtrade.optimize as optimize import freqtrade.optimize as optimize
<<<<<<< HEAD
logger = logging.getLogger('freqtrade')
=======
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
>>>>>>> bddf009a2b6d0e1a19cca558887ce972e99a6238
def plot_analyzed_dataframe(args: Namespace) -> None: def plot_analyzed_dataframe(args: Namespace) -> None:
@ -87,7 +83,7 @@ def plot_analyzed_dataframe(args: Namespace) -> None:
) )
df_buy = data[data['buy'] == 1] df_buy = data[data['buy'] == 1]
buys = go.Scattergl( buys = go.Scatter(
x=df_buy.date, x=df_buy.date,
y=df_buy.close, y=df_buy.close,
mode='markers', mode='markers',
@ -100,7 +96,7 @@ def plot_analyzed_dataframe(args: Namespace) -> None:
) )
) )
df_sell = data[data['sell'] == 1] df_sell = data[data['sell'] == 1]
sells = go.Scattergl( sells = go.Scatter(
x=df_sell.date, x=df_sell.date,
y=df_sell.close, y=df_sell.close,
mode='markers', mode='markers',

View File

@ -158,13 +158,13 @@ def plot_profit(args: Namespace) -> None:
# Plot the pairs average close prices, and total profit growth # Plot the pairs average close prices, and total profit growth
# #
avgclose = go.Scattergl( avgclose = go.Scatter(
x=dates, x=dates,
y=avgclose, y=avgclose,
name='Avg close price', name='Avg close price',
) )
profit = go.Scattergl( profit = go.Scatter(
x=dates, x=dates,
y=pg, y=pg,
name='Profit', name='Profit',
@ -177,7 +177,7 @@ def plot_profit(args: Namespace) -> None:
for pair in pairs: for pair in pairs:
pg = make_profit_array(data, num_iterations, min_date, tick_interval, pair) pg = make_profit_array(data, num_iterations, min_date, tick_interval, pair)
pair_profit = go.Scattergl( pair_profit = go.Scatter(
x=dates, x=dates,
y=pg, y=pg,
name=pair, name=pair,