pairs are usable
This commit is contained in:
parent
2432b7d6dc
commit
568e27adbe
3 changed files with 67 additions and 9 deletions
|
|
@ -4,6 +4,8 @@ from typing import Set, Tuple
|
|||
|
||||
from money.currency import Currency
|
||||
|
||||
from xexe.currency_pair import CurrencyPair
|
||||
|
||||
|
||||
class DateRange:
|
||||
|
||||
|
|
@ -86,3 +88,22 @@ def generate_currency_and_dates_combinations(
|
|||
currency_date_combinations = tuple(currency_date_combinations)
|
||||
|
||||
return currency_date_combinations
|
||||
|
||||
|
||||
def generate_pairs_and_dates_combinations(
|
||||
date_range: DateRange, pairs: Set[CurrencyPair]
|
||||
) -> Tuple[dict]:
|
||||
currency_date_combinations = []
|
||||
for date in date_range:
|
||||
for pair in pairs:
|
||||
currency_date_combinations.append(
|
||||
{
|
||||
"from_currency": pair.from_currency,
|
||||
"to_currency": pair.to_currency,
|
||||
"date": date,
|
||||
}
|
||||
)
|
||||
|
||||
currency_date_combinations = tuple(currency_date_combinations)
|
||||
|
||||
return currency_date_combinations
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue