Jump to content

Welcome to the new Traders Laboratory! Please bear with us as we finish the migration over the next few days. If you find any issues, want to leave feedback, get in touch with us, or offer suggestions please post to the Support forum here.

  • Welcome Guests

    Welcome. You are currently viewing the forum as a guest which does not give you access to all the great features at Traders Laboratory such as interacting with members, access to all forums, downloading attachments, and eligibility to win free giveaways. Registration is fast, simple and absolutely free. Create a FREE Traders Laboratory account here.

Soultrader

Programming: Where to Start?

Recommended Posts

The platform dictates the language. Really the discussions on languages are academic. Unless you code everything from scratch that is. I would not recommend that to someone starting out. Oh or if you choose Neoticker which supports a variety of languages.

 

As the previous poster points out (and has been mentioned before) what you want to do and what you are used to will largely dictate the choice of platform. Again to re-iterate the platform will dictate the language you use. 80% or more of your code will be calls to the platform and so the language is pretty academic.

 

So are you going to write everything from scratch (I'm pretty sure the answer to that will be no :)) If thats the case we can pretty much dispense with the discussions on the merits of different languages and talk about the merits of platforms and the core features they expose programatically.

Share this post


Link to post
Share on other sites

You must have a reason for wanting to learn a language. What are your reasons. If you elaborate more fully here then the answer to your question will become more obvious.

Share this post


Link to post
Share on other sites
You must have a reason for wanting to learn a language. What are your reasons. If you elaborate more fully here then the answer to your question will become more obvious.

 

Just two things:

 

I share BlowFish's view.

 

And beside of the reasons, I would like to ask, how much time are you willing to invest to learn and use a language. 1 hour a day? 2 h? Full time?

And for how long? 1 month, 2 ... a year?

 

 

... and some more thoughts:

 

I guess beginners underestimate how much man months go into an application,

even if open sources are used.

And alone from scratch, well lets talk about man years or even man decades.

You make errors, open sources contain errors, ...

and they all have to be fixed at some point.

Just fixing them, how much time will it need? Especially if you don't understand the open sources you use.

So you have to learn, how they work

and so on.

Share this post


Link to post
Share on other sites

I've been involved in programming since I was 12 (I'm 28), I have a masters degree in informatics, had 5 years of programming + math.

 

While I know nothing about CQG, if you're looking for a completely free option, I'd share my experience: Ninja Trader + Zen-Fire data. Ninja Script is nothing but C#, which is an object-oriented language. OOP is used by large already and it's the type of programming language of the future, until someone comes out with another breakthrough, so it's advisable to start to learn what's IN at the moment, if there's an easy way.

 

And you bet there is. NT prepares all the objects you need for you, so in a pre-written code, you write the actions you want to happen, pascal-style is you want to. You can grab methods of pre-built objects and get into the OOP world, which requires a really a different mindset as was mentioned here before. But you can leave that for later and write a simple, deterministic step-by-step code.

 

My advice would be:

 

1. don't waste time reading books on advanced programming; on the net, there is plenty of sites showing the basics in 1-2 articles instead of 1st half of the book

 

2. don't waste time installing a programming environment for a language you want to learn, compile, run it, build an .exe etc and then be searching for ways how to use it for trading, start with NT and see your results in graphs immediately

 

3. start with the simplest thing possible, e.g. your first trading system should be something like: if I was not in a trade for 20 last bars, enter on MARKET, exit 10 bars after entering, on MARKET - and gradually build up. This example might sound complex first but it's two extremely, extremely easy-to-understand lines of code, nothing more. The example stated here servers as the "Hello world" in trading system programming. After you've done the 1st example, add more thoughtful ideas, add indicators, etc.. one thing at a time, make it work, save the code for later reference, reward yourself with a snack and you can move on - add another bit to it.

 

4. if you have no previous programming experience, inputting two very simple lines of code, almost copied from help, and pressing a button to see their effect on the graphs, is the way to go. You will understand immediately how this code works and adding variables to store information to be used a few ticks later, will come naturally to you as you add to your code - every new logic principle you implement for the first time, you will remember it til the rest of your life and use it

 

A quick recap: Sure, getting yourself several books on programming IS a way to go. But in today's world where time is one of the most highly priced commodities, I'd recommend to throw yourself into water, you will learn to swim in a way useful for you in the quickest time. That's my opinion and I believe with this approach, anyone can create their first simple automated trading system (for testing purposes I presume) within 1 single 8-hour day.

 

Let me know if you'd want to - I can prepare a set of steps for you so you can create your first strategy in NT in less than 10 minutes instead of figuring out what & where for yourself (you always have time for this later).

Edited by gandalf33

Share this post


Link to post
Share on other sites

I guess I am a little late to the party, but here are my comments.

 

If you want to be serious :

 

1) Refresh your math skills(take a course, no excuses...I said serious...).

 

 

Not really. I've programmed almost everything under the sun and you don't need any math skills beyond grade 6 to program unless you're programming a physics engine and or do transformations for graphics.

 

now from my own experience is:

1. C++:

for speed - writing programs (.exe) that speeds processes that you may want to do routinely. e.g. I use the end program to clean up ;arge xls and csv data files for data analysis.

to be noted - strong in arrays, but dont try if you want to manipulate matrices. Its going to be a real pain.

 

C++ is not much faster than most people make it out to be. C#, which is managed is only 30% slower in most scenarios since the run-time knows what platform it is running on and it can optimize accordingly. C++ is a mess anyway (not to mention that manual memory management is a nightmare). That's what you get when you try to hack object orientation into an old language like C that was not intended to be used as one.

 

Are C++ and C# two different languages? Im still unclear regarding the similarities between different languages...

 

Yes, C++ and C# are different. The syntax is similar though (as is Java). C# is basically a better version of C++. C# is "managed", meaning it runs on a run-time called ".NET" which was originally developed by Microsoft and runs on Windows only. There is another innitiaive called "Mono" that is basically a copy of Microsoft's .NET but runs on all the other operating systems. C# is getting better and more dynamic with every new version. It's currently at version 3.0 but C# 4.0 is already in the works.

 

I suppose if I learn C++ or Python I could easily adjust to the rest?

 

All imperative programming languages are basically the same which means that if you understand one, it's pretty easy to pick up others. Statically typed languages are compiled while dynamic languages are usually interpreted at run-time and/or the code is dynamically generated and injected at run-time. It's a question of performance and productivity.

 

I would learn a procedural language (e.g. C or Pascal) first, then object oriented but statically typed (e.g. C++, C#, Java), then dynamic language (VB 6, Javascript, Ruby) and then maybe a functional language (e.g. Lisp, Cobol), which is not required but a completely different programming paradim.

 

If a person has not taken at least one computer course in high school or university, learning a programming language as an adult will be a daunting task.

 

My experience is it's better not to learn in high school or university, because it's taught so badly. It's better to get a good book from an author that knows what the **** he is talking about and go from there than listen to a tutor that does not really get it.

 

The absolutely central question is:

What are you intending to use your code for?

 

The answer to "where to start" will vary strongly depending on your intention.

 

I think it is essential that you answer that question. If all you want to do is write your own indicators, then you do not need to learn a general purpose programming language like those mentioned above.

 

The platform dictates the language. Really the discussions on languages are academic. Unless you code everything from scratch that is.

 

I agree. Just pick a platform and just learn the simplified programming language that comes with it. I think there was a reason they came up with domain-specific programming languages like EasyLanguage.

Share this post


Link to post
Share on other sites

can we define our goals and resources a little more:

 

...Primarily interested in being able to code strategies for various platforms. ...

 

what various platforms would you consider:

 

trading platform: your program runs inside a trader application:

- CQG formula

- Tradestation easylanguage

- Ninja Trader

- Neoticker

- eSignal

 

other platforms:

- Matlab

- R

- web server/web browser

 

native platform:

- C#

- C++

- VB

- Java

- Perl, PHP, Python

 

Writing a program (aka script) that runs within a trader application allow you to focus entirely on your algorithms because the programming for datafeeds and visualization has already been solved. The platform philosophy (single symbol, action occurs after a "bar" has closed) may not allow you to express your own ideas as you originally envision them.

 

Using a non-trader application you will need to consider your datafeed requirements, especially if you want realtime data. Maybe this is already solved with CQG-Matlab?

 

Native platform means running directly on your computer operating system, e.g. a program that runs under Windows, MacOS, or *Nix. In a pure computer-science definition, native means your program is translated to machine code that runs directly on hardware. In fact, this only occurs with C++. Writing an interactive realtime application, will require learning a great deal about COM or .NET for datafeeds and thinking about event driven (rather than linear) programming. Unless you intended to become a hobbyist or professional programmer I would avoid this route.

 

Programs which read and write files and do not require a GUI are relatively easy in any of the programming languages. I would favor an interpreted language like Perl, PHP, or Python (I prefer PHP since I also use it for web programming.)

Share this post


Link to post
Share on other sites

I program for a living. I have been doing it for 11 years now. Started off with COBOL and now program VB6, C#, and T-SQL.

 

- I agree with the others to stay away from C++. Unless you want to program full time, as opposed to trading full time, C++ is not the direction you want to go.

- I say to pick a language that CQG supports. Try to figure out if you can which language might have the most CQG stuff written in it.

- I have always found it is easier to learn programming by taking an existing program that you know works, and tweaking it to see what happens. See if you can find a simple indicator and then tweak it. Change a 10 period moving average and change it into a 8 or 12. Modify it to display in a different color or style. Those are all likely settings that can be changed programatically.

- When you look at something you know works, it eases the pressure of having to know it all to get going. You don't need to know it all, just modify it for what you need. This will obviously leaves gaps in your knowlege. You might decide to fill in those gaps or be satisfied with what you have if it is working for you.

- If you get something working, but it is not fast enough or whatever, you can then post it and have others critique it or pay to have a professional make it into everything you want it to be.

 

Hope this helps.

Share this post


Link to post
Share on other sites
I program for a living. I have been doing it for 11 years now. Started off with COBOL and now program VB6, C#, and T-SQL.

 

- I agree with the others to stay away from C++. Unless you want to program full time, as opposed to trading full time, C++ is not the direction you want to go.

- I say to pick a language that CQG supports. Try to figure out if you can which language might have the most CQG stuff written in it.

- I have always found it is easier to learn programming by taking an existing program that you know works, and tweaking it to see what happens. See if you can find a simple indicator and then tweak it. Change a 10 period moving average and change it into a 8 or 12. Modify it to display in a different color or style. Those are all likely settings that can be changed programatically.

- When you look at something you know works, it eases the pressure of having to know it all to get going. You don't need to know it all, just modify it for what you need. This will obviously leaves gaps in your knowlege. You might decide to fill in those gaps or be satisfied with what you have if it is working for you.

- If you get something working, but it is not fast enough or whatever, you can then post it and have others critique it or pay to have a professional make it into everything you want it to be.

 

Hope this helps.

 

I agree with the majority of it but the divergence is important.

 

John says to avoid C++. If he means "don't start building platforms from scratch in C++" I totally agree because there is so much to do and so much to learn.

 

But.

 

Sierra Chart uses C++ as one of its two programing interfaces. And it doesn't have to be (very) hard because they provide the structures and you just do the bit in between. It is not much more difficult than easy language.

 

Similarly one of the easy testing platforms Amibroker uses C++ for their coding but never says it so it doesn't scare one off - I can code for amibroker and then, with very minor changes use it in Sierra Chart.

 

More extreme, esignal code is also easy to change to SC code.

 

So, I think that many platforms use C++ like coding - the key isn't to avoid C but to avoid trying to do too much.

 

I do like the suggestion about starting with existing code and making a small variation ... thats how I learned C (and then C++) and I've gone from changing a CCI to 1000s of lines of code (just completing a bar by bar backtester because SC's one is tick by tick and they won't have a native bar by bar until next year).

Share this post


Link to post
Share on other sites

Help me understand; I'm not a newbie since I have traded for a time but I am new to systems and about to work toward that milestone. I've started out with JavaScript primarily because I was told that even though it is a 'scripting' language more than a programming language I should be able to pick up enough programming fundamentals from learning it to extrapolate (as it were) to programs that define trading systems. Is this a bit off the mark? Is there no *universal* programming or definitin language as it were for trading systems? Should there be?

 

Thanks,

 

SB

Share this post


Link to post
Share on other sites
Help me understand; I'm not a newbie since I have traded for a time but I am new to systems and about to work toward that milestone. I've started out with JavaScript primarily because I was told that even though it is a 'scripting' language more than a programming language I should be able to pick up enough programming fundamentals from learning it to extrapolate (as it were) to programs that define trading systems. Is this a bit off the mark? Is there no *universal* programming or definitin language as it were for trading systems? Should there be?

 

Thanks,

 

SB

 

 

I repeat...

 

for all the non-programmers, all the people who has not taken at least one computer course at high school or university...

 

please, please, please, stick with EasyLanguage.

 

if you don't know what it is, Google for it.

if you don't know who supports it, Google for it.

if you need an indicator in EasyLanguage, Google for it.

 

 

many people gave lots of "good" intentioned advices...

feel free to take a detour if you must.

Share this post


Link to post
Share on other sites

TradeStation has a steep learning curve, within the program itself, before even delving into it's programming language. It's not an easy program to configure or learn how to use. I spent years getting comfortable with it.

 

But it's programming language is the best of all the languages, in terms of it's simplicity. It's powerful enough to code anything imaginable and code it with less effort and less words than it takes in other languages. I am not proficient in many languages but I can read enough of all languages, and have proficiency in enough languages to know I am lucky to have found my way to TradeStation and it's EasyLanguage.

 

It's worth whatever it costs to make the switch.

 

I repeat...

 

for all the non-programmers, all the people who has not taken at least one computer course at high school or university...

 

please, please, please, stick with EasyLanguage.

 

if you don't know what it is, Google for it.

if you don't know who supports it, Google for it.

if you need an indicator in EasyLanguage, Google for it.

 

 

many people gave lots of "good" intentioned advices...

feel free to take a detour if you must.

Share this post


Link to post
Share on other sites
TradeStation has a steep learning curve, within the program itself, before even delving into it's programming language. It's not an easy program to configure or learn how to use. I spent years getting comfortable with it.

 

But it's programming language is the best of all the languages, in terms of it's simplicity. It's powerful enough to code anything imaginable and code it with less effort and less words than it takes in other languages. I am not proficient in many languages but I can read enough of all languages, and have proficiency in enough languages to know I am lucky to have found my way to TradeStation and it's EasyLanguage.

 

It's worth whatever it costs to make the switch.

 

tradestation has a steep learning curve?

 

that's the first time I have ever heard of someone with such a remark.

 

 

Have you tried Ninjatrader?

 

What do you think of it?

How would you compared the user interface with TradeStation?

Share this post


Link to post
Share on other sites

I don't have NT installed here and I don't have any desire to switch to it. The few times that I've tried it are limited to when I found some NT code on the internet that I wanted to translate. That experience didn't give me enough information about it to have an opinion about it's user interface but I definitely prefer TS's programming language.

Share this post


Link to post
Share on other sites

A slightly off-subject question, but does anyone know the official designation of the language used by the ProRealTime software (and hence many of the spreadbetting firms who white label this charting package)?

 

Thanks,

 

Bluehorseshoe

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Topics

  • Posts

    • Date: 29th March 2024. GBPUSD Analysis: The Pound Trades Higher But For How Long? The global Stocks Markets are closed due to Easter Friday (Good Friday). The NASDAQ continued to follow the sideways trend while other indices again rose. The SNP500 reaches an all-time high, but the NASDAQ remains under pressure from Tesla, Meta and Apple. The Euro continues to trade lower against all major currencies including the US Dollar, Euro and Japanese Yen. The British Pound is the best performing currency during this morning’s Asian session. However, investors are largely fixing their attention on this afternoon’s Core PCE Price Index. GBPUSD – The Pound Trades Higher but For How Long? The GBPUSD is slightly higher than the day’s open and is primary due to the Pound’s strong performance. At the moment, the British Pound is increasing in value against all major currencies. However, the US Dollar Index is also trading 0.10% higher and for this reason there is a slight conflict here. If investors wish to avoid this conflict, the EURUSD is a better option. This is because, the Euro depreciating against the whole currency market avoiding the “tug-of-war” scenario. The GBPUSD is trading slightly lower than the 2-month’s average price and is trading at 49.10 on the RSI. For this reason, the price of the exchange is at a “neutral” level and is signalling neither a buy nor a sell. The day’s price action and future signals are possibly likely to be triggered by this afternoon’s Core PCE Price Index. Analysts expect the Core PCE Price Index to read 0.3% which is slightly lower than the previous month but will result in the annual figure remaining at 2.85%. The PCE rate is different to the inflation rate and the Fed aims for a rate between 1.5% to 2.00%. Therefore, even if the annual rate remains at 2.85%, as analysts expect, it would be too high for the Fed. If the rate increases, even if only slightly, the US Dollar can again renew bullish momentum and the stock market can come under pressure. This includes the SNP500. Investors are focused on the publication of data on the UK’s gross domestic product (GDP) for the last quarter of 2023: the quarterly figures decreased by 0.3%, and 0.2% over the past 12-months. This confirms the state of a shallow recession and the need for stimulation. The data, combined with a cooling labor market and a steady decline in inflation, increase the likelihood that the Bank of England will soon begin interest rate cuts. In the latest meeting the Bank of England representatives did not see any members vote for a hike. USA500 – The SNP500 Rises to New Highs, But Cannot Hold Onto Gains! The price of the SNP500 rises to an all-time high, before correcting 0.33% and ending the day slightly lower than the open price. Nonetheless, the index performs better than the NASDAQ which came under pressure from Tesla, Meta and Apple which hold a higher weight compared to the SNP500. For the SNP500, these 3 stocks hold a weight of 9.25%, whereas the 3 stocks make up 14.63% of the NASDAQ. The SNP500 is also supported by ExxonMobil’s gains due to higher energy prices. The market will remain closed on Friday due to Easter. However, the market will reopen on Monday for the US and investors can expect high volatility. Investors will also need to take into consideration how the PCE Price Index and the changed value of the US Dollar is likely to affect the stock market next week. Always trade with strict risk management. Your capital is the single most important aspect of your trading business. Please note that times displayed based on local time zone and are from time of writing this report. Click HERE to access the full HFM Economic calendar. Want to learn to trade and analyse the markets? Join our webinars and get analysis and trading ideas combined with better understanding on how markets work. Click HERE to register for FREE! Click HERE to READ more Market news. Michalis Efthymiou Market Analyst HFMarkets Disclaimer: This material is provided as a general marketing communication for information purposes only and does not constitute an independent investment research. Nothing in this communication contains, or should be considered as containing, an investment advice or an investment recommendation or a solicitation for the purpose of buying or selling of any financial instrument. All information provided is gathered from reputable sources and any information containing an indication of past performance is not a guarantee or reliable indicator of future performance. Users acknowledge that any investment in FX and CFDs products is characterized by a certain degree of uncertainty and that any investment of this nature involves a high level of risk for which the users are solely responsible and liable. We assume no liability for any loss arising from any investment made based on the information provided in this communication. This communication must not be reproduced or further distributed without our prior written permission.
    • MT4 is good and will be good until their parent company keep updating the software, later mt4 users will have to switch to mt5.
    • $SOUN SoundHound AI stock at 5.91 support area , see https://stockconsultant.com/?SOUN
    • $ELEV Elevation Oncology stock bull flag breakout watch , see https://stockconsultant.com/?ELEV
    • $AVDX AvidXchange stock narrow range breakout watch above 13.32 , see https://stockconsultant.com/?AVDX
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.