예제 #1
0
    def get_list_of_optimal_positions_given_list_of_instrument_strategies(self,
                                                                          list_of_instrument_strategies: listOfInstrumentStrategies)\
            -> listOfOptimalPositionsAcrossInstrumentStrategies:

        list_of_optimal_positions_and_instrument_strategies = [
            self.get_instrument_strategy_and_optimal_position(
                instrument_strategy)
            for instrument_strategy in list_of_instrument_strategies
        ]

        list_of_optimal_positions_and_instrument_strategies = listOfOptimalPositionsAcrossInstrumentStrategies(
            list_of_optimal_positions_and_instrument_strategies)

        return list_of_optimal_positions_and_instrument_strategies
예제 #2
0
def remove_raw_from_list_of_optimal_positions_and_instrument_strategies(
    list_of_optimal_positions_and_instrument_strategies:
    listOfOptimalPositionsAcrossInstrumentStrategies,
) -> listOfOptimalPositionsAcrossInstrumentStrategies:

    list_of_optimal_positions_and_instrument_strategies = [
        optimal_position_and_instrument_strategy
        for optimal_position_and_instrument_strategy in
        list_of_optimal_positions_and_instrument_strategies
        if is_not_raw_optimal_position_and_instrument_strategy(
            optimal_position_and_instrument_strategy)
    ]

    return listOfOptimalPositionsAcrossInstrumentStrategies(
        list_of_optimal_positions_and_instrument_strategies)