We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent dff1e65 commit c5cd1b3Copy full SHA for c5cd1b3
backtesting/backtesting.py
@@ -1057,6 +1057,11 @@ def __init__(self,
1057
raise ValueError('Some OHLC values are missing (NaN). '
1058
'Please strip those lines with `df.dropna()` or '
1059
'fill them in with `df.interpolate()` or whatever.')
1060
+ if np.any(data['Close'] > cash):
1061
+ warnings.warn('Some prices are larger than initial cash value. Note that fractional '
1062
+ 'trading is not supported. If you want to trade Bitcoin, '
1063
+ 'increase initial cash, or trade μBTC or satoshis instead (GH-134).',
1064
+ stacklevel=2)
1065
if not data.index.is_monotonic_increasing:
1066
warnings.warn('Data index is not sorted in ascending order. Sorting.',
1067
stacklevel=2)
0 commit comments