|
|||||||
| 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 (1) | Thread Tools | Display Modes |
|
|||
|
I have the questions.
1. You described about #property indicator_buffer 1 Why do we need this buffer? What is it? 2. We wrote: double ExtMapBuffer1[] And you described about arrays. As I understand we may use int my_array [2] = {30, 70} when #property indicator_minimum 0 #property indicator_maximum 100 and we need to draw two horizontal lines (for example). And if not 30 and 70. But 30.5 and 60.5 we will use double instead of int? 3. Why double ExtMapBuffer1[] ? Is it always ExtMapBuffer and we need just remember it? 4. int ExtCountedBars = 0 It means we are counting everything using curent zero bar. But in some cases we need to xalculate high or low for 300 bars for example. Should we use int ExtCountedBars = 300 ? But if we need to change it from time to time we will use in property? #property ???? Last edited by newdigital : 11-07-2005 at 08:06 AM. |
|
||||
|
Hi newdigital,
Thank you very much for your GREAT questions. Quote:
)2- indicator_buffers is the number of memory allocated to draw your line(s). When you set the number (up to 8) you are telling MQL4: “Please allocate a memory buffer for me to draw my line”. 3- We need indicator_buffers when we need to draw lines. Quote:
The data type of #property indicator_maximum & #property indicator_minimum is integer in the MQL4 guide. I forgot to mention that was wrong. They actually are double. So, you can use something like that: #property indicator_maximum 40.50 #property indicator_minimum 1.10 Quote:
Quote:
1- You can use any value you want instead of 0. 2- ExtCountedBars is a variable not a property. 3- If you want to enable the user to change this value use: extern int ExtCountedBars = 0; |
|
||||
|
Quote:
Because 0 is counted as well. <hr> //---- indicators SetIndexStyle(0,1, 5); SetIndexBuffer(0,ExtMapBuffer1); // Set the index number for the buffer. string short_name = "My First Indicator is Running!"; IndicatorShortName (short_name); // Indicator Short name places the name of the indicator in the upper left // hand corner. // This fuction has a return type of VOID. meaning it just does it's job and // does not return any value to the calling function. //34567891123456789212345678931234567894123456789512 3456789612345678971234567898 3456789912345678911234567892123456789312 // 80 and 132 Character ruler. //---- return(1); } Question: why is return set to 1? Because the int Init () function returns a drawing object? Last edited by Techguy : 11-20-2005 at 10:26 PM. Reason: Did not want to double post and I had a question |
|
||||
|
Why is pos = 2? or 3?
Codersguru:
I added in this code and got this result: if (counted_bars>0) counted_bars--; int pos = Bars- counted_bars; Print ("Bar index number is ", pos, "."); // Bars is declared internally and equals the number of bars on the chart. double dHigh , dLow, dResult; // a String of declarations. Comment ("Hi, I'm here on the main Chart Window!"); // Prints a message in the top left corner of the chart. The bar index number prints out as 2 , then 3, then 2,then 3?? |
|
|||
|
Codersguru asked this in Lesson 11:
"How will we work? We will write the line(s) of the code we are going to explain then we will explain them afterwards, if there are no topics, we will explain the line(s) of code directly. But at the most of the time we will pause to discuss some general topics. I want to here your suggestion about this method please!" The line-by-line explanations are an excellent technique, and it was fine to have the pauses to discuss general topics. Thanks to Codersguru for this helpful tutorial! |
|
||||
|
Quote:
Thank you very much for your answer ! It's very helpful (& pleasant) comment.I hope you enjoyed the lessons. |
|
|||
|
Where new Indicators are stored
Hi
I had a run around trying to figure out where new indicators are stored. Finally I saw it was in the navigation window under 'custom indicators' - I did not see this mentioned in the lessons 10 through 13 - maybe I missed it. Thanks for the great tutorials and I hope u managed to get u're car fixed. |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
LinkBacks (?)
LinkBack to this Thread: http://www.forex-tsd.com/lessons/263-lesson-11-your-first-indicator-part2.html
|
|||
| Posted By | For | Type | Date |
| Forex Indicators With Explanation - Type Your Search Here | This thread | Refback | 12-04-2007 10:20 PM |
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Lesson 12 - Your First Indicator (Part3) | codersguru | Lessons | 23 | 05-15-2008 05:37 PM |
| Lesson 6 - Loops & Decisions (Part2) | codersguru | Lessons | 1 | 05-18-2007 02:20 PM |
| Lesson 9 - Preprocessors | codersguru | Lessons | 7 | 05-18-2006 08:26 PM |
| Lesson 17 - Your First Script | codersguru | Metatrader 4 mql 4 - Development course | 0 | 01-04-2006 11:37 PM |
| Lesson 10 - Your First Indicator (Part1) | codersguru | Lessons | 1 | 11-08-2005 11:17 PM |