Thread: MQL4 Learning
View Single Post
  #124 (permalink)  
Old 07-23-2007, 06:41 PM
MQL4 MQL4 is offline
Member
 
Join Date: Jul 2007
Posts: 41
MQL4 is on a distinguished road
Quote:
Originally Posted by codersguru View Post
MODE_ASK?? who told you that the constant MODE_ASK means more than the number 10.

Well, MODE_ASK is used with the function MarketInfo to get the ask price of a currency not the one hosting the EA.

double ask =MarketInfo("EURUSD",MODE_ASK);

so, your code should be:

PHP Code:
double ask   =MarketInfo("EURUSD",MODE_ASK); 
if(
ask == 121.10)
{
    
//do whatever you want.

And about setting time to buy you can use:

PHP Code:
if (TimeHour(TimeCurrent()) == 12 &&  TimeMinute(TimeCurrent()) >= 30)
{
   
//place a buy order

The code above place an order at 12:30 PM
Thank You guys for Your kind help.
Reply With Quote