How to learn C++

Soldato
Joined
12 Jul 2010
Posts
2,893
I would like to learn coding with the ultimate goal of creating trading robots. I ideally need to be able to create one within a month. So I have a few questions.

1)Should I learn C++ or is there another language the dominates finance world?
2)Say I end up learning C++, what way should I go about it. Would it be possible to learn C++ from a book or other source well enough to be able to write a program in a month of intense learning?
3)Could you nudge me in the right direction as to where to start, ie books websites.

Any advice wouldbe greatly appreciated.
 
The C++ tutorial here is quite good.

But 1 month is not a realistic time-frame whatever language you chose. And C++ is one of the slowest to learn, by a long shot.

Hehe that was I was expecting but afraid to hear, thanks for the link.
With intensive learning how long would you say would it take me to be comfortable with C++? We talking months or years here?
 
Depends on what your program to do. For a complex, working, and non-buggy system, closer to years than months.
 
Hey Nerusy :D long time no see.

I'd say yes it's definitely worth learning C++. A lot of what you'd be doing in finance computing will be C or C# (maybe java) depending on what you're actually having to do, both of which come incredibly naturally after C++. It is one of the 'longer' languages to learn as woden says, but you'll get so much more out of it in terms of what you know and understand compared to some high level starter language like python.

I learned from a book as i was completely new to programming when i started it. It was Deitel & Deitel iirc, although what i was working with is a bit dated now i believe. Exceptional/More Exceptional C++ were some of the best reads i've had on the subject. Once you have a basic grasp on the language check them out.

A generally recommended method is to have a project that you work on, and learn 'as you go'.

If you're looking at creating trading robots, I assume you have an understanding of the mathematical basis behind the algorithms you'll be implementing?
 
Hey Nerusy :D long time no see.

I'd say yes it's definitely worth learning C++. A lot of what you'd be doing in finance computing will be C or C# (maybe java) depending on what you're actually having to do, both of which come incredibly naturally after C++. It is one of the 'longer' languages to learn as woden says, but you'll get so much more out of it in terms of what you know and understand compared to some high level starter language like python.

I learned from a book as i was completely new to programming when i started it. It was Deitel & Deitel iirc, although what i was working with is a bit dated now i believe. Exceptional/More Exceptional C++ were some of the best reads i've had on the subject. Once you have a basic grasp on the language check them out.

A generally recommended method is to have a project that you work on, and learn 'as you go'.

If you're looking at creating trading robots, I assume you have an understanding of the mathematical basis behind the algorithms you'll be implementing?

Hehe hey bud ;)
Thanks for suggestions will check them out, as for algorithms most of the time API will have them. Can tinker with codes for now but really need to be able to write one from scratch eventually.
 
I would always recommend learning C++. Learning Java and C# with a good C++ understanding is easier and faster than the other way around IMO.

You could probably learn (and practise/tinker) enough in a month to write a smallish program, but you'll probably want to burn the code a few months down the line ;) A month is definitely not enough to learn the more complicated and esoteric C++ features (heavy template-based stuff, for example -- which is well worth understanding later).

Finally, with C++11 now having decent compiler support, make sure your learning material includes at least some C++11 features (they will make C++ bit less painful :p )
 
I would always recommend learning C++. Learning Java and C# with a good C++ understanding is easier and faster than the other way around IMO.

You could probably learn (and practise/tinker) enough in a month to write a smallish program, but you'll probably want to burn the code a few months down the line ;) A month is definitely not enough to learn the more complicated and esoteric C++ features (heavy template-based stuff, for example -- which is well worth understanding later).

Finally, with C++11 now having decent compiler support, make sure your learning material includes at least some C++11 features (they will make C++ bit less painful :p )

Thanks for the feedback guys, adjusted my expectations to more realistic time frame, ordered books and started online tutorials. All is good :)
 
You could try this - its well regarded and free from the authors website (you can buy a hardcopy on amazon too)

http://www.mindview.net/Books/TICPP/ThinkingInCPP2e.html

I'm no expert but 1 month is not enough time, with no experience, to build something from scratch like this.

Hehe hey bud ;)
Thanks for suggestions will check them out, as for algorithms most of the time API will have them. Can tinker with codes for now but really need to be able to write one from scratch eventually.

Not sure what you mean by that - an API is just an interface i.e. to a broker/ISV or an exchange.

The other poster was asking about the actual system you'll be implementing... the means by which you're hoping to generate alpha.
 
You could try this - its well regarded and free from the authors website (you can buy a hardcopy on amazon too)

http://www.mindview.net/Books/TICPP/ThinkingInCPP2e.html

I'm no expert but 1 month is not enough time, with no experience, to build something from scratch like this.



Not sure what you mean by that - an API is just an interface i.e. to a broker/ISV or an exchange.

The other poster was asking about the actual system you'll be implementing... the means by which you're hoping to generate alpha.

Thanks for the book suggestion will check it out, although by now I got more than enough material to go through :D
As for API, for example my broker has one and I thought in it certain things would be pre-defined but if not, yes I can define for the robot. Just to see if we're on the same page and I am not a total nooblet, I thought things like moving average is pre-defined by API and I just need to write a simple code to make the robot make an order on the cross over and exit on the crossover (simple case for the sake of example). If it is not defined however I'd simply need to define it in the code using mathematical equations right?
 
Might be/might not be. Is it your broker's API or some ISV your broker uses, like an ISV might offer you an API for execution and another API for data/analytics.
What are you actually going to be trading?
Also if you're just writing some system based on some simple TA indicators (prob not a good idea, but lots of people do) then why not use something off the shelf like ninjatrader, tradestation etc...
 
Might be/might not be. Is it your broker's API or some ISV your broker uses, like an ISV might offer you an API for execution and another API for data/analytics.
What are you actually going to be trading?
Also if you're just writing some system based on some simple TA indicators (prob not a good idea, but lots of people do) then why not use something off the shelf like ninjatrader, tradestation etc...

I understand it's my broker's API and reading it again makes me think it does not define TA's but that's fine if need be I will do it the long way I got the time I suppose.
Long term goal is to develops complex high frequency trading robots, trading forex and possibly commodities if it goes well. I already got simple robots running on metatrader4 but I want to be able to code and make it far more complex in the long run.
 
I understand it's my broker's API and reading it again makes me think it does not define TA's but that's fine if need be I will do it the long way I got the time I suppose.
Long term goal is to develops complex high frequency trading robots, trading forex and possibly commodities if it goes well. I already got simple robots running on metatrader4 but I want to be able to code and make it far more complex in the long run.

A retail client will not make money with a high frequency system you will be trading with too higher spread and too much latency

However if your looking at learning this to help get a job making high frequency trading systems for a bank/hedge fund then go ahead
 
A retail client will not make money with a high frequency system you will be trading with too higher spread and too much latency

However if your looking at learning this to help get a job making high frequency trading systems for a bank/hedge fund then go ahead

Fair enough, what would you say is average spread for a quant fund on eur/usd?
Working for a quant fund is of course the best-case scenario.
 
Accelerated c++ is a very good book to start with.

After that try Effective c++ and More Effective c++.

Other than that you just need to practice...a lot.
 
Fair enough, what would you say is average spread for a quant fund on eur/usd?
Working for a quant fund is of course the best-case scenario.

I think our fx desk gets a 0.1/0.2 pip spread. This is for a large investment management company. Spread will change during the day based on news and market liquidity etc
 
Long term goal is to develops complex high frequency trading robots, trading forex and possibly commodities if it goes well. I already got simple robots running on metatrader4 but I want to be able to code and make it far more complex in the long run.

Forgot about this thread but I think you should completely forget about FX as far as anything high frequency is concerned. Even if you could afford access to the main trading venues you're still a participant on a very uneven playing field. Sounds more like you're trying to connect to some bucket shop type operation, these won't likely be suitable for anything high frequency.

Maybe take a look at equities or futures instead IMO
 
Back
Top Bottom