Download MetaTrader 5

How to open new order or pending order immediately?

To add comments, please log in or register
jurcekmpt
592
jurcekmpt  

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
10372
Keith Watford  

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
592
jurcekmpt  
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
15331
whroeder1  
  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
592
jurcekmpt  
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
592
jurcekmpt  
Anyone?
whroeder1
15331
whroeder1  
Asked and answered
jurcekmpt
592
jurcekmpt  
Sorry but I don't understand. Can you be more precise? Thank you!
whroeder1
15331
whroeder1  
01005379: Sorry but I don't understand. Can you be more precise? Thank you!
What part of "Enable the timer" is unclear?
jurcekmpt
592
jurcekmpt  
Can you put up some code? I would like to know how to use this function. Thank you.
jurcekmpt
592
jurcekmpt  
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