Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 143

 

Hello!

Help with an EA, I need it to open only one order to one side

Files:
3_sve4i.mq4  3 kb
 
Zhunko:
This is the decimal logarithm of the lot change step.


You can get the lot increment from Market Info:

шаг лота = MarketInfo (Symbol(), MODE_LOTSTEP);

Why get so twisted, may I ask?

 
hoz:


You can get the lot increments from the market info:

Why do you have to go through all this trouble, can you find out?

Probably to find out the number of decimal places for the lot increment. If lot size LotSize is calculated by some complicated mathematical method, then NormalizeDouble(LotSize,Number of digits after decimal point for lot step);

)))))

 
Sepulca:

Probably to find out the number of decimal places for the lot step. If lot size LotSize is calculated in some complicated mathematical way, then NormalizeDouble(LotSize,Number of decimal places for lot step);

)))))


Wow.
 
Zolotai:

Say you have an array. [2]=>3[3]=>4.

How to pull out the key of the last cell and as the value, also the last one?

Err... sorry. Is there any way to phrase the question? Or at least put punctuation marks in the question.
 
Ulia:
I have a Windows 7 maximum sp1, russian speaking
After the installation of MT4 terminal build 509 if I choose the languages-Russian, then after restarting all written in incomprehensible symbols, if I put English language all is visible normally in English, only in the navigator the name is also displayed in incomprehensible symbols as the account was originally registered in Russian. I reached the terminal from Instaforex, but other brokerage companies have the same problem. Probably the problem is in fonts on my OS.

Can you please advise me what are the requirements for fonts, can I add /insert /replace them and how to do it as I don't want to move to another operating system.
I do not want to move other programs - avast antivirus, Opera and all Windows 7 programs (notepad, calculator, etc.) work fine in Russian.

photos of the terminal in English and Russian are attached.

Julia, go to the Control Panel, click on Language and regional standards, go to the Advanced tab and look at your preferred language in the "Language for programs not supporting Unicode" field. It should be Russian.


 

Such a question. If there are different libraries. One of them has fWrite_Log() function. It logs some required event. This function is defined and implemented in one of the libraries. If I use it in other libraries, the compiler, of course, complains that this function is undeclared. And understandably so.

A question arises. How is this task solved correctly? How can I declare this function fWrite_Log() in each library where it is used? But it turns out that if an Expert Advisor includes, say, 10 libraries, then this function will be declared 10 times (once in each library). Is it the only right way?

 
hoz:

Such a question. If there are different libraries. One of them has fWrite_Log() function. It logs some required event. This function is defined and implemented in one of the libraries. If I use it in other libraries, the compiler, of course, complains that this function is undeclared. And understandably so.

A question arises. How is this task solved correctly? How can I declare this function fWrite_Log() in each library where it is used? But it turns out that if an Expert Advisor includes, say, 10 libraries, then this function will be declared 10 times (once in each library). Is it the only right way?

We need to import that function ( fWrite_Log() ) from the library where it is located.
 
hoz:


You can get the lot increment from the market info:

Why go to all this trouble, may I ask?


hoz:

There's a function for determining the minimum bit size of a lot:

I'm wondering why there's a logarithm, and a natural one at that. Why do they divide one by the other? What did the author of this function want to implement?

If you're feeling lazy and don't want to see what both functions return, you'd better learn to read: "minimal lot size" and "lot size step" are not the same thing! :(

 
Zhunko:
It should be imported into the library by that function (fWrite_Log()) from the library where it is stored.


Thank you. Somehow I haven't done it before, though I've read it. I need to fix this skill.

TarasBY:


If you're feeling lazy and don't want to see what both options return, at least learn to read: "minimum lot size" and "lot size step" are not the same thing! :(


Yes, I've been looking at your implementations at my leisure... You can rack your brains there until you figure out what's what. The libraries don't compile. But your realizations are very logical and competent. It's good for your mind to dig around. While I was digging, my brain started to boil)) And I've already started to confuse one from the other.

One thing is strange. You have a couple of functions that partially duplicate one another. For example,

fCheck_ValidStops () - Checking correctness of setting STOPPs

fCheck_LevelsBLOCK() - Checking for validity of FREEZELEVEL and STOPLEVEL

Stops are checked in the first case and in the second case, too. But the second one checks freezevel too. What good is it?

Reason: