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,
# entry-date, duration
records.append((pair, trade_entry[1],
row.date.strftime('%s'),
row2.date.strftime('%s'),
str(int(row.date.timestamp())),
str(int(row2.date.timestamp())),
index, trade_entry[3]))
# For now export inside backtest(), maybe change so that backtest()
# returns a tuple like: (dataframe, records, logs, etc)

View File

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

View File

@ -24,7 +24,7 @@ import plotly.graph_objs as go
from freqtrade.arguments import Arguments
from freqtrade.configuration import Configuration
from freqtrade.analyze import Analyze
from freqtradeimport constants
from freqtrade import constants
import freqtrade.optimize as optimize
@ -158,13 +158,13 @@ def plot_profit(args: Namespace) -> None:
# Plot the pairs average close prices, and total profit growth
#
avgclose = go.Scattergl(
avgclose = go.Scatter(
x=dates,
y=avgclose,
name='Avg close price',
)
profit = go.Scattergl(
profit = go.Scatter(
x=dates,
y=pg,
name='Profit',
@ -177,7 +177,7 @@ def plot_profit(args: Namespace) -> None:
for pair in pairs:
pg = make_profit_array(data, num_iterations, min_date, tick_interval, pair)
pair_profit = go.Scattergl(
pair_profit = go.Scatter(
x=dates,
y=pg,
name=pair,