tests: Update orderflow tests
This commit is contained in:
@@ -4,14 +4,12 @@ Functions to convert orderflow data from public_trades
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
import time
|
import time
|
||||||
from collections import OrderedDict
|
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
|
|
||||||
from freqtrade.constants import DEFAULT_ORDERFLOW_COLUMNS, Config
|
from freqtrade.constants import DEFAULT_ORDERFLOW_COLUMNS, Config
|
||||||
from freqtrade.enums import RunMode
|
|
||||||
from freqtrade.exceptions import DependencyException
|
from freqtrade.exceptions import DependencyException
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ This module defines the interface to apply for strategies
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
from abc import ABC, abstractmethod
|
from abc import ABC, abstractmethod
|
||||||
from collections import OrderedDict
|
|
||||||
from datetime import datetime, timedelta, timezone
|
from datetime import datetime, timedelta, timezone
|
||||||
from math import isinf, isnan
|
from math import isinf, isnan
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
from collections import OrderedDict
|
|
||||||
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
import pytest
|
import pytest
|
||||||
@@ -105,7 +103,7 @@ def test_public_trades_mock_populate_dataframe_with_trades__check_orderflow(
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
# Apply the function to populate the data frame with order flow data
|
# Apply the function to populate the data frame with order flow data
|
||||||
df, _ = populate_dataframe_with_trades(OrderedDict(), config, dataframe, trades)
|
df, _ = populate_dataframe_with_trades(None, config, dataframe, trades)
|
||||||
# Extract results from the first row of the DataFrame
|
# Extract results from the first row of the DataFrame
|
||||||
results = df.iloc[0]
|
results = df.iloc[0]
|
||||||
t = results["trades"]
|
t = results["trades"]
|
||||||
@@ -246,7 +244,7 @@ def test_public_trades_trades_mock_populate_dataframe_with_trades__check_trades(
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Populate the DataFrame with trades and order flow data
|
# Populate the DataFrame with trades and order flow data
|
||||||
df, _ = populate_dataframe_with_trades(OrderedDict(), config, dataframe, trades)
|
df, _ = populate_dataframe_with_trades(None, config, dataframe, trades)
|
||||||
|
|
||||||
# --- DataFrame and Trade Data Validation ---
|
# --- DataFrame and Trade Data Validation ---
|
||||||
|
|
||||||
@@ -404,9 +402,7 @@ def test_public_trades_config_max_trades(
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
df, _ = populate_dataframe_with_trades(
|
df, _ = populate_dataframe_with_trades(None, default_conf | orderflow_config, dataframe, trades)
|
||||||
OrderedDict(), default_conf | orderflow_config, dataframe, trades
|
|
||||||
)
|
|
||||||
assert df.delta.count() == 1
|
assert df.delta.count() == 1
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user