080781:
Hie Guys,
May anyone help, I would like to code a Line that Closes/Deletes a Pending order,
if not triggered, after a certain period of time (say 20 seconds). I have inserted question marks (?????)
in the code below, indicating where I would like to insert the line.
<CODE REMOVED>
Please read some other posts before posting . . .
Please edit your post . . . please use the SRC button to post code: How to use the SRC button.
080781:
Check it's OrderType() to make sure it is a pending order that you are going to try and close . . . then check it's OrderOpenTime() against TimeCurrent() . . . 20 seconds is too short, sometimes there can be no ticks for more than 20 seconds, what then ?
Hie Guys,
May anyone help, I would like to code a Line that Closes/Deletes a Pending order,
if not triggered, after a certain period of time (say 20 seconds). I have inserted question marks (?????)
in the code below, indicating where I would like to insert the line.
and how far do you think the market moves is 20 seconds? You can't place a pending order too close to the market.
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hie Guys,
May anyone help, I would like to code a Line that Closes/Deletes a Pending order,
if not triggered, after a certain period of time (say 20 seconds). I have inserted question marks (?????)
in the code below, indicating where I would like to insert the line.
//-----
OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
if(OrderSymbol() == symbol && OrderMagicNumber()==Magicbuy)
{
if ( ???????????) // checks if 20 seconds has elapsed since opening order.....
{
OrderDelete(order_ticket);
return(0);
}
//-----
Thank you...