What does OrderType() > OP_SELL mean? - page 2

 
anuj71 #: This not Decompiled. I purchased this EA from original creator a long back.

If you purchased the EA, then the seller used parts from a decompiled process.

I'm not stating that all the code was decompiled, but it most definitely contained parts that originated from a decompilation process.

Variable names like "ld_0234" are examples of such a process.

Normal users do not name variables that way. They give them proper names with meaning.

 

Also, in a previous topic of yours, in one of your posts ... https://www.mql5.com/en/forum/460443/page2#comment_51783601

There was also evidence of the use of decompiled code (the use of function names like "f0_54", "f0_15", "f0_37", etc.

At the time, the post was overlooked and you were not warned about it, but humans don't name functions that way. They give them proper and meaningful names that identify their functionality.

So, from whomever you obtained the code, they used decompiled code in the EA.

 
Fernando Carreiro #:
There was also evidence of the use of decompiled code (the use of function names like "f0_54", "f0_15", "f0_37", etc.

This code is also belongs to same EA. Creator from where i purchased, He coded many EA but not active anymore. I do not think it decompiled one. As he given me a doc file long time back with many function explanation for example f0_51 for Closing Buy Limit, f0_15 for closing Sell Limit, etc, etc



In this EA, there is many sections which is clearly readable and has meaningful word, if it decompiled than all the words has no meaning.

 
anuj71 #:This code is also belongs to same EA. Creator from where i purchased, He coded many EA but not active anymore. I do not think it decompiled one. As he given me a doc file long time back with many function explanation for example f0_51 for Closing Buy Limit, f0_15 for closing Sell Limit, etc, etc In this EA, there is many sections which is clearly readable and has meaningful word, if it decompiled than all the words has no meaning.

As I stated, not all of that code is decompiled, but I can 100% state that some of the code was not theirs and that it was originally obtained from decompilation.

In other words, the seller of the code violated intellectual property rights and copyrights by selling you this code.

So, please take the time to understand the difference. Become able to know when you are dealing with such code, so that you are not deceived in the future.

 
Fernando Carreiro #:

They are examples of very bad coding practices. It assumes to depend on the internal values of enumerations or the value of macros.

That is dangerous, because should those values change, the code would fail. So please, do not copy those bad coding practices.

Unfortunately, I think that in this particular (MT4 operation type) case this can be considered normal practice.

  1. Operation types are not combined into an enum
  2. There is no ID for values 6 and 7 although these values are used

I believe that the fact from the second item in the list clearly allows the use of values instead of an identifier, since there is simply no other choice (for values 6 and 7).

This is bad practice unless it is an MT4 operation type😄

 
Fernando Carreiro #:

They are examples of very bad coding practices. It assumes to depend on the internal values of enumerations or the value of macros.

That is dangerous, because should those values change, the code would fail. So please, do not copy those bad coding practices.

I changed from

if(OrderType() > OP_SELL)

To

if(OrderType() != OP_BUY && OrderType() != OP_SELL)


Both perform same operation selecting Pending Orders (Buy Limit, Sell Limit, Buy Stop and Sell Stop). Now it fine?