Skip to content

Commit

Permalink
Remove generate_dataframe from plot_dataframe script
Browse files Browse the repository at this point in the history
  • Loading branch information
xmatthias committed Aug 4, 2019
1 parent e4380b5 commit c5ccf44
Showing 1 changed file with 3 additions and 17 deletions.
20 changes: 3 additions & 17 deletions scripts/plot_dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
import sys
from typing import Any, Dict, List

import pandas as pd

from freqtrade.configuration import Arguments
from freqtrade.configuration.arguments import ARGS_PLOT_DATAFRAME
from freqtrade.data.btanalysis import extract_trades_of_period
Expand All @@ -30,20 +28,6 @@
logger = logging.getLogger(__name__)


def generate_dataframe(strategy, tickers, pair) -> pd.DataFrame:
"""
Get tickers then Populate strategy indicators and signals, then return the full dataframe
:return: the DataFrame of a pair
"""

dataframes = strategy.tickerdata_to_dataframe(tickers)
dataframe = dataframes[pair]
dataframe = strategy.advise_buy(dataframe, {'pair': pair})
dataframe = strategy.advise_sell(dataframe, {'pair': pair})

return dataframe


def analyse_and_plot_pairs(config: Dict[str, Any]):
"""
From arguments provided in cli:
Expand All @@ -57,14 +41,16 @@ def analyse_and_plot_pairs(config: Dict[str, Any]):
"""
plot_elements = init_plotscript(config)
trades = plot_elements['trades']
strategy = plot_elements["strategy"]

pair_counter = 0
for pair, data in plot_elements["tickers"].items():
pair_counter += 1
logger.info("analyse pair %s", pair)
tickers = {}
tickers[pair] = data
dataframe = generate_dataframe(plot_elements["strategy"], tickers, pair)

dataframe = strategy.analyze_ticker(tickers[pair], {'pair': pair})

trades_pair = trades.loc[trades['pair'] == pair]
trades_pair = extract_trades_of_period(dataframe, trades_pair)
Expand Down

0 comments on commit c5ccf44

Please sign in to comment.