C programming language for beginners

how do i get started pliz

YouTube. it has lots and lots of videos, or some websites like w3schools or learn-c or tutorialspoint

It depends on your background. Did you ever have any education at all about programming? Or coding? And why particularly do you wish to learn to program in C?

I guess most of us who are a bit “In the dark” regarding “programming” find our way to “C” in the research. When I did my degree (Late '60’s) we were told that the languages were “Fortran and Cobal” if I remember aright.

I too have been looking over the years to get a foothold and have huge thick books on “C+” and “Basic for Excel” - again if I remember aright. (That one I at least got a few pages into ! )

Since the OP publishes his request for advice in a Trading forum, I wonder whether he (and I) would find a brief assessment as to what system / language we may find easiest and most helpful to learn wrt writing and testing systems which would be compatible with brokers software ?

Pretty Please ? :wink:

I need to admit that I am not specialised in this area. But my consulting (paid work) in 2019 and 2020 led me to a requirement to front-end then manage an initiative by a major IT integration provider in the generalised area of “robotic process automation”. Until I volunteered to be piggy in the middle between line management and the IT script kiddies (as we lovingly refer to our programmers, coders or “application developers or devops” I had no idea of why there always seemed to be delays in the pipeline when everyone nodded their heads and said “we do things the Agile way around here”. Agile has its place in rapid application development but I found that it was perhaps a case of the blind leading the blind. In short, the “piggy in the middle” was required to “translate” business language into coding language. After a slow start, we rapidly picked up pace, and I left the role in the capable hands of a permanent member of staff.

What I gained from this short foray into the depths of programming is that our chosen integrator had their own way of doing things - built up from two decades of successful practice, but that for many reasons their methods needed to be dragged into the 21st century. In particular, to capture an input data feed, they used a method they referred to as “screen scraping” which is a totally misleading description of an API (application programming interface) that I discovered required rework every time there was a version change in the target application to which the API was directed. I was politely informed by an expert that the only type of API that was acceptable was one named “restful API”. Link provided below.

During this time (on a personal basis and linked to Forex strategy and planning), I was also interested in determining how one may use social engineering (like twitter feed outputs) as a possible indicator to add to a Forex trading plan. I realized these two subjects overlapped in their application to real world.

I subscribed to TradingView and found out that they use PineScript for EA creation.

Introduction — Pine Script User Manual 4 documentation.

MT4 is used by a large number of brokers as the “included package”. It uses a language called MQL4.
MQL4 uses a syntax similar to C++/C#/C/Java . So, if you already know some of these languages, it will not take long to learn how to use MQL4.
https://www.earnforex.com/guides/what-is-mql4/

What Can You Really Do with MQL4?

MQL4 is an extremely powerful tool that if used properly can expand you trading possibilities. To give you some examples, with MQL4 you can:

  • Perform mathematical operations like, for example, calculate a position size given risk parameters.
  • Calculate stop-loss and take-profit levels.
  • Open and close orders.
  • Send notifications on to the screen or to an email address.
  • Create log files and reports.
  • Create custom indicators.
  • Automate your trading, letting your computer trade for you without your interaction.

But this is “so 20th century”.

This has already got a bit long, but carry on looking at MT5.

I took a decision that I would invest time in learning Pinescript for TradingView instead of C, C++ or MQL4 or 5 that locks your time invested into a specific product.

I haven’t progressed that because I am now running a production Chia farm (earning cryptocurrency) and my limited interest in programming has temporarily shifted to Linux, to understand more about non-Windows computer systems.

That may or may not be of help to either of you, and is a bit long winded, but don’t make the mistake of going down a rabbit hole of time invested in a language that you may end up never actually using.

Not an easy task ! - those on the practical end of the information tend to “Skip steps” in their explanation - because they seem so trivial as to “Be obvious” whiclst the “kiddies” have no idea at all of teh process and simply write what they are told !

I had an experience around 2002 when I was Commercial manager (Freelance) on a complex gas pipeline repair and upgrade scheme - coevring an area from the M62 to luton and from the M1 to the East coast. So we had perhaps 60 gangs of highly skilled Gas fitters each with a van and trailer with a mini excavator, Compressor, Generator and welding equipment to join plastic pipes together each team was either 2 or 3 man and they were sent to “Sort it out” - so a job could last from half a day to 3 weeks. They sent in Tracksheets which were basically timesheets showing hours, equipment usage and materials. My team was around 20 “Cost managers” (Inputters but we got paid more if they were called “managers” who spent all day every day just entering these tracksheets onto a bespoke database written in Lotus Approach (there was a lot of scope for items NOT written on the tracksheet to get missed - and there was no training for inputters in how the job was actually done.

Anyhow, each nitem on the tracksheet attracted a “Cost” from within the database and the whole tracksheet came up with a “job total” which was then batched up and the whole database submitted once a week to the client. Summing up all the areas there would be perhaps 250 tracksheets a week (Totalling maybe £1.5 million) submitted for “checking” by the clients “Engineers” (skilled and experienced Gas Engineers - but with little ability on computerised working) These Engineers then approved some of the costs on the “easy ones” rejected some, paid lesser amounts on some, and part-paid some whilst they “had a think” about part of teh costs. Others simply got put on the corner of the desk so they could “Do it later”. Theoretically each was to be returned within a week “checked” - SOme were, some were late and some never got returned at all ! And all of these "checked tracksheets were then aggregated and each Engineer sent their checked tracksheets to a central point in the client’s operation where they were put together and a response sent to us as a Plain TEXT document ! Part of my job was to look through and match each tracksheet with the relevant bit of “Text” and work out whether we had been paid, not paid (further action required), part paid (further action) or never returned (Further action)

Now the Lotus Approach part was relatively easy to get into Excel - but looking through all these Text Files to ID the T/S number then typing the numbers (and comments) from the Text file onto the Excel sheet drove you crazy ! - and teht was even before you could start working out whether you had been paid the right amount or not - and trying to work out whether there were errors or mssed items on the orignal Tracksheets was pretty nigh impossible ! So simply hitting the decimal poit twice when entering a quantity meant that the figure just worked out at Zero and could cost you £50,000 !

So I had quiet words with my “IT Dept” and coaxed N into writing an “unwinding Macro” in Excel so that Excel could unwind the text files and populate cells on the relevant Excel line - where I could then do maningful work on it !

Anyhow N (WHo invented my “title” of Falstaff :slightly_smiling_face: ) turned up on the Tuesday (we were 100 miles apart) and I had to treat him like a Sainted captive (I couldn’t Let him go - to “I just need to pop back to the office” - I’d never get him back) and had to coax him with “c’mon N - You can do this”) Plus a never ending stream of MacFlurries and by Friday afternoon, we had sat together for 4 days and set my laptop to “unwinding” one of these text files ! - That was around 2 ish and by 4;30 it was still running - so we put the laptop in my desk drawer and Left it for the weekend !

Returning Monday - it was still running ! and was about 11 am it finally coughed belched and went off for a cup of tea and a fag ! (quirky laptop that way) - But the damn thing WORKED ! :slightly_smiling_face:

Eventually that success cost me the job of course ! (You ever had that happen to you ?) - It took them a year and an ungodly amount of money to render me “dispensable” (in fact N was tasked with duplicating the whole Database in Access because he couldn’t get his head around Lotus Approach - but they got there eventually !) :rofl:
That success upset a lot of people internally and upset the Client (caused them to go “over budget” because I eliminated the confusion and started firing off arguments and queries within days of receipt of this horrendous “Text File” :laughing:

But the point is that that interface between “technical” and IT is so hard to negotiate unless they both sit together and work it through TOGETHER !

I learned a lot - and it made me look much deeper into Excel and what it can actually do - I did make significant progress on Macros but never got to the stage of being able to write them in VBA properly.

Anyhow I took a look at your manual for PINE - thanks for that - and it seems the basic principles are fairly interchangeable between the various programmes I have seen - the “Look” is familiar.

I know a lot of the lads swear by MT4 and are resistant to change - so I suppose it’s a case of just learning whatever your coincides with your Broker - or finding a Broker whose system coincides with what you know.

Is Linux similar in principle ?

Anyhow thanks for your input - much appreciated. How’s the Chia going ?
Some Guy I follow on Electronics is talking about “Helium” - seems a litle less capital intensive and easier perhaps for a novice - have you seen it ?

[PS - apologies for my typing - I’ve put some of it right - but hopefully you can work out what I was trying to say for teh rest :sunglasses: ]

I read your post with a feeling of deja vu a few times during the read. Back in the noughties, I survived 27 three-monthly contract renewals at bp, but even the best jobs in the world can become a grind. I left bp in 2008 to broaden my skill set and went to Experian. Six months there was enough for me. Great people, but really disjointed business processes and too much mad growth of acquisition and integration.

You have related exactly what the problem was, and still is. The world of IT and automation has reached such a state that it is really difficult to find a small group of people (say, less than four) who actually understand the end to end business processes of a lot of companies. And change is relentless. People talk about a “five year roadmap” which seems pretty straightforward until you are given sufficient time to identify the “dependencies”. Then follows a dependency mapping, an interface register and suddenly your “project” becomes a programme of dependencies that can be larger than the project itself. You could always act dumb and pretend you didn’t see those dependencies coming, or “nobody told you” but in my opinion, that is one of the only advantages of hiring contract people who have the experience elsewhere, and do not have the subjective baggage that comes with the territory of an ingrained employee who not only has to do his or her job, but has to “be seen to be doing their job well in the eyes of their managers”. They say people don’t leave companies - they leave their managers. That is the truest statement I have observed in 25 years of consulting.

Anyway, how does that help other members on here? Two ways. First - to do anything productive with coding if an Expert Advisor is the desired outcome, you may have to just take the decision first which platform you are going to use (MT4, MT5, other) and just get on with it. On the other hand as you say, these languages have much of a muchness and to do anything useful in one language is a great step forward in understanding the next one. In deciding about two months ago to do a self-taught retraining in IT in general, there was a specific goal, and a broader goal. The specific was related to Chia mining, and by the way, I have delayed putting on line the 1,050 plots that I possess by “buying the farm” now four weeks ago. Time flies. I have done that because some of those plots are made before pools were created. Yesterday I added another 36 plots to my “pilot farm that is now in production” for a total of 282 plots. You can see the acceleration effect of continuously adding plots to the existing farm. Eleven drives running on a 10 year old “gaming PC” that was broken before I fixed it, and all plots at “100%” meaning I have set up the farm correctly. I’ve attached one snapshot of the set up from last night in “the workshop”. I am glad I have done this “in an Agile way” because I am now not going to bother squeezing 20 hard drives into any more big tower systems. I am going to run them in those simple perspex towers with two small fans on the front. If for no other reason than “they look like something out of Back To The Future, and observers think you are the dogs b__ocks” for being able to create such an artistic masterpiece". Admittedly, at the risk of being a legend in one’s own mind. :rofl:

Helium (HNT) is my next pilot but I promised myself to get Chia to a stable state, before I even think about the next mining income stream. I have another 60 terabytes of drives to fill, in addition to the 100 TiB that is already sat there full of plots. So Helium has my vote. What put me off was the estimated five month lead time on a HNT box of tricks. If that lead time remains high, I will have lost time opportunity. But some folks are getting so impatient, I expect HNT to drop in price (as I expected XCH to do and it did). Tracking the monthly “time to payback” of my evolving system is the only criteria that matters, and as long as it does not exceed 24 months, the decision will remain valid. HNT could be less capital intensive, but that depends on whether you wish to buy one or ten - and to use ten you need 10 friends or colleagues who would be willing to have you place it at their place of residence, and that requires a business case in itself.

As for “coding”, I have retrained myself on CMD or command prompt in Windows 10. I have also dedicated some time to Powershell, which I find quite easy now given that I have been able to write a MadMax powershell script for creating plots about 20 times over. You need to change the temporary 1 and temporary 2 drive letters, and the final plot destination letter, and this is a pain if you are running off one PC. So I now have three - the Win10 based farm that is harvesting only. The Win10 machine I bought with the farm, capable of almost a plot per hour, and a “test rig” to mount, format and crystaldiskinfo-check hard drives before queueing them for the plotting machine.

I have also bought some really cheap older tablets (2 x 10 inch and 2 x 7 inch) to get familiar with Android. I am proud that I converted an Amazon Fire HD8 to a bog standard Android tablet, so that I could use it as a Raspberry Pi linux based monitor. It is too small so I am now trying to do the same with a 10 inch tablet, and learning what “rooting” an Android operating system machine means. Apologies in advance for any Australian members - no offence meant.

On the Linux side, I have set up a Raspberry Pi 400 and a Raspberry Pi 3b to play with - for learning how to use Ubuntu 20.04 to host another Chia farm. With the knowledge I have now that a Chia farm may be built at a cost of £100 plus SSD and hard drive capacity (and about another £100 of external hardware like SATA and power cables, PCIe to 4xSATA cards to host up to 24 drives) the Raspberry Pi may be an unnecessary distraction. But the journey is great.