import numpy as np
from django.db import connection
from django.db import models


class HistoryByMinute(models.Model):
    time = models.IntegerField(unique=True)
    high = models.IntegerField()
    low = models.IntegerField()
    open = models.IntegerField()
    close = models.IntegerField()
    volumefrom = models.IntegerField()
    volumeto = models.IntegerField()
    crypto = models.CharField(max_length=10)
    curr = models.CharField(max_length=10)

    @staticmethod
    def get_avg_prices_with_time():
        with connection.cursor() as cursor:
            cursor.execute(
                "SELECT to_timestamp(h.time) AT TIME ZONE 'UTC' as time, (h.high+h.low)/2 AS pric "
                "FROM crypto_net_historybyminute h "
                "ORDER BY time ASC"
            )
            return np.transpose(cursor.fetchall())

e814d23b2b3765050e7d3d49d902dc4923017838
<mask token>


class HistoryByMinute(models.Model):
    <mask token>
    <mask token>
    <mask token>
    <mask token>
    <mask token>
    <mask token>
    <mask token>
    <mask token>
    <mask token>
    <mask token>

<mask token>


class HistoryByMinute(models.Model):
    <mask token>
    <mask token>
    <mask token>
    <mask token>
    <mask token>
    <mask token>
    <mask token>
    <mask token>
    <mask token>

    @staticmethod
    def get_avg_prices_with_time():
        with connection.cursor() as cursor:
            cursor.execute(
                "SELECT to_timestamp(h.time) AT TIME ZONE 'UTC' as time, (h.high+h.low)/2 AS pric FROM crypto_net_historybyminute h ORDER BY time ASC"
                )
            return np.transpose(cursor.fetchall())

<mask token>


class HistoryByMinute(models.Model):
    time = models.IntegerField(unique=True)
    high = models.IntegerField()
    low = models.IntegerField()
    open = models.IntegerField()
    close = models.IntegerField()
    volumefrom = models.IntegerField()
    volumeto = models.IntegerField()
    crypto = models.CharField(max_length=10)
    curr = models.CharField(max_length=10)

    @staticmethod
    def get_avg_prices_with_time():
        with connection.cursor() as cursor:
            cursor.execute(
                "SELECT to_timestamp(h.time) AT TIME ZONE 'UTC' as time, (h.high+h.low)/2 AS pric FROM crypto_net_historybyminute h ORDER BY time ASC"
                )
            return np.transpose(cursor.fetchall())

import numpy as np
from django.db import connection
from django.db import models


class HistoryByMinute(models.Model):
    time = models.IntegerField(unique=True)
    high = models.IntegerField()
    low = models.IntegerField()
    open = models.IntegerField()
    close = models.IntegerField()
    volumefrom = models.IntegerField()
    volumeto = models.IntegerField()
    crypto = models.CharField(max_length=10)
    curr = models.CharField(max_length=10)

    @staticmethod
    def get_avg_prices_with_time():
        with connection.cursor() as cursor:
            cursor.execute(
                "SELECT to_timestamp(h.time) AT TIME ZONE 'UTC' as time, (h.high+h.low)/2 AS pric FROM crypto_net_historybyminute h ORDER BY time ASC"
                )
            return np.transpose(cursor.fetchall())

import numpy as np
from django.db import connection
from django.db import models


class HistoryByMinute(models.Model):
    time = models.IntegerField(unique=True)
    high = models.IntegerField()
    low = models.IntegerField()
    open = models.IntegerField()
    close = models.IntegerField()
    volumefrom = models.IntegerField()
    volumeto = models.IntegerField()
    crypto = models.CharField(max_length=10)
    curr = models.CharField(max_length=10)

    @staticmethod
    def get_avg_prices_with_time():
        with connection.cursor() as cursor:
            cursor.execute(
                "SELECT to_timestamp(h.time) AT TIME ZONE 'UTC' as time, (h.high+h.low)/2 AS pric "
                "FROM crypto_net_historybyminute h "
                "ORDER BY time ASC"
            )
            return np.transpose(cursor.fetchall())
