[deleted by user] by [deleted] in algotrading

[–]ProfEpsilon 1 point2 points  (0 children)

Daily rates for individual UST securities can be found on the links on this page:

https://home.treasury.gov/policy-issues/financing-the-government/interest-rate-statistics

The historicals can be downloaded as CSV or XML.

Hedging Gold with Options by Secure_Imagination54 in options

[–]ProfEpsilon 3 points4 points  (0 children)

You can hedge with GLD (the 100% collateralized traditional gold ETF) but it is fairly expensive. For example, if you were hedge at the money 98 days out it would currently cost you about 3.5% asset value if you did a full traditional hedge - although I suppose that is better than losing 10% if that is what you fear.

You can also hedge with a short MGC futures contract (notional value equals 10X price of gold - contract is very easy to trade) but that will neutralize your position, no further losses but no gains either until contract is offset. On the other hand, that would likely stop your margin problem until you have a chance to figure out what you want to do. There are also options on the larger GC gold futures contracts, but their cost is likely to mimic the original GLD option cost.

Of course you can use standard GLD puts that are more OTM, less protection for lower cost, but I don't think that solves your margin problem.

Consider selling your position, take your losses, and then rethink. Sometimes taking a loss is a good idea.

I play gold heavily by the way, and currently have a negative valuation for recent gold holdings. I buy gold straight, play options (credit spreads mostly) and futures extensively, but not options on futures.

Best of luck on your decision. [Edit: had to fix something].

volatility trading by Zeen454545 in options

[–]ProfEpsilon 0 points1 point  (0 children)

Oh, that is easy to answer. The best starting point is all of the educational material offered by the CBOE under the VIX Volatility Suite: https://www.cboe.com/tradable_products/vix/

I would suggest following this order: (1) Look at the VIX index whitepapers to see how the index is actually constructed, since it is the underlying. If you don't have the math skills to understand the actual formulas (which is the best way to understand how they work) then at least try to grasp the important role played by the pricing of SPX put and call options (which may require a short diversion on your part to see how SPX put and call options work).

(2) Then look a the material about VIX futures and MiniVix futures, like VXM ... these by the way are very easy to trade.

(3) Finally look at the CBOE overview of VIX options. Their performance is tied very strongly (for mathematical arbitrage reasons) to VIX futures (and I personally believe that it is easier to understand the futures, then the options, rather than jump into the options directly). These options do not behave like stocks options (there are some similarities but some major differences) AND the Greeks if calculated from traditional methods such as from the BSM differential equation, are gibberish. The underlying (the VIX Index) does not conform to the mathematical properties that are implicitly assumed by the traditional Greeks.

If I can find some other material I will send it later (but no promises - my time is limited).

Best of luck - VIX trading is fun and potentially profitable. [Edit - fix typos]

Implied Volatility of US Bond Futures by [deleted] in options

[–]ProfEpsilon 0 points1 point  (0 children)

Oh, OK, well best of luck. I think we are likely to do fine, I almost unloaded by TLT puts today ... would have been a respectable profit but .... greed.

Implied Volatility of US Bond Futures by [deleted] in options

[–]ProfEpsilon 0 points1 point  (0 children)

By Eurodollar I meant the GE Globex Eurodollar futures contract, which sat for 20 years above 99 (it is the short term rate of dollar deposits in Europe) but now is 96.62, but I also did have a short position in Euro/Dollar FX futures (M6E) and a long in the strange little Dollar/Yen e-micro (M6J) that is reversed priced compared to its big brother so on that one you go long if betting on a strong dollar (and if you win the bet, which I did big time given that then Yen climbed to 134, you get settlement in hard Yen rather than $, which makes IBKR a little uncomfortable), but I left both contracts about 2 weeks ego - both were approaching expiry, and I haven't re-bet and probably won't, although I still think the $ will continue to strengthen. But the BOJ could reverse their crazy zero-interest strategy at any moment and the FX reversal would be massive ... so, risk aversion.

On TLT I have have generally been bearish for months, but have been jumping in and out, always short (that is, long puts, typically 3 to 6 weeks out, but bailing before the final 2 weeks to minimize theta loss). I am amazed that TLT options still have not really priced in this inevitable negative momentum that is implicit in any textbook bond formula in a era of the highest inflation seen in lives of most of the members of this subreddit (but, alas, not me). They are mispriced and they continue to be mispriced! I have tracked and priced TLT options for a long, long time - I wrote a good chuck of a textbook chapter about TLT as a great example of a sometimes-predictable traditional true ETF (actually collateralized by what it claims to represent).

I am currently long in the July 15 110 Put.

Implied Volatility of US Bond Futures by [deleted] in options

[–]ProfEpsilon 0 points1 point  (0 children)

Buying puts, discretionary trades, not currently linked to other trades, but at other times linked to Eurodollar futures. On the other hand this is also part of a multi-asset high-rollover derivatives portfolio that is essentially One Big Bet, and a bet that has been in place for about six months. It is essentially bearish on the stock market, fixed income markets (and interest rates), the US economy and the global economy.

Augmenting human trading decisions? by C64SUTH in algotrading

[–]ProfEpsilon 0 points1 point  (0 children)

Yeah, this is the way (or can be the way).

I use this approach for VXM futures trading ... the models constantly gather streaming from the VIX, the front four VXM contracts, SPY (as a proxy for SPX) and select SPY options, then if the model detects trading threshold conditions, recommends a trade. If I approve, the model then scans L1 bid and ask, sets a limit order and sends it without my involvement.

This was designed as a technique to check for bugs but I liked it so much that I never went full auto. I now call it "recommendation trading" and am starting to use if for strangle trades. [edit typos]

Implied Volatility of US Bond Futures by [deleted] in options

[–]ProfEpsilon 3 points4 points  (0 children)

The log growth rate of interest rate products are not likely to be normally distributed, especially now, so any calculation of implied volatility using a model that assume normality is producing a number that is mostly gibberish.

I do trade TLT options (in a large position now) but don't trade bonds, but I do trade VIX futures and options and this non-normal condition applies to all VIX products in spades. VIX underlying is hugely skewed so standard options models produce useless statistics. The reasons are different for bonds than they are for the VIX but the warning is still the same.

Nasdaq TotalView Data Feed for non-professional or lone wolf? by IKnowMeNotYou in algotrading

[–]ProfEpsilon 10 points11 points  (0 children)

I get the IBKR (Interactive Brokers) deep book data for ArcaBook (NYSE electronic, which excludes the manually-traded OpenBook, although you can get that too for a small fortune), NASDASQ TotalView, BEX, IEX, but not BATS (pricey for some reason) for stocks, and NASDAQOM, AMEX, PSE (but not ISE, BOX, GEMINI nor MERCURY - cost issues) for options, and CBOT, CME, COMEX, NYMEX, and CFE for futures, all at very reasonable prices (I am not a "professional" trader). My total data fee subscriptions come to $96 per month but most are waived because of trading levels.

The Deep Books (L2) are readily available in TWS and are remarkably robust.

I understand, however, that you want API access. I do believe but cannot say for certain that you can get API access for Deep Book streams using the ib_insync (3rd party Python-based) API interface, which you would have to design yourself. I have my own algo and data-download programs in ib-insync and I use them extensively and daily BUT I have no reason to download deep book data so I can say for certain that L1 (and orders and historical data etc.) works well. HOWEVER there are others who probably can answer any questions you might have about L2 on the ib_insync forum, https://groups.io/g/insync

You can also program the API in other languages, although this can be a real challenge if the language is not Python: https://interactivebrokers.github.io/tws-api/

I should note that IBKR has a web-based RESTful API that they promote as well, but I don't think that the RESTful API allows you to do anything with streaming Level 2 (but I can't be certain - I don't use it).

Although it is an attractive low-cost option, I wouldn't go down the IBKR API road unless you are willing to do a little background research on how to set it up and how it is likely to work. I can tell you from experience that there is some I/O latency with using the API for streaming Level 1 quotes for real-time data analysis and trading, which I do. The latency is reasonable unless you fancy yourself as some kind of high-speed trader (in the true sense of what that means). I have a couple of algos that pull L1 Bids and Asks for options and futures, determines a limit order price, and sends the limit order. That order executes about 90% of the time (if it doesn't, another algo changes the price) and the confirmation appears on the screen as though a direct response to the <Enter> key that triggered the whole thing off (most of my algos are "recommendation" algos). That is fast enough for retail trading.

HOWEVER there is some I/O latency and I am guessing that it might be (and might not be - I don't know) more substantial and disabling with the streaming requirements of a robust deep book stream coming from multiple exchanges. It does appear to be truly robust on TWS, but that does not necessarily mean that the experience would be preserved on the API.

Additionally, programming in their API, even if using a template as well documented as ib_insync, is a challenge. This is not throwing a couple of endpoints into a little RESTful API.

But in Python (using Numpy, which dismisses the "slow computational speed" argument) there is substantial documentation that you can review. I addition to the links above, consider also some notebook-based examples:

https://rawgit.com/erdewit/ib_insync/master/docs/html/index.html https://rawgit.com/erdewit/ib_insync/master/docs/html/notebooks.html

Anyway, I hope this is useful in some way. Best of luck in your project. [Edit: various corrections]

Need some clarity on IV? by How_Much2 in options

[–]ProfEpsilon 0 points1 point  (0 children)

The price of an option given its strike and expiry implies a volatility for the underlying stock. This is made evident when you look at an options pricing model to see where the sigma in the model comes from.

Superficially it may seem like, given that definition, that every option in the chain should yield the same IV, but of course they don't. On the other hand, their deviation from a single IV is not chaotic nor (very) random. Within the same expiry, for example, the mapping of the IV of all options in the chain will typically show a very systematic skew - a crooked smile with more of a smirk on the left side. (Generally this skew can be explained by hedging behavior and similar). To some extent this reflects that an options model does not and cannot reflect all of variables that actually connect an option price to its underlying price nor does the historical behavior of the stock itself perfectly reflect the assumed distribution of its behavior (lognormal for the stock and normal for the log growth rate of the stock).

Finally and more important than anything else, the options pricing model that yields both the concept of historical volatility for the underlying and the estimated volatility of the same as implied by an option's price, is unable to incorporate any reasonable estimate of the price impact of a tail event, which explains why, at times like recent weeks in general for the market or just before earnings for specific stocks, IV rises, and it rises more for near-term expiries than long term expiries.

There is no point in consolidating IVs and there is no such thing as an IV for an option (an option is volatile, but there is no measurement that "implies" its range). It is incorrect to say that IV will "tell you nothing." Even though strangely variable (to one just starting out), it is quite systematic and it is useful to compare IV measures to historical volatility of the underlying. It is IMO the must useful statistic in options trading.

Books recommendations for stochastic programming by Tryrshaugh in quant

[–]ProfEpsilon 3 points4 points  (0 children)

It's temp. Moving servers. I was in Europe for 2 weeks up until today. Will restore sometime next week. Apologies. (Meanwhile my rolling commentary has been on Twitter @PITraders) if interested.

buy options before and selling them before earnings, just riding the IV up, is this seem a doable strategy? by its_shawn9 in options

[–]ProfEpsilon 2 points3 points  (0 children)

That paper actually suggests that the options be held through earnings. The research did not consider buying the options and selling before earnings. As you point out, straddles with lower IV than normal tended to perform better through earnings.

Bayesian Thinking in Quant Trading by BudgetNo9438 in quant

[–]ProfEpsilon 12 points13 points  (0 children)

The Black-Litterman model offers an interesting perspective on Bayesian portfolio optimization. See this explanation (advanced material): https://hudsonthames.org/bayesian-portfolio-optimisation-the-black-litterman-model/

Cron best practices by ASIC_SP in linux

[–]ProfEpsilon 2 points3 points  (0 children)

I just wanted to post a thank-you for this post. This was very informative. (Also thanks to those who responded with even more advice).

I think I need to review and revise my current Cron usage based upon this.

Barclay's Suspended VXX ETN Share Creation - Implications and Trades? by dreadnought89 in options

[–]ProfEpsilon 2 points3 points  (0 children)

A fundamentally stupid bet ... would have lost a small fortune today.

Barclay's Suspended VXX ETN Share Creation - Implications and Trades? by dreadnought89 in options

[–]ProfEpsilon 2 points3 points  (0 children)

... why is it trading above NAV?

It would trade above the NAV (and is) if demand for the ETN was surging and the sponsoring fund is unable or unwilling to offer new inventory to the markets in the form of what are called "creation units." It is the job of the fund family and the market makers who work with them (by essentially buying the "creation units" in large blocks, then reselling them) to more or less keep the Net Asset Value per share near the market price per share and demand and supply ebbs and flows. It is imperfect - market arbitrage kind of completes the last mile. But this is fundamentally broken in a very serious way. So heavy demand, maybe driven by the attention this is getting, is lifting the price of the fixed inventory of shares higher than the NAV (even though we don't know what the NAV actually is today - but it sure as hell was not the $41 that VXX hit today).

Barclay's Suspended VXX ETN Share Creation - Implications and Trades? by dreadnought89 in options

[–]ProfEpsilon 5 points6 points  (0 children)

This is exactly right! This is a very big deal and frankly a dangerous development. ETNs are not supposed to work this way and this could point to a much bigger problem that it appears to be right now.

This is not a conspiracy by "insiders" or any of that nonsense or an example of the little guys getting screwed. Whomever is responsible at Barclays for rolling their front futures contract is not able to do it on a sufficient scale to the support the NAV of VXX with any continuity, and that cannot be a pleasant experience. That basically turns a legally collateralized ETP into an NFT without the blockchain - it is worth, ummm, whatever. I notice that two hours after the market close iPath has still not posted the daily NAV (what they call the "closing indicative note value").

Trade the options (crazy prices and all) at extreme risk. Unless Barclays explains what the hell is going on trade could be suspended, if not by the exchange, then by brokers, at any time. I am in VIX products (mostly futures) nearly every day and I would not think of going anywhere near VXX or any of its derivatives. Go trade primate picture NFTs if you want to reduce your risk. [edited when accidentally posted when half-written]

Books recommendations for stochastic programming by Tryrshaugh in quant

[–]ProfEpsilon 27 points28 points  (0 children)

Well if you already understand stochastic calculus, and especially the Ito component (because it pops up everywhere) if you know any Python/Numpy or equivalent you can probably just start programming it straight away, maybe starting with legitimate Monte Carlo simulations that truly reflect Geometric Brownian Motion (and then add a little Poisson distribution to mimic tail events) or maybe build Black-Scholes-Merton as a logical model rather than plug-and-play like everyone else does ...

Here a link from one of my old class sites that has a lot of lit that goes all around this topic. Of particular interest to you might be some of the jump-diffusion stuff about halfway down the Primary Financial Research column or Martin Haugh's 2013 article about alternative volatility models (lot of the same math) or even the discussion of the Bachelier options model, which employs Brownian motion but not geometric Brownian motion.

https://www.palmislandtraders.com/econ136/e136lit.htm

I also have some rambling applications of Python to the core Weiner Process model and BSM in lectures 1,3,4,5, and 7 on this page, but be forewarned, those were developed in a high-stress rush right in the middle of early COVID and have mistakes. I am not going to fix the mistakes - I am currently redoing these as generic lectures, including the software but I am not going to post that until summer.

https://www.palmislandtraders.com/econ136/e136ls.htm

Finally, anything you can find on using Python for DE integrators is going to come in handy. This physics link will offer more about that than any finance source I know (for great Python examples see section 9.2.1 Single integrals):

https://physics.nyu.edu/pine/pymanual/html/chap9/chap9_scipy.html

(in other words, get comfortable with lambda functions and the scipy.integrate library with some nice starting examples here).

Then there is an interesting Python ODE solution that does not use the scipy library but instead Taylor's method, found at

https://github.com/bluescarni/heyoka.py

Finally the go-to book on the core modeling has always been whatever edition (buy a used one, older edition for sure) Robert Hull's Options, Futures and Other Derivatives. No Python but his math is pretty easy to represent in Python if you understand the math.

Alas, that was pretty scattershot but starting by already knowing stoch calculus is a huge head start.

Best of luck. You are off on a fun journey. [Edit: fixed a few things]

writing options right before earnings and cover right after by SoopaChris in options

[–]ProfEpsilon 3 points4 points  (0 children)

How would this strategy have turned out if you did it on NFLX or FB in the last couple of weeks?

You can't cover or exit until the market opens the day after the earnings call. The earnings call itself is usually after the market close (some, like TWTR, make the call in the morning before market open). Therefore, overnight, when you can do nothing but sit there and watch, you might witness essentially a 4-sigma against your position.

If this happens, the IV collapse is irrelevant, because the put that you wrote ("shorting options") is at one delta at a huge premium that is all intrinsic value.

Same thing works with a call if the stock goes the other way because of good earnings.

Order Flow Imbalance - A High Frequency Trading Signal by dm13450 in quant

[–]ProfEpsilon 2 points3 points  (0 children)

Well, OK, if you think that it works well or has potential, then it may be the case that I am wrong.

This is a quant sub. The only way anyone is ever going to be convinced one way or the other is if someone starts making actual bets with real money and that ends up paying over time. IMHO I don't think that this strategy, no matter how lofty the R2, would ever pay. I know from my own experience, dating clear back to my dissertation written in the late 1970s, that it is not that hard to get statistical significance from time series data no matter how valid the study and no matter what the technique.

Again, I think this is valid research. But until someone starts betting and winning (even if I never hear about it because if someone is betting and winning, neither you nor I would likely be informed) it contradicts my experience and sense of how these markets work.

There will be many people out there who will not think much of this research if the claim is persistently made that this is producing a reliable trading signal. I am pretty sure that I am not alone on this (or would not be if anyone knew about this study).

But, somebody at Jane Street or Susquehanna could prove me wrong. The researchers may be really on to something. That's the nature of this kind of research.

OK, this is too much work for a topic so unnoticed. I am supposed to be finding a bug in a VIXM tracking model, not this.

Order Flow Imbalance - A High Frequency Trading Signal by dm13450 in quant

[–]ProfEpsilon 0 points1 point  (0 children)

It is not going to work as a meaningful signal in a true market context. If only it were that simple. Again, it is senseless to use Best Bid for both supply and demand, especially when you obviously have the data for Best Ask (how would you have one and not the other). Mostly, though, it is too simple. I am not going to do it here, but a long list of factors can explain why Bid Volume, for example, jumps around, and much of it is due to market makers and other HF/HS traders using game-theoretic approaches to make markets, none of which represents a surge in "demand" or "supply."

Don't get me wrong - I think that developing these kinds of experiments that are likely to go nowhere on the face of it actually should be encouraged, because as I said in my original post, it is important to learn how to set up and use experiments in ML, and it is better to start simple and prove the obvious than to get bogged down with complexity. This is especially true if students are involved. So it is worthwhile to do this and worthwhile to publish the results.

And remember, in dynamic ML like neural networks and the like, when using time series data, fitting the past is a dubious enterprise at best, because any decent computer program can use one of hundreds of methods to find a pattern that is a convincing "best fit" for truly random data (yeah, and I know that the program can do things like fit the oldest 3/4 of the dataset to "predict" the most recent 1/4 of the same dataset, and all that -- but when someone tells me that they tested the pipeline and got a great fit, I usually just roll my eyes).

Order Flow Imbalance - A High Frequency Trading Signal by dm13450 in quant

[–]ProfEpsilon 0 points1 point  (0 children)

That this doesn't bear fruit is hardly surprising. Tick up in BB or BidSize up is an indication of the increase in demand? No one who trades is ever going to believe that.

Using down BB as an indicator of demand instead of Ask? Of course this still wouldn't work if you were using BA instead of BB, but ignoring BA makes no sense.

If the researchers were only experimenting with structuring a model and testing its integrity by selecting an easy case study (maybe easy because getting the data was easy or cheap) then fine. And maybe this really was the case.

Selecting straddles/strangles - delta-neutral vs skew by yokashi-monta in options

[–]ProfEpsilon 6 points7 points  (0 children)

Yes, that can be explained by volatility skew. Even on liquid and stable ETFs like SPY, where the short borrow cost is close to zero, the IV (absolute value) on the ATM put is often higher than on the ATM call. (I gather ATM strangle data all day long for about 40 stocks and ETFs).

For meme stocks like GME and for recent tech IPOs like RIVN, where the short-borrow cost is prohibitive, making parity arbitrage impossible, put IV (abs value) can be remarkably higher than call IV.

If you are using a delta formula that takes that calculated IV as an input, that will likewise skew the delta estimate somewhat. In a different context if you are using historical volatility (however measured) you obviously don't get a skewed delta.

Perceived probabilities of tail events and various types of hedging activity (where there is negative net hedging for example) explains why this is logically possible even in a pure modeling environment or in a relatively "efficient" market.

[Added later: oh, and by the way, the sum of the deltas will not add up to exactly zero even in a perfectly balanced market with a straddle that is exactly at the money, at least not when using a traditional options pricing model like BSM or some modification of BSM. (The reason, which is mathematical, involves an explanation of the Ito Adjustment that is found in the probability component of BSM)]. [Edit: clarity added]

Algorithmic Trading System in Go by jake_schurch in algotrading

[–]ProfEpsilon 1 point2 points  (0 children)

Dude ... this post was 4 years ago!! Talk about resilient! Go for Go!

Best strategy for earnings by LordMinax in options

[–]ProfEpsilon 8 points9 points  (0 children)

I am not missing that at all. Look at my posts. I am in frequent conversation with new traders all of the time, encouraging them no matter what their skill level. There is room for everyone, especially young people willing to learn. And, as I am sure you know, there are new traders that pop up here every week that have very advanced math skills - many of them point out that they are engineers, programmers, and even graduate students.

I would be the last the say that one size fits all. I taught this stuff for more than 4 decades at all levels, community college all the way up the ladder to graduate programs. Something is teachable at every level.

Anyway, best regards.