if (Time[0])// if a new candle is formed on any TF(but I need five minutes) int Ticket = OrderSend(Symbol(),OP_BUYSTOP,0.1,Price,3,SL,TP ); // set a pending order at a distance of 30 p. from the opening price of the last, i.e. current five-minute price if (TimeCurrent( )+300)// if upon expiry of the current five-minute candle, the pending order has not transformed into a market order OrderDelete(Ticket)//delete this pending order
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Every brokerage house has its own "minimum lifetime" for a pending order. That's why it doesn't give on 5 minutes.
How can I use iFractals() to always have the latest High and Low values for LOS?
I.e. it is necessary to have actual StopLoss_SELL and StopLoss_BUY.
The compiler is picking on the very last curly bracket - it says '}'. - unbalanced parentheses
What does it mean.... I removed it, added a third one, moved it to the right, to the left.
What does it want?
int start()
{
double Price=Ask+300*Point;
double SL=Price-300*Point;
double TP=Price+150*Point;
if (Time[0])
int Ticket = OrderSend(Symbol(),OP_BUYSTOP,0.1,Price,3,SL,TP );
if(TimeCurrent( )+300)
OrderDelete(Ticket)
}
}
Can you tell me if it is possible to paint the body of the desired candle in the EA?
You can
Tell me how, please.
Trying to delete a pending order after 5 minutes if it has not converted to a market order.
At first I tried to do it via passed parameter.
I.e. expiration = 300 OrderSend(Symbol(),OP_BUYSTOP,0.1,Price,3,SL,TP, "SUDF",237,TimeCurrent( )+300) - It didn't work.
It was explained to me that my brokerage company may have a limit for a minimum lifetime of a pending order.
Then I tried to remove it another way
int start()
{
double Price=Ask+300*Point;
double SL=Price-300*Point;
double TP=Price+150*Point;
if (Time[0])
int Ticket = OrderSend(Symbol(),OP_BUYSTOP,0.1,Price,3,SL,TP );
if (TimeCurrent( )+300)
OrderDelete(Ticket)
}
still not deleted..... the same restriction must be in effect.
Please tell me how I can delete a pending order at the beginning of a 5 minute window after 5 minutes if it has not changed into a market order.
Please tell me how to delete a pending order after 5 minutes if it has not transformed into a market order.
if (Time[0])
if (TimeCurrent( )+300)
Explain the purpose and meaning of these lines, please (according to the language rules they are always true)
double Price=Ask+300*Point;
double SL=Price-300*Point;
double TP=Price+150*Point;
if (Time[0])// if a new candle is formed on any TF(but I need five minutes)
int Ticket = OrderSend(Symbol(),OP_BUYSTOP,0.1,Price,3,SL,TP ); // set a pending order at a distance of 30 p. from the opening price of the last, i.e. current five-minute price
if (TimeCurrent( )+300)// if upon expiry of the current five-minute candle, the pending order has not transformed into a market order
OrderDelete(Ticket)//delete this pending order
}
Thank you.