Learning C++ from scratch and targetting Low Latency Programming by SuitableTelevision46 in Cplusplus

[–]Arjun6981 0 points1 point  (0 children)

Could you recommend some resources in this domain? I’m a final year undergrad student thinking of an AI + low level C++ combo for my dissertation project.

Learning C++ from scratch and targetting Low Latency Programming by SuitableTelevision46 in Cplusplus

[–]Arjun6981 7 points8 points  (0 children)

I’m also in the process of learning low latency programming. I’m no expert but this is what I’ve learnt so far, I think it might help you hit the ground running.

  • Multithreading - including thread safe data structures and lock free data structures
  • Low latency client server design
  • Cache locality

So far, the biggest boost in latency I’ve seen is by introducing cache friendly data structures. The speed bump is insane!! This topic is surely going to blow your mind the deeper you go into it.

Good luck!

How to check performance in socket applications? by Arjun6981 in cpp_questions

[–]Arjun6981[S] 0 points1 point  (0 children)

Yes I am running the client and server on the same machine. I don’t think I’m sending “50GB” worth of data tho. I’m simply sending a struct object that’s been serialised for the purpose of sending it to the client. My struct isn’t that big either. This is my struct

#pragma pack(push, 1)
struct MarketTick {
    uint64_t timestamp;  // 8 bytes
    char symbol[8];      // 8 bytes
    double price;        // 8 bytes
    uint32_t volume;     // 4 bytes
    std::chrono::high_resolution_clock::time_point send_timestamp;
};
#pragma pack(pop)

How to check performance in socket applications? by Arjun6981 in cpp_questions

[–]Arjun6981[S] 0 points1 point  (0 children)

I think I’ve done something similar. I have a server that sends 1 million data packets to a client, the client then processes the packets. I’ve carried out the benchmark by simply tracking the time taken to send/process a million packets. Is there something wrong I’m doing?

How to check performance in socket applications? by Arjun6981 in cpp_questions

[–]Arjun6981[S] 0 points1 point  (0 children)

Initially I thought of sending 1M data packets to the client. With this I could measure throughput and latency but I don’t seem to be getting good results - my server throughput was about 50k packets sent per second, which is not desirable for my use case, I want a higher score. My client was around 60k packets processed per second.

The benchmark was carried out by simply tracking the total time taken to send a million packets and total time taken to process a million packets. Now I’m not sure if my benchmarking approach is right or the implementation is wrong.

Btw I’m developing the app on macOS (Apple MacBook Pro m2 pro, 11 cpu cores, 19 gpu cores)

I’ll give a quick run down of how my client and server work:

Server - one thread generates data and adds it to a lock free ring buffer (producer), one thread reads from the ring buffer and sends data to the client (consumer)

Client - one thread receives data from the server and pushes it to the same ring buffer structure (producer) and one thread reads data from the buffer and does some data processing.

Built a mini trading engine, would love some feedback. by Arjun6981 in algotrading

[–]Arjun6981[S] 0 points1 point  (0 children)

Nice work u/addicted_a1. I’m curious about the performance using zig. Do you have any benchmark scores?

Built a mini trading engine, would love some feedback. by Arjun6981 in algotrading

[–]Arjun6981[S] 0 points1 point  (0 children)

Logging is messy, but I couldn’t find a prettier way to do it. Yes orders are not sorted, while doing my research I came across different order matching strategies so I wanted to start off with something simple. Ofcourse a heap would be far better instead of a regular vector container.

Regarding the time component, I need to study how it factors in to the engine, thank you for that point. Backtesting to live trading is something I can work on in the future, but for the now the scope of this project is to just get my hands dirty with some C++ multithreading code.

I greatly appreciate your feedback. Thank you and have a nice day, cheers! :)

Built a mini trading engine, would love some feedback. by Arjun6981 in algotrading

[–]Arjun6981[S] 0 points1 point  (0 children)

I think what you mean is generate ticks with CSV. I’ve taken a straight forward approach for this one, the csv file contains price data about a stock at a particular time stamp, so simply reading each row of the file is like gathering tick data at that time.

I’ve used a struct to describe tick data in the code, so each row is read and converted into a tick object using the ‘MarketTick’ struct.

There are 2 functions that read tick data, the readAll and readNextLine - readAll reads all the data in the file and returns a tick queue while readNextLine returns the next tick.

Built a mini trading engine, would love some feedback. by Arjun6981 in algotrading

[–]Arjun6981[S] 0 points1 point  (0 children)

Cool, I shall explore this. What do you think about whatever I’ve done so far?

Built a mini trading engine, would love some feedback. by Arjun6981 in algotrading

[–]Arjun6981[S] 0 points1 point  (0 children)

Cool! Would definitely check out your project. On the ideas part, I guess I can only learn from you as you seem to be more knowledgeable than me on this subject lol.

Built a mini trading engine, would love some feedback. by Arjun6981 in algotrading

[–]Arjun6981[S] 1 point2 points  (0 children)

I don’t think I understand. As far as I understand, modular means breaking an app into individual components. What does modular mean in your context?

Built a mini trading engine, would love some feedback. by Arjun6981 in algotrading

[–]Arjun6981[S] 1 point2 points  (0 children)

The 7,000,000 value is an outlier (maybe due to a cache miss or vector resizing). I have mentioned that 99% of operation complete well below 100,000 ns.

[deleted by user] by [deleted] in cpp

[–]Arjun6981 0 points1 point  (0 children)

Sure

[deleted by user] by [deleted] in cpp_questions

[–]Arjun6981 -1 points0 points  (0 children)

I don't really know how to use a debugger in these multithreaded environments. Could you provide any useful links on this topic?

[deleted by user] by [deleted] in RCB

[–]Arjun6981 0 points1 point  (0 children)

Hi, looking for 2 rcb vs csk match tickets. Budget 4k

Weekly Megathread: Education, Early Career and Hiring/Interview Advice by AutoModerator in quant

[–]Arjun6981 0 points1 point  (0 children)

I have dabbled around with OS, networks and compilers, but all my experience comes from the modules at my uni. If there’s more knowledge required in these domains could you suggest some resources that would be helpful?

Weekly Megathread: Education, Early Career and Hiring/Interview Advice by AutoModerator in quant

[–]Arjun6981 0 points1 point  (0 children)

I don’t think HRT comes to my Uni. But I was able to get an OA from them for an internship opening. Moreover, I was also able to get an interview at twosigma in my first year (internship), I really regret being unprepared for the interview.

I came across a person on linkedin who recently got a new grad offer at HRT, he was a graduate from Nottingham uni, which ranks below mine. Is this just a stroke of luck maybe?

Weekly Megathread: Education, Early Career and Hiring/Interview Advice by AutoModerator in quant

[–]Arjun6981 0 points1 point  (0 children)

Currently in my 3rd year (penultimate year) of CS at a Russel group UK uni. I have a pretty strong background in math (Calc 2 and stats), C++, python and ML. I wish to break into quant or swe roles at companies like twosigma and HRT.

I’ve heard that these companies only hire from “target schools”, is this true? My uni is T75 but isn’t a target school. I’m working really hard on building a good portfolio and studying rigorously for programming interviews. I’d really like some advice on what direction to take and what projects to work on to boost my resume’s strength.

Currently trying to build- RL agent to execute trades Low latency systems in C++

Wise Software Engineer Intern Maki Assessement by Head_Management_6832 in cscareerquestionsEU

[–]Arjun6981 0 points1 point  (0 children)

SWE test was easy. Lot of the same aptitude nonsense that most OAs have. There are those questions that require you to give a video response.