
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
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.
|