Download MetaTrader 5

How to open new order or pending order immediately?

To add comments, please log in or register
jurcekmpt
489
jurcekmpt 2014.03.13 18:04 

Hello!

I would like to know if it is possible to open order immediately and not waiting for new tick?

Thank you!

Keith Watford
Moderator
9640
Keith Watford 2014.03.13 23:59  

Yes.

Use the New Order button on the platform

Code in a script

On ChartEvent in an EA ?? (I've not used this function yet)

jurcekmpt
489
jurcekmpt 2014.03.14 16:05  
if(...){
OrderSend(Symbol(),OP_SELLSTOP,....);
}
I have this code, but there has to be price change to open new order. Is there a way to open order immediately (without price change)?
whroeder1
14753
whroeder1 2014.03.14 16:22  
  1. Enable the timer and open when you want
  2. I don't understand your problem. It it wasn't time to open on the last tick, why is it time to open now "without price change?"
jurcekmpt
489
jurcekmpt 2014.03.14 18:11  
if(Seconds()>=55 && Seconds()<=59){
  OrderSend(Symbol(),OP_SELLSTOP,1.0,Bid,5*places,0,0, "EA",MagicNumber,0,Red);
}
I want to place order between 55 and 59 second. Problem is if there is no price change EA does not place order. How can I solve this problem?
jurcekmpt
489
jurcekmpt 2014.03.15 16:31  
Anyone?
whroeder1
14753
whroeder1 2014.03.15 16:51  
Asked and answered
jurcekmpt
489
jurcekmpt 2014.03.15 17:00  
Sorry but I don't understand. Can you be more precise? Thank you!
whroeder1
14753
whroeder1 2014.03.15 18:08  
01005379: Sorry but I don't understand. Can you be more precise? Thank you!
What part of "Enable the timer" is unclear?
jurcekmpt
489
jurcekmpt 2014.03.15 20:54  
Can you put up some code? I would like to know how to use this function. Thank you.
jurcekmpt
489
jurcekmpt 2014.03.16 10:52  
int init()
{
   if (IsExpertEnabled() == true)
   {
      while (true)
      {
         //------My code here---
         Sleep(1000);
      }
   }
   return(0);
}

int start()
{
   return(0);
}
Will this run EA every second even if there is no new tick?
123
To add comments, please log in or register