hi guys im trying to create a stratergy where given a set of conditions becomes true in the current bar. i place a pending order.But if this pending order does not get triggered in the next following bar i want to cancel the trade.at the moment im struggling to come up with a solution for deleting the trade if it does not get triggered in the following bar. can any one help me out here
datetime timeValuePerBar= Period() * 60;
ClosePendingOrder(Symbol(),CurrentTicket) // user defined function
ok i have come up with this can RaptorUK or any one else kindly verify this code. im assuming that OrderOpenTime() and Time returns the time in seconds
Yes they do . . to be specific . . Date & Time functions "A group of functions providing the working with data of the datetime type (integer representing the amount of seconds elapsed from midnight, 1 January, 1970)."
Your code looks OK but doesn't do exactly what you said in your first post . . . ".But if this pending order does not get triggered in the next following bar" you code will potentially close an order during the following bar.
You don't need a user defined function, just do this . . .