Giter Club home page Giter Club logo

Comments (7)

SlimBeji avatar SlimBeji commented on May 18, 2024

Can I have more details about what we want to achieve exactly? The first thing I think of is to use the lifecycle method after_market_closes but maybe we want a more complex behavior.

from lumibot.

neilsmurphy avatar neilsmurphy commented on May 18, 2024

This is an interesting point.

I'm wondering if an override in the is_market_open method would help where one could manually extend the hours of the day. This issue comes up a lot. When just using bars and time, trading times/restrictions can be added in manually. e.g. Client only wants to trade the LSE or afterhour coins.

This can come up too when clients just want to set the times they trade. I've had clients not want to have their algo trade during lunch.

from lumibot.

neilsmurphy avatar neilsmurphy commented on May 18, 2024

I wonder if we couldn't have an option for the user to create a parameter dictionary that would give hours (and maybe days) where trading is permitted or excluded. These could have labels for the keys. For example:

trading_hours = dict(
    late_start=dict(
        start=datetime.time(0, 0),
        end=datetime.time(9, 35),
        trading=False,
    ),
    lunch=dict(
        start=datetime.time(11, 45),
        end=datetime.time(13, 15),
        trading=False,
    )
)

We could then layer this logic over the is_market_open logic to determine market openness.

from lumibot.

grzesir avatar grzesir commented on May 18, 2024

from lumibot.

SlimBeji avatar SlimBeji commented on May 18, 2024

@grzesir Is this matter specific to crypto trading or are there some stocks that can be traded outside opening hours.

@neilsmurphy I think it is possible to add the dictionary trading_hours you suggested to how the method StrategyExecutor._run_trading_session behave without too much trouble (Inside the while statement). We can also add a function to be executed in that time range.

from lumibot.

dclong avatar dclong commented on May 18, 2024

Is this feature implemented? If so, any doc on it?

from lumibot.

grzesir avatar grzesir commented on May 18, 2024

from lumibot.

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.