Trailing stop in negative trades

 

Its there a way to set a Trailing stop to a negative trade? 

I have an EA that opens trades at a specific time, the trailing stop code works if the trade is in profit however if the trade is negative it never set the SL/TS 

The idea is for the EA to set a SL based on the current price and then trigger the trailing stop however its not working, any ideas?

I'm coding in MQL4

 
Jeff Beclinton: Its there a way to set a Trailing stop to a negative trade? I have an EA that opens trades at a specific time, the trailing stop code works if the trade is in profit however if the trade is negative it never set the SL/TS. The idea is for the EA to set a SL based on the current price and then trigger the trailing stop however its not working, any ideas? I'm coding in MQL4

Just set the Stop-Loss and Take-Profit at the same time you place your order. Find examples in the CodeBase that do something similar and study how they work.

 
Fernando Carreiro #:

Just set the Stop-Loss and Take-Profit at the same time you place your order. Find examples in the CodeBase that do something similar and study how they work.

Hi Fernando, that’s an option however the idea is to trigger a trailing stop even if it’s negative, that way in high impact events it can secure profits, simply putting a SL and TP would not cut it
 
Jeff Beclinton #:
Hi Fernando, that’s an option however the idea is to trigger a trailing stop even if it’s negative, that way in high impact events it can secure profits, simply putting a SL and TP would not cut it

Please explain how a trailing stop on a losing trade will secure any profit.

Please explain how a trailing stop on a losing trade is supposed to work.

 
Jeff Beclinton #: Hi Fernando, that’s an option however the idea is to trigger a trailing stop even if it’s negative, that way in high impact events it can secure profits, simply putting a SL and TP would not cut it
Explain in more detail and show your code.
 
Keith Watford #:

Please explain how a trailing stop on a losing trade will secure any profit.

Please explain how a trailing stop on a losing trade is supposed to work.

Ok let me explain in detail, there are two parts of this equation: 
1 set a SL based on the current price (i.e 10 pips from the price) this case should trigger only if the trade is negative, otherwise (trade in profit) it should trigger a trailing stop, let me know if this helps
 
Keith Watford #:

Please explain how a trailing stop on a losing trade will secure any profit.

Please explain how a trailing stop on a losing trade is supposed to work.

Jeff Beclinton #:
Ok let me explain in detail, there are two parts of this equation: 
1 set a SL based on the current price (i.e 10 pips from the price) this case should trigger only if the trade is negative, otherwise (trade in profit) it should trigger a trailing stop, let me know if this helps

That doesn't really explain anything

 
Jeff Beclinton #: Ok let me explain in detail, there are two parts of this equation: 1 set a SL based on the current price (i.e 10 pips from the price) this case should trigger only if the trade is negative, otherwise (trade in profit) it should trigger a trailing stop, let me know if this helps

That is a standard Stop-Loss applied when the order is placed and a standard Trailing-Stop once the position is in profit (in which the original Stop-Loss is modified to a new one).

There are many examples of that in the CodeBase, which you can study to see how it is done.

If you want more help, show your attempt at coding it.

 
Fernando Carreiro #:

That is a standard Stop-Loss applied when the order is placed and a standard Trailing-Stop once the position is in profit (in which the original Stop-Loss is modified to a new one).

There are many examples of that in the CodeBase, which you can study to see how it is done.

If you want more help, show your attempt at coding it.

Thanks I’ll review the codes
Reason: