Explain that to me?

 
Hi all Trades, I have a stupid question for you, if there are any stupid questions.
Why can't you use in the code, for example, StopLoss, TakeProfit, BreakEven, TrailingStop, Ask, Bid and a lot of others throughout the code, without using a lot of abbreviations if you don't need to.
Can someone out there explain it to me?
 
Christer Lundqvist: Why can't you … if you don't need to.

That's nonsensical question. “Don't need to” implies you can. It's your code, code it how you want.

 
William Roeder #:

That's nonsensical question. “Don't need to” implies you can. It's your code, code it how you want.

I have heard but not read anything about it, but then try to take a little here and there, I bought myself a book, what was the point, nothing there were more questions after that book than I had before. You say cod is what you want, in cod it's sl, SL, asl, StopLoss it's very easy to remember, StopLoss everyone knows what it means, am I wrong or right?

 
function(){
   double SL=…; // Stop Loss
  if(SL == …) …

SL is also easy to remember when you document your code.

You are neither wrong or right.

 
Christer Lundqvist #:

I have heard but not read anything about it, but then try to take a little here and there, I bought myself a book, what was the point, nothing there were more questions after that book than I had before. You say cod is what you want, in cod it's sl, SL, asl, StopLoss it's very easy to remember, StopLoss everyone knows what it means, am I wrong or right?

I understand that it's hard to write out what SL = StopLoss means all the time, but I'm looking for people who write code and try to teach, I think they should use the expressions they were taught when they started programming, it's easier for you to come up with abbreviations yourself, you had written (double SL = ...; if (SL == ...) the three dots after what should it say there?

 
Christer Lundqvist #:

I understand that it's hard to write out what SL = StopLoss means all the time, but I'm looking for people who write code and try to teach, I think they should use the expressions they were taught when they started programming, it's easier for you to come up with abbreviations yourself, you had written (double SL = ...; if (SL == ...) the three dots after what should it say there?

Not everybody uses abbreviations, personally I never do nowadays, usually my variables are very descriptive, e.g.: stoploss_price, stoploss_points, etc...

The ... he used in there is like etc... it is not real code.

 
Alexandre Borela #:

Not everybody uses abbreviations, personally I never do nowadays, usually my variables are very descriptive, e.g.: stoploss_price, stoploss_points, etc...

The ... he used in there is like etc... it is not real code.

Can I use code from someone else, for example a book I have bought, and use the code for myself, or do I have to rewrite all that code to use it in my own program, the people at MQL5 say that you can reuse code to take into your own programs, is that so or can't you.

 
Christer Lundqvist #:

Can I use code from someone else, for example a book I have bought, and use the code for myself, or do I have to rewrite all that code to use it in my own program, the people at MQL5 say that you can reuse code to take into your own programs, is that so or can't you.

If you want to learn mql5 specifically, there are some tutorials on youtube but if you never wrote any code in your life, you may want to get an easier programming language like python or ruby just to learn algorithms, and in that case don't switch to mql5 until you are comfortable with the basic concepts of imperative languages: variables, functions, conditionals, loops and classes.

 
Alexandre Borela #:

Not everybody uses abbreviations, personally I never do nowadays, usually my variables are very descriptive, e.g.: stoploss_price, stoploss_points, etc...

The ... he used in there is like etc... it is not real code.

Your way of coding is the smartest and cleanest way to write code, if you have a big project it's still very easy, shorthand will be a big obstacle when developing a complex system, especially a system that needs many people to work together.  Note that when writing code, just enter a few characters, the editor will show suggestions for lists of Variables, Functions, Constants, Classes, ... you just need to choose, isn't it easy, I don't understand why trying to abbreviate to become more complicated.

 
Christer Lundqvist #:

Can I use code from someone else, for example a book I have bought, and use the code for myself, or do I have to rewrite all that code to use it in my own program, the people at MQL5 say that you can reuse code to take into your own programs, is that so or can't you.

You can completely reuse variables, functions, ... from other sources, you can redefine Variable Name, Function Name, Class Name easily.  By using Ctr + F : Find the variable name you want to Change the name, and re-enter the variable name you want to change and select Replace All.  This is how I usually do it

 
Dao Thi Thanh Nguyet #:

You can completely reuse variables, functions, ... from other sources, you can redefine Variable Name, Function Name, Class Name easily.  By using Ctr + F : Find the variable name you want to Change the name, and re-enter the variable name you want to change and select Replace All.  This is how I usually do it

If I decide to reuse code, how do I make it painless, I have a code that I wrote myself, and I have for the book I bought, the only thing I want to put in is BreakEven and TrailingStop, how do I do it?