| New signals service! | |
|
|||||||
| Register in Forex TSD! | |
|
Trading Systems Leaders in this forum (automated trading systems) are winning more than 3000 pips in a month (30000$ investing one lot every time). Click here to register and get more information |
|
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
What the stacksize means?
When we are using indicator_chart_window, indicator_separate_window? What is indicator_buffers? It may be up to 8 but what is that? How to understand "indicator_minimum" and "indicator_maximum"? How to understand "the bottom border for the chart" and "the top border for the chart"? I know what chart is but where is the top (border) and bottom (border)? What is indicator_colorN? I know that N can be displayed between 1 and 8 (color, number of the line ...)? What is 1 or 8? Which kind of data type is 1 in this case? And the same question for indicator_levelN. |
|
|||
|
I saw in the code of some EA this line:
#include <stdlib.mqh> What is stdlib.mqh file? Why we need to use it? What is inside this file and how to check it? Which functions? Is it possible ti write our own library file with most usable pieces of the code? Where to get custom library file? May be somebody wrote it already ... |
|
||||
|
Quote:
Thank you very much for your valuable questions. Lesson 11 which I'm writing right now is going to answer all these questions and more, so wait for it. |
|
||||
|
Quote:
At the beginning I’d like to explain to you the main idea behind my previous nine lessons. I wanted to present the programming in MQL4 in a simple way and without entering in a lot of minutiae which will distribute the reader’s concentration. Now, let me answer your questions. The file "stdlib.mqh" is a one of mqh files. And those kinds of files contain frequently used functions and variables or it contains the declarations of the functions of a library file. Our file stdlib.mqh contains the declarations of the library file stdlib.mq4. Those kinds of files used in your code when you use the include directive which tells the compiler to open the file and paste its content in your code. It’s very like manual opening of the file, copying its content then pasting it in your code. If you have any code which you use it frequently you can put it in those files and you will have not to write it every time you want to use. It’s very like the very popular .h header files used in c++ programming language. Now, I’ll give you a full description of the content of the file stdlib.mqh. You can find this file in you MetaTrader 4\experts\include path and if you double-clicked it you will see its content in MetaEditor. You will find five functions declarations included in the stdlib.mqh and I’ll give you more details about each of them. string ErrorDescription(int error_code); This function takes an integer value and returns string value. Its job is taking the error number and returns the string description of the error. For example: ErrorDescription(65) will return the description Invalid account. ErrorDescription(134) will return the description Not enough money. You could ask me, and how can I get the error number? You get the error number by using the function GetLastError, which will return an integer value, with the last error has occurred while the execution of you program. int RGB(int red_value,int green_value,int blue_value); This function takes three integer values and returns an integer value. The three inputs are the values of red, green and blue of the color and its job to return the integer-valued representation of the color. For example: RGB(255,255,255) will return 16777215 which is the integer-value of the White color. bool CompareDoubles(double number1,double number2); This function takes two doubles values and returns a Boolean value. Its job is comparing the two double entries (from right to left), and return the result of the comparison. For example: CompareDoubles(2.0,2.01) will return false CompareDoubles(2.0,2.0) will return true. string DoubleToStrMorePrecision(double number,int precision); This function takes a double value and an integer value and returns a string value. Its job is returning a string contains the representation of the double number you entered as a first parameter with the number of the precisions you entered in the second parameter (up to 16 digits after decimal point). For example: DoubleToStrMorePrecision(2,10) will return “2.0000000000” DoubleToStrMorePrecision(2.1234567890,5) will return “2.12346” string IntegerToHexString(int integer_number); This function takes one value of integer type and returns as string value. Its job is converting the entered integer to a string contains the hexadecimal notation representation of the entered integer. For example: IntegerToHexString(16777215) will return “00FFFFFF” I hope I gave you a good description in this topic. If you have any further questions in this topic I’ll be happy. |
|
||||
|
Quote:
I read your explanation in Lesson 11 about what the stacksize is: "It's an integer value sets the memory size for every thread, the default is 16384. The data type of the property is integer." How do we know what size this should be? How many threads does MetaTrader spin off for 1 Expert Advisor? Thank you for all your advice. |
|
||||
|
Quote:
I'm so happy for your questions ![]() 1- Each thread MT4 creates receives its own stacksize(memory space) internally, but you can set the stacksize value. I think there's no need to change default stack_size (16384). Note: I tried to set it to very big number "#property stacksize 100000000000000000" and nothing has been changed and compiler didn't complain. 2- MT4 uses only one thread for the Expert Advisor. |
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Lesson 18 - Working with templates | codersguru | Metatrader 4 mql 4 - Development course | 13 | 08-03-2008 01:39 AM |
| Need an OBJECT lesson ! | CaptainVideo | Tools and utilities | 6 | 05-18-2006 10:42 PM |
| Lesson 17 - Your First Script | codersguru | Metatrader 4 mql 4 - Development course | 0 | 01-04-2006 11:37 PM |
| Lesson 2 - SYNTAX | codersguru | Lessons | 7 | 12-18-2005 12:57 PM |
| Lesson 7 - Functions | codersguru | Lessons | 2 | 11-02-2005 03:32 PM |