Trade Close event
-
I want to create a "Pending Order" exactly whatever the "Trade close" happened.
What is the best way to do this?Example:
If my trade is closed due to Take Profit. I want to create a new Pending Order at the exact same price just like the trade that was closed. -
It depends.
-
Under "on Trade" - you can detect the event when a trade is closed and then create a new order using the same parameters of the already closed trade. But for this to work you need the EA to be working. If for some reason the EA does not work when the trade closes, that event would not be detected and nothing will happen.
-
Under "on Tick". Here you can check the count of the trades (on every tick). And when the count is let's say 0 (you can use "No trade" for example) you can open new pending order. Play with this example: http://fxdreema.com/shared/mFkUb3omd It's probably not exactly what you want, but I'm only giving you for ideas.
-
-
I got that part about using the "Trade Close" event. What I need help with is to get the parameters of the closed trade so I can use the same for opening new Pending Order.
For now..I need the the following parameters of the trade that just closed and open Pending Order with the exact same:- Open Price
- Lot Size
- Buy or Sell
- Take Profit
-
I was able to figure out everything I need with exception of the "Lot Size" I really need to find out what was the lot size of my last closed trade.
Please help me
-
this find for you last closed trade lot size:

-
Oh! Not sure how I could not see that! Thanks.