Giter VIP home page Giter VIP logo

medium's People

Contributors

crapher avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

medium's Issues

OpenAI Gymnasium instead of gym ?

@crapher

Hello Diego,

First of all thank you for creating a very nice learning environment ! I've started going through your Medium posts from the beginning, but I'm running into some problems with OpenAI's gym in sections 3, 4, and 5. When I run the code (using python3.11) I get :

./medium/venv/lib/python3.11/site-packages/stable_baselines3/common/vec_env/patch_gym.py:49: UserWarning: You provided an OpenAI Gym environment. We strongly recommend transitioning to Gymnasium environments. Stable-Baselines3 is automatically wrapping your environments in a compatibility layer, which could potentially cause issues.

And in fact it fails to run. I tried simply replacing "gym" with "gymnasium" in your code, but maybe that was a little too optimistic (it doesn't work either without further modifications). I suspect that this is all because I'm using different versions of the various packages than you used when you wrote the code. As such it could be helpful if you can include information somewhere about what python and package versions this has been tested with.

Rasmus

Some questions and remarks about your option backtesting work

@crapher

Hello Diego,

First of all thanks for the work you have done regarding the options backtesting (11.OptionsBacktest) as explained earlier on the Medium Platform in your article called "SPY Options Trading with a Profitable 1-Minute Strategy to Multiply Returns and Limit Risk". Later on I saw you extended your work to QQQ and AAPL as well. Super cool !

I'm a data enthusiast and stock market watcher as well, and I replayed and reviewed your code, trying to understand the rules you applied to trigger a new trade or close one. The code you have written is somewhat hard to interpret as it has not been fully commented out. One example would be this line: df.loc[:,'open_point'] = np.where((df['open_point'] - df['close_point']) == (df['open_point'].shift(-1) - df['close_point'].shift(-1)), 0, df['open_point'])

It looks like the code is comparing rows in order to flag them as a possible trade (or not). But the 'why' is not clear to me.
So a short explanation of the steps would be helpful.

One other thing that I could not figure out was the meaning of 'POO' (percentage over price). What is that all about?

Last remark I would make is that I am also intrigued by the posts of Michael Petryni. To me it looks like he is trading in the following manner:

  • Record the opening price of the first 1 minute bar of a relevant option at 09:30 (you have done this too)
  • Recheck the option price again at 09:44 and see if it has a positive or negative trend (you have done this too)
  • Take a trade a 09:45 of the closest ITM option. If the trend is positive take a call, otherwise a put
  • Let the trade run with a build-in stop loss level of 70% (not sure if Michael uses a SL, but I would)
  • Check at the end of the day if you have been profitable

If you have no problem with it I would like to use one of your option data files to code his scenario and see what it brings. Would you be oke with me using your options data file ?

Regards, Nick

Question about qqq_options_1m_dte_0_credit_spread.py

In your code for "How I Achieved Almost 85% Win Rate Using 0DTE Options and the Credit Spread Strategy on QQQ", I see you're using data which having some columns such as expire_date, kind, strike, open_underlying,close_underlying. Could you please give me how to have these columns?

Question on the spy alert credit spread

Hi Diego,

Thank you for sharing.
I'm a little stuck and would really appreciate your advice.

The code runs at 10.30 and I get the following message:
INFO:root:Sleeping for 23:53:18 (Checking @ 2024-01-03 10:30:00-05:00)

Q1. Any time I run the code it goes to sleep again after a couple of minutes until the next day.
My understanding is the code is designed to run at 10.30 to examine the first hour of trading but I thought it would continue to run until the end of the trading day. Please advise.

Q2. Why 10.30?

Q3. Finally, have you tested this strategy on other stocks or ETFs?

Thank you,

Kieran

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.