import pandas as pd

from app.entity.product.ChartDataBean import *

class StockProfilingDataBean:
    
    def __init__(self):
        self.code = 'StockProfilingDataBean'
        self.entityType = 'StockProfilingDataBean'

        self.lastPrice = 0.             # Last Price
        self.change = 0.                # Change
        self.dayAverageVolume30 = 0.    # 30 Day Average Volume
        self.dayMovingAverage50 = 0.    # 50 Day Moving Average
        self.dayMovingAverage200 = 0.   # 200 Day Moving Average
        self.upDownRatio = 0.           # Up/Down Ratio
        self.standardDeviation1 = 0.    # 1 Standard Deviation

        self.stockReturnProfiles = None         # Stock Return Profiles
        self.historicalVolatilities = None      # Historical Volatilities
        self.standardDeviationBuckets = None    # Standard Deviation Buckets

        self.histogramChart = {}   # count, division
        self.volChart = ChartDataBean()
        self.xSTDChart = ChartDataBean()


    def serialize(self):
        return {
                "code": self.code,
                "entityType": self.entityType,
                
                "lastPrice": self.lastPrice,
                "change": self.change,
                "dayAverageVolume30": self.dayAverageVolume30,
                "dayMovingAverage50": self.dayMovingAverage50,
                "dayMovingAverage200": self.dayMovingAverage200,
                "upDownRatio": self.upDownRatio,
                "standardDeviation1": self.standardDeviation1,

                "stockReturnProfiles": self.stockReturnProfiles,
                "historicalVolatilities": self.historicalVolatilities,
                "standardDeviationBuckets": self.standardDeviationBuckets,
        
                "histogramChart": self.histogramChart,
                "volChart": self.volChart,
                "xSTDChart": self.xSTDChart,
                }