Thread: MQL4 Learning
View Single Post
  #108 (permalink)  
Old 07-23-2007, 05:45 PM
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
Wink

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


Quote:
Originally Posted by MQL4 View Post
I spent many hours, and I cannot solve the problem to this code:

if (MODE_ASK==121.10)
{
ticket=OrderSend(Symbol()..............


I want the USD\JPY to trigger a buy at this point. What's wrong with this code?

Also, can someone tell me a code syntax that will trigger a buy at a certain time?

Thank You. God bless You.
__________________
Hope it helps !
Coders' Guru
Senior MQL programmer:
www.xpworx.com/custom.htm
Reply With Quote