Forex



Go Back   Forex Trading > Training > Metatrader > Metatrader 4 mql 4 - Development course > Lessons
Forex Forum Register More recent Calendar Advertising Others Help






Register
Welcome to Forex-TSD!, one of the largest Forex forums worldwide, where you will be able to find the most complete and reliable Forex information imaginable.

From the list below, select the forum that you want to visit and register to post, as many times you want. It’s absolutely free. Click here for registering on Forex-TSD.

Exclusive Forum
The Exclusive Forum is the only paid section. Once you subscribe, you will get free access to real cutting-edge Trading Systems (automated and not), Indicators, Signals, Articles, etc., that will help and guide you, in ways that you could only imagine, with your Forex trading.
  • Elite Section
    Get access to private discussions, specialized support, indicators and trading systems reported every week.
  • Advanced Elite Section
    For professional traders, trading system developers and any other member who may need to use and/or convert, the most cutting-edge exclusive indicators and trading systems for MT4 and MT5.
See more

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 11-06-2005, 08:17 AM
codersguru's Avatar
Senior Member
 
Join Date: Oct 2005
Posts: 994
codersguru has a spectacular aura aboutcodersguru has a spectacular aura aboutcodersguru has a spectacular aura about
Wink Lesson 11 - Your First Indicator (Part2)

Hi folks,

I’m so sorry for the two days delay in posting my new lesson.
Here (in my country) there was a holiday (3 days). And every time I open the computer to write the lesson I hear the door ring. New visitor every 3 hours

Anyway, this is the lesson , I hope you enjoy it.
Attached Files
File Type: pdf lesson11.pdf (388.0 KB, 5801 views)
__________________
Hope it helps !
Coders' Guru
Senior MQL programmer:
www.xpworx.com/custom.htm

Last edited by codersguru; 11-09-2005 at 12:06 AM. Reason: Updated
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #2 (permalink)  
Old 11-07-2005, 08:55 AM
Administrator
 
Join Date: Sep 2005
Posts: 20,083
Blog Entries: 243
newdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud of
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 09:06 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #3 (permalink)  
Old 11-07-2005, 05:23 PM
codersguru's Avatar
Senior Member
 
Join Date: Oct 2005
Posts: 994
codersguru has a spectacular aura aboutcodersguru has a spectacular aura aboutcodersguru has a spectacular aura about
Thumbs up Great questions!

Hi newdigital,

Thank you very much for your GREAT questions.

Quote:
Originally Posted by newdigital
I have the questions.

1. You described about
#property indicator_buffer 1
Why do we need this buffer? What is it?
1- you misspelled the code #property indicator_buffers 1 (don't miss the s in buffer )
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:
Originally Posted by newdigital
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?
You are right!

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:
Originally Posted by newdigital
3. Why
double ExtMapBuffer1[] ?
Is it always ExtMapBuffer and we need just remember it?
You can use any name you want. MQL4 wizard added this array and chose this name. It's good programming practice to leave it as it.

Quote:
Originally Posted by newdigital
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 ????

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;
__________________
Hope it helps !
Coders' Guru
Senior MQL programmer:
www.xpworx.com/custom.htm
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #4 (permalink)  
Old 11-09-2005, 12:09 AM
codersguru's Avatar
Senior Member
 
Join Date: Oct 2005
Posts: 994
codersguru has a spectacular aura aboutcodersguru has a spectacular aura aboutcodersguru has a spectacular aura about
Lightbulb Lesson update!

Hi folks,

Please download the updated version of the lesson.
__________________
Hope it helps !
Coders' Guru
Senior MQL programmer:
www.xpworx.com/custom.htm
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #5 (permalink)  
Old 11-20-2005, 11:23 PM
Techguy's Avatar
Junior Member
 
Join Date: Nov 2005
Posts: 26
Techguy is on a distinguished road
Quote:
Originally Posted by newdigital

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 ????
The actually number of bars counted will be 301, correct?
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?
__________________
Kind Regards,

Techguy
Never Lose A Password

Last edited by Techguy; 11-20-2005 at 11:26 PM. Reason: Did not want to double post and I had a question
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #6 (permalink)  
Old 11-21-2005, 05:37 AM
Techguy's Avatar
Junior Member
 
Join Date: Nov 2005
Posts: 26
Techguy is on a distinguished road
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??
Attached Images
File Type: jpg barcountmystery.JPG (48.4 KB, 3015 views)
__________________
Kind Regards,

Techguy
Never Lose A Password
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #7 (permalink)  
Old 12-19-2005, 06:00 PM
Junior Member
 
Join Date: Dec 2005
Location: Portland, Oregon, USA
Posts: 7
mcintyd1 is on a distinguished road
Smile Line by Line Teaching Method

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!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #8 (permalink)  
Old 12-19-2005, 06:10 PM
codersguru's Avatar
Senior Member
 
Join Date: Oct 2005
Posts: 994
codersguru has a spectacular aura aboutcodersguru has a spectacular aura aboutcodersguru has a spectacular aura about
Lightbulb Thanks!

Quote:
Originally Posted by mcintyd1
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!
mcintyd1,

Thank you very much for your answer ! It's very helpful (& pleasant) comment.

I hope you enjoyed the lessons.
__________________
Hope it helps !
Coders' Guru
Senior MQL programmer:
www.xpworx.com/custom.htm
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #9 (permalink)  
Old 12-30-2005, 03:20 PM
Senior Member
 
Join Date: Sep 2005
Location: St Louis, MO, USA
Posts: 176
cardio is an unknown quantity at this point
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Lesson 9 - Preprocessors codersguru Lessons 8 09-04-2009 08:58 PM
Lesson 10 - Your First Indicator (Part1) codersguru Lessons 3 04-21-2009 03:52 AM
Lesson 6 - Loops & Decisions (Part2) codersguru Lessons 2 03-17-2009 07:37 PM
Lesson 12 - Your First Indicator (Part3) codersguru Lessons 25 07-27-2008 09:05 PM
Lesson 17 - Your First Script codersguru Metatrader 4 mql 4 - Development course 0 01-05-2006 12:37 AM


All times are GMT. The time now is 06:23 AM.



Search Engine Friendly URLs by vBSEO 3.2.0 ©2008, Crawlability, Inc.