コード例 #1
0
ファイル: exchange.py プロジェクト: zemlia-zemlia/cointrader
    def get_chart(self, resolution="30m", start=None, end=None):
        """Will return a chart of the market.

        You can provide a `resolution` of the chart. On default the
        chart will have a resolution of 30m.

        You can define a different timeframe by providing a `start` and
        `end` point. On default the the chart will include the last
        recent data.

        :resolution: Resolution of the chart (Default 30m)
        :start: Start of the chart data (Default Now)
        :end: End of the chart data (Default Now)
        :returns: Chart instance.
        """
        if end is None:
            end = datetime.datetime.utcnow()
        if start is None:
            start = datetime.datetime.utcnow()

        data = self._get_chart_data(resolution, start, end)
        return Chart(data, start, end)
コード例 #2
0
    def get_chart(self, resolution="30m", start=None, end=None):
        """Will return a chart of the market. On default the chart will
        have a resolution of 30m. It will include the last recent data
        of the market on default. You can optionally define a different
        timeframe by providing a start and end point. On default the
        start and end of the chart will be the time of requesting the
        chart data.

        The start and end date are used to get the start and end rate of
        the market for later profit calculations.

        :resolution: Resolution of the chart (Default 30m)
        :start: Start of the chart data (Default Now)
        :end: End of the chart data (Default Now)
        :returns: Chart instance.
        """
        if end is None:
            end = datetime.datetime.utcnow()
        if start is None:
            start = datetime.datetime.utcnow()

        data, offset = self._get_chart_data(resolution, start, end)
        return Chart(data, start, end)
コード例 #3
0
 def get_chart(self, resolution="30m", start=None, end=None):
     if self._chart_data is None:
         self._chart_data, offset = self._get_chart_data(
             resolution, start, end)
         self._backtest_tick += offset
     return Chart(self._chart_data[0:self._backtest_tick], start, end)