Open AnggonoUtomo opened 1 year ago
You could update the volume_max
property on the respective symbol_info
stored in the DATA_DIR's pickle files. But that seems brittle.
I think you could also do something like this:
max_lot_size
_check_volume()
(see here) with a new function that uses the new parameter and throws a ValueError
when appropriateBut, I'm pretty new to this package, so there are probably better ways to do this :)
Actually, instead of going to the DATA_DIR, you can just update the volume_max
property by accessing symbols_info
directly on a MtSimulator instance. Do this after loading data.
For example:
sim = MtSimulator(
unit='USD',
balance=10000.,
leverage=100.,
stop_out_level=0.2,
hedge=True,
symbols_filename=FOREX_DATA_PATH
)
if not sim.load_symbols(FOREX_DATA_PATH):
sim.download_data(
symbols=["EURUSD"],
time_range=(from_dt, to_dt),
timeframe=Timeframe.M1
)
sim.save_symbols(FOREX_DATA_PATH)
new_max_volume = 42.0
sim.symbols_info["EURUSD"].volume_max = new_max_volume
Let's to try, thanks Wayne....
how do i set the maximum lots?