Forex



Go Back   Forex Trading > Training > Metatrader > Metatrader 4 mql 4 - Development course > Lessons
Forex Forum Register More recent Blogs 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 12-01-2005, 06:42 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
Wink Lesson 14 - Your First Expert Advisor (Part 2)

Hi folks,

Welcome to the second part of creating Your First Expert Advisor lesson.
In the previous part we have taken the code generated by the new program wizard and added our own code which we are going to crack it today line by line.

Did you wear your coding gloves? Let’s crack.

Note: I have to repeat that our expert advisor is for educational purpose only and will not (or aimed to) make profits.

Why don't download the lesson and enjoy it (I hope)?
Attached Files
File Type: pdf Lesson14.pdf (88.4 KB, 6184 views)
__________________
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
  #2 (permalink)  
Old 12-01-2005, 08:12 PM
Junior Member
 
Join Date: Nov 2005
Posts: 4
fubifx is on a distinguished road
finally the part 2 is out, thank you very much.
have been waiting for a life time
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 12-01-2005, 10:11 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
Talking Sorry!

Quote:
Originally Posted by fubifx
finally the part 2 is out, thank you very much.
have been waiting for a life time
fubifx,

I'm so sorry for the delay.
I have a damn car that I spent the most of my time repairing it.

If you lend me your car, maybe I write the lesson everyday
__________________
Hope it helps !
Coders' Guru
Senior MQL programmer:
www.xpworx.com/custom.htm

Last edited by forexts; 12-01-2005 at 10:38 PM.
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 12-02-2005, 03:17 AM
Member
 
Join Date: Nov 2005
Posts: 48
barry is on a distinguished road
Error and Question

Quote:
Stop losses points are always set above the current asking price on a buy or below the current bid price on a sell.
I believe that should be "Stop losses are always set BELOW the current bid price on a buy and ABOVE the current asking price on a sell"

Question: Why is the line
Code:
int Crossed (double line1 , double line2)
positioned where it is, i.e., after the expert deinitialization function and before the expert start function?

Thanks again for a great course!
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 12-02-2005, 11:53 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
Smile Thanks!

Quote:
Originally Posted by barry
I believe that should be "Stop losses are always set BELOW the current bid price on a buy and ABOVE the current asking price on a sell"
Hi Barry,

You are right! I'll change that.

Quote:
Originally Posted by barry
Question: Why is the line
Code:
int Crossed (double line1 , double line2)
positioned where it is, i.e., after the expert deinitialization function and before the expert start function?
Thanks again for a great course!
int Crossed (double line1 , double line2)

The above line is the function declaration
It means we want to create Crossed function which takes two double data type parameters and returns an integer.

When you call this function you have to pass to it two double parameters and it will return an integer to you.

Code:
 shortEma = iMA(NULL,0,8,0,MODE_EMA,PRICE_CLOSE,0);
   longEma = iMA(NULL,0,13,0,MODE_EMA,PRICE_CLOSE,0);
   
   int isCrossed  = 0;
   isCrossed = Crossed (shortEma,longEma);
You have to declare the function before using (calling) it. The place of the function doesn't matter, I placed it above start() function, but you can place it anywhere else.
__________________
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
  #6 (permalink)  
Old 12-11-2005, 04:37 AM
Member
 
Join Date: Dec 2005
Posts: 35
zhu28ming is on a distinguished road
Can we download all the lessons?

Thanks al lot
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-13-2005, 12:29 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
Arrow All the lessons

Quote:
Originally Posted by zhu28ming
Can we download all the lessons?

Thanks al lot
zhu28ming,

You will find a list with all the lessons here:
http://www.forex-tsd.com/showpost.ph...6&postcount=20
__________________
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
  #8 (permalink)  
Old 05-01-2006, 04:59 PM
Member
 
Join Date: Mar 2006
Posts: 33
dr_richard_gaines is on a distinguished road
Indicators into Experts

Hi
Code Guru

How do we make a indicator into a expert ?

Doc
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 06-09-2006, 05:41 PM
Junior Member
 
Join Date: Jun 2006
Posts: 1
iincome is on a distinguished road
Question Some fundamental questions

The program is running all the time? i mean so i can save the info in an array between every tick?

And the "int start()" function runs once for every tick?


Thanks in advance iincome
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
  #10 (permalink)  
Old 06-20-2006, 01:04 AM
Junior Member
 
Join Date: Jun 2006
Posts: 2
BoDar is on a distinguished road
How to add arrows to Expert Advisor?

Please for the help: how to add to Expert Advisor pointers (arrows) showing coming into being of trading conditions (but not the concrete transaction!). This would be very useful for the purpose of the visual presentation of the rightness of the prompt from the EA under of tests before transactions.

I know that one can add pointers to indicators using code:

//---- indicator line
IndicatorBuffers(2);
SetIndexStyle(0,DRAW_ARROW);
SetIndexArrow(0,233);
SetIndexStyle(1,DRAW_ARROW);
SetIndexArrow(1,234);
........
But what to make, if EA uses with several indicators. Then pointers would be added to EA code. Please for the help how can I make this.
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
CCI Expert Advisor rodrigokaus Expert Advisors - Metatrader 4 26 07-20-2009 06:36 AM
Lesson 13 - Your First Expert Advisor (Part 1) codersguru Lessons 21 02-07-2009 11:52 AM
Lesson 16 - Your First Expert Advisor (Part 4) codersguru Lessons 16 10-05-2006 06:42 AM
Lesson 15 - Your First Expert Advisor (Part 3) codersguru Lessons 5 12-27-2005 11:00 PM


All times are GMT. The time now is 08:48 AM.



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