def set_fill_volume(self):
     if self.__fill_volume_deviation_percent is not None and self.__status_sequence is not None:
         if self.__status_sequence == StatusSequence.REJECTED:
             self.__fill_volume = 0
         elif self.__status_sequence == StatusSequence.FILLED:
             self.__fill_volume = self.__init_volume
         else:
             self.__fill_volume = Utils.calculate_percent_from_value(self.__init_volume,
                                                                     self.__fill_volume_deviation_percent)
     return self
    def __calculate_orders_period_volumes(self):
        '''
        Calculate orders volumes list than equal to percentage of zones:
        red = 15%, green = 60% and blue = 25%
        '''

        red_zone_percent = self.configs.settings[Values.GENERAL_SECTION_NAME][
            Values.RED_ZONE_ORDERS_PERCENT]
        green_zone_percent = self.configs.settings[
            Values.GENERAL_SECTION_NAME][Values.GREEN_ZONE_ORDERS_PERCENT]
        blue_zone_percent = self.configs.settings[Values.GENERAL_SECTION_NAME][
            Values.BLUE_ZONE_ORDERS_PERCENT]

        Logger.info(
            __file__,
            'Started calculating of orders volumes to period with zones percentes: red = {}, green ={}, blue ={}'
            .format(red_zone_percent, green_zone_percent, blue_zone_percent))

        for i in range(
                1, self.configs.settings[Values.GENERAL_SECTION_NAME][
                    Values.ORDERS_AMOUNT] + 1):
            first_percent = Utils.calculate_percent_from_value(
                i, red_zone_percent)
            second_percent = Utils.calculate_percent_from_value(
                i, green_zone_percent)
            third_percent = Utils.calculate_percent_from_value(
                i, blue_zone_percent)

            if Utils.is_int(first_percent) and Utils.is_int(
                    second_percent) and Utils.is_int(third_percent):
                self.configs.min_orders_volumes = {
                    Values.RED_ZONE_VOLUME: first_percent,
                    Values.GREEN_ZONE_VOLUME: second_percent,
                    Values.BLUE_ZONE_VOLUME: third_percent
                }
                break