Better HN
topnewbestaskshowjobs
Log inSign up

gituliar

67 karma · joined Jan 25, 2011 (15y ago) · 46 submissions

Iblog about programming and quantitative finance at https://tastycode.dev
Submissions

comment 1y ago · link · parent

For me Go is a success story.

2.

Bob Reads a Text File(tastycode.dev ↗)

1 points · by gituliar · 2y ago · discuss

comment 2y ago · link · parent

Good observation!

Basically `Error` is an alias to `std::string`. This way code is more meaningful as returning just std::string is too generic.

It's also my convention to report errors as return arguments in this particular codebase, instead of throwing exceptions for example.

4.

How-To Calibrate American Options Really Fast in C++(tastyhedge.com ↗)

2 points · by gituliar · 2y ago · 2 comments

comment 2y ago · link · parent

> You can totally use both

Definitely, some can use both.

Again, it very much depends on the persona. All I need to be productive is a clear to-do list and no destruction, to focus on my work. No extra techniques, like Pomodoro, is necessary in my case.

comment 2y ago · link · parent

I gave pomodoro a try years ago, but failed. It simply doesn't fit my personality, don't like deadlines and time pressure.

Instead, I put my tasks in a Moleskine notebook, mixed with other notes and ideas of mine. In front of each task I put a square box, to be checked when the task is completed in the future. Usually tasks are 1-2 hours long, they are for evenings, longer tasks are for weekends. It's crucial to keep tasks small, no longer than 1 day of work, so split big tasks into small. This is crucial, as abstract tasks lead to procrastination and make you lose focus. The checkbox gives satisfaction when done and remains in the notebook, so that you can see a lot of completed by reviewing your notes.

I use this technique for 3 years now and it works for me. Not sure if it's known by other name as I came to it myself. Hopefully, this can be useful for others as well.

comment 2y ago · link · parent

This is because you run your own company. Things are different if one works for a company as an employee.

comment 2y ago · link · parent

At first you pay taxes in the country the company you work for is registered (there might be b2b options, which might differ). Then you pay rest in the country where you have a tax residency.

In your example, at first you pay taxes in Germany and if Estonian taxes are bigger, you pay the difference there.

comment 2y ago · link · parent

In EU since Jul'23 cross-border remote work is free of extra taxes and similar obligation if done up to 50% abroad. One can come to Germany for 3 days and come back to his country to work for 2 days remotely and spend weekend.

More here https://socialsecurity.belgium.be/en/internationally-active/...

comment 2y ago · link · parent

Real historical data might not cover current market state.

For example, option price among other params depends on the interest rate. For the last decade interest rate was around 0% in Europe and slightly higher in US. If you train on that data only, there is no chance to "learn" option prices in the high-interest-rate environment which we saw for the last few years. Hence, you need synthetic data to learn that region of the market space.

comment 2y ago · link · parent

Indeed, Andersen-Lake method is much faster, but is limited to vanilla problems.

The finite-difference covers wider range of problems, including stochastic volatility models, like SABR or Heston.

comment 2y ago · link · parent

Curious to see some references to people doing this. Have any ?

comment 2y ago · link · parent

You don't need fancy math to study financial modeling, like measure theory. Focus on market dynamic, like in physics try to model that with math and programming. Newton built solid models without advanced math of XX or XIX centuries. Of course, some advanced effects require advanced math, but those are built on top of simple theories, like General Relativity on top of the Newton theory.

comment 2y ago · link · parent

As already mentioned American / European / Bermuda / Asian options vary by features of option contracts. They don't belong to a particular regulatory regime. For some reason its names are associated to the geo locations. I'm sure there are people who can wrap that in a nice narrative. :)

15.

Pricing Americans with finite-difference(tastyhedge.com ↗)

49 points · by gituliar · 2y ago · 42 comments

comment 2y ago · link · parent

Here in Denmark, both realized and unrealized gains are taxed at the year end. The losses are transferred to next years and deducted from the gains.

This might be an advantage if paying 27% lower-tier tax over the years, rather than being taxed once on cash out and hitting a higher-tier of 42%. However, given the compounding effect, it seems more preferable to accumulate gains and pay higher tax at the very end.

17.

Tasty GPU – Pricing Derivatives on a Budget(tastycode.dev ↗)

1 points · by gituliar · 3y ago · discuss

comment 3y ago · link · parent

> Your "simple solution" misses the point of the article which is to have the compiler automatically generating the serialized string representation of the enum without a human programmer having to manually code the switch case statements or array lookups and also avoid manually keep the enum & array in sync.

I agree, in some cases automatic generation might save you some typing.

It might be also painful to maintain, as changing a string requires to change a corresponding enum everywhere in the code.

comment 3y ago · link · parent

So far, I'm happy with this simple solution:

  enum _ : u8 {
    kMonday,
    kTuesday,
    ...
    kSize
  };

  constexpr const char* toString[kSize] = {
    "Monday",
    "Tuesday",
    ...
  }

  auto day = toString[kTuesday];
Edit: For `constexpr` replace `std::string` with `const char *`.

comment 3y ago · link · parent

I'm not sure this is a true story.

Open Interest is 420 contracts, this is a max number of options someone can hold (for that strike and expiry). See the first line on the first screenshot, just below "Historical Volume / OI". Nobody could hold more than that much contract.

Edit: The total contracts is 127, so it gives 127 x $18 x 100 ~ $230'000 profit. (Seems like the post on Twitter is missing x10 factor.)

comment 3y ago · link · parent

Can anyone confirm this unusual volume (to ensure this is not a clickbait) ?

The option chain I have shows regular volume, with open interest to be ~420 contracts.

comment 3y ago · link · parent

> Unfortunately, I am all too well aware of why these decisions were made, and it is exactly one reason: Compatibility with legacy code. C++ has no editions system, no way to deprecate core language features.

Actually, I'm curious if somebody is working on a flavor of the modern C++ that abandons backward compatibility ?

The Carbon project feels like a completely new language. What I'd expect instead is something that adopts best features and practices from modern C++, so that an average C++ project would require just minor changes to migrate, in spirit of Python 2 -> 3 migration.

comment 3y ago · link · parent

I am verry happy with `screen` which I use for ~10 years.

Hear about `tmux` here and there, but so far not sure about the benefits. Any particular reason it's better over `screen` ?

24.

Tasty C++ – Memory Layout of std:string(tastycode.dev ↗)

3 points · by gituliar · 3y ago · 1 comment

comment 3y ago · link · parent

Is it also the case for floating point data?

I know about fast_float (which is by the same author as simdjson), however my believe is that binary format is impossible to beat here.

comment 4y ago · link · parent

Exactly the same attack happened with me about a month ago, also with expired domain name and recovery email associated with it. Fortunately I also had an active phone number assigned, which I believe ruined hacker’s attempt.

Funny facts:

- the domain was registered at the same date as attack happened

- attack happened from Hamburg IP and Android phone. This data was in my reset email from FB. This was true when I stopped using FB 5+ years ago.

- domain registration costs money, hence success rate of such attacks should be rather high

- since I stopped renewing this domain, it was registered by one more entity. According to archive.org with just some ads.

Take care folks, remember about your expired domains.

comment 4y ago · link · parent

Great post, thanks for sharing your experience.

Could you also share what is you strategy for marketing and acquiring new users ?

comment 4y ago · link · parent

My guess: https hits HAProxy from external world, afterwards all is just http. There is no need to encrypt internal trafic.

comment 4y ago · link · parent

Absolutely agree.

Exercises are the key for learning. Like with riding a bicycle -- you learn by trying not reading or watching. Composing an exercise section is hard, so thoughtful books usually have one.

Also, I'd pick just one book for a subject and stick to it, pick it carefully to fit your style and language.

12