View Single Post
  #5 (permalink)  
Old 12-02-2005, 10:53 AM
codersguru's Avatar
codersguru codersguru is offline
Senior Member
 
Join Date: Oct 2005
Posts: 987
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
Reply With Quote