Trailing Stop EA for PENDING orders

 

I've seen various trailing stop EA's here but I haven't yet seen any that will work with a pending order. For example, before going to bed I place a pending order. During the night that order is opened so I would want the trailing stop to work from that point without any intervention from me.

Has anyone coded this ?

 
rjay:
I've seen various trailing stop EA's here but I haven't yet seen any that will work with a pending order. For example, before going to bed I place a pending order. During the night that order is opened so I would want the trailing stop to work from that point without any intervention from me. Has anyone coded this ?

Do not need to code it I think.

Most of the trailing stop EAs are trailing any opened order opened by you or opened from pending order).

 
 

Need help: Trailing for Pending Order...

Hi guys,

I am looking for some code that runs on Metatrader 4 that performs trailing for a pending order?

The reason is this: if you want to be a good trader you need to have certain skills. One of these skills is knowing when to enter a trade into

which direction. Another skill is to use the right money management.

A third skill is how to 'rescue' a bad trade. I know how to do this, but it requires a lot of manual attention and time.

Suppose I have a bad trade, let's say I entered a sell, and for whatever reason, the trend reversed and I didn't get out, and now I have a -200 pips situation. It's bad and I should have gotten out earlier, but hey, that's not the point. The question is what do you do?

One of the options is to place a hedge (opposite) trade. This gives me time and it prevents getting a margin call.

If fact you kind of 'freeze' the situation.

If the trend continues into the wrong direction, the bad trade gets worse and the hedge trade gains the same amount of pips.

But the gap between both trades of 200 pips plus the spread from the hedge trade stays the same. So you're not solving anything here, it's just a way to temporarily freeze the situation.

So if the trend continues, I do nothing (at least for a while).

But if the trend reverses I want the hedge trade to exit just before it's break even point, lets say 1 or 2 pips still in gain.

Immediately after exiting the hedge trade, I enter a new PENDING hedge trade, in this example a pending buy stop order.

Let's say at the current price (where the first hedge exited) PLUS 15 pips (because I don't want it to execute too fast)

If the trend continues down, I want the entry price of this pending hedge trade to trail down with it.

Every pip the price drops, the entry price must drop too.

This way if the trend keeps going down, the bad trade gets smaller and eventually exitst at let's say, 0 pips profit. (the escape value).

And when this happens, the pending hedge trade must be exited too.

If the trend however reverses again at some point and goes up again (most of the time it does), the pending order will be executed at a certain price and hedge the bad trade again... untill this second hedge trade also drops back to say 1 or 2 pips profit.

And when this 2nd hedge trade exits again, a new pending hedge trade must be entered and trail down...

and so on, and so on.

So eventually with price moving up and down this trailing of a pending order will make the pip gap between the bad trade and the hedge trade smaller and smaller, untill both trades are gone or you exit them at a reasonable level. Remember it's a rescue action!

As I told before, it works but it takes a lot of time, since I have never found an EA or something else that does this for me. And since timing is essential, it would be VEEERY handy to have this rescue strategy in some code that handles this.

So here's the question, who can and is willing to help me create this trailing pending order EA?

Maurice

 

I moved your post to this thread.

Also - read this thread:

https://www.mql5.com/en/forum/174885

Reason: