Code Monkey home page Code Monkey logo

Comments (3)

wayneadams avatar wayneadams commented on May 29, 2024

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:

  1. Extend MtSimulator into a new class
  2. Include a new parameter, say max_lot_size
  3. Overwrite _check_volume() (see here) with a new function that uses the new parameter and throws a ValueError when appropriate

But, I'm pretty new to this package, so there are probably better ways to do this :)

from gym-mtsim.

wayneadams avatar wayneadams commented on May 29, 2024

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

from gym-mtsim.

AnggonoUtomo avatar AnggonoUtomo commented on May 29, 2024

Let's to try, thanks Wayne....

from gym-mtsim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.