EA_based Trailing Stop - page 6

 
 

Modify EMA Trailing Stop EA

The EMA Trailing Stop EA that is attached works great but can somebody please modify it so that it adds or subtracts the spread to the TS price.

I like using the EMA as a stop but hate when it just barely touches or doesn't even get to the EMA and it closes the trade because of the spread.

Thank you in advance!

Files:
 
 
OlisFX:
Hey everyone,

-You close the position at 1.5050. You earn 50 pips or about $500. (A pip is the smallest price movement available in a currency).

Say I make that trade and profit $500 dollars, how does this translate into what I actually have? Because it seems very unlikely that I would make $500 on my initial $1,500 investment.

Thanks for the help!

Yes, you actually do make $500 in your account, but remember the reverse is also true. Your account could wipe out very quickly as well.

 

EMA TrailingStop SETUP parameters

Can the developer, or any competent person, explain the meaning and use of oll the EA parameters, please?

It's reallly a vital tool to control all those EAs which don't have a good position management. Thanks to all the contributors, you are great!

ad maiora

 

Hi NewsRe,

This EA?

post #26 https://www.mql5.com/en/forum/175843/page2

All the parameters are explained on this thread.

About this parameters:

EMATimeFrame = 0; (timeframe of MA indicator - just attach it on the chart as EMA and see)

Price = 0; (parameter of EMA indicator: Close - 0, Open - 1, High -2, Low -3, and so on)

EMAPeriod = 13; (parameter of indicator used for trailing stop)

EMAShift = 2; (parameter of indicator)

InitialStop = 100; (initial stop you selected for your trades)

magicNumber.from = 0; (it will process/trail all the trades having magic number from:

magicNumber.to = 0; (to: ..)

Just attach MA indicator as EMA and you will see those parameters.

How it works - see original request of ValeoFX - post #1 of this thread.

As to new paratements

TrailAllSymbols = true;

TrailOnlyInProfit = false;

CloseWhenProfit = 0.0;

showMessages = true;

so they are understandable - look on the explanation at the post #26 https://www.mql5.com/en/forum/175843/page2

How it works - see original request of ValeoFX - post #1 of this thread.

Files:
ma_ma.jpg  113 kb
 

Clarification

newdigital:
Hi NewsRe,

This EA?

post #26 https://www.mql5.com/en/forum/175843/page2

All the parameters are explained on this thread.

About this parameters:

EMATimeFrame = 0; (timeframe of MA indicator - just attach it on the chart as EMA and see)

Price = 0; (parameter of EMA indicator: Close - 0, Open - 1, High -2, Low -3, and so on)

EMAPeriod = 13; (parameter of indicator used for trailing stop)

EMAShift = 2; (parameter of indicator)

InitialStop = 100; (initial stop you selected for your trades)

magicNumber.from = 0; (it will process/trail all the trades having magic number from:

magicNumber.to = 0; (to: ..)

Just attach MA indicator as EMA and you will see those parameters.

How it works - see original request of ValeoFX - post #1 of this thread.

As to new paratements

TrailAllSymbols = true;

TrailOnlyInProfit = false;

CloseWhenProfit = 0.0;

showMessages = true;

so they are understandable - look on the explanation at the post #26 https://www.mql5.com/en/forum/175843/page2

How it works - see original request of ValeoFX - post #1 of this thread.

Thanks newdigital for your complete explanation.

I'd like to submit though a couple of cases:

1) if I place EMA-TS to control SL of positions which are already managed by OTHER EAs that set the SL, how the InitialStop works/should be set? Is there any conflict between the two EAs af far as the SL is coincerned?

2) if I enable EMA-TS with TrailOnlyInProfit = false, how the SL will be actually managed? i.e. when will it be moved, and how much?

I noticead that the smaller is the TimeFrame the more reactive is the Trailing move (since it changes at every Close of bar), while the shorter is the EMAPeriod and the more sentitive is the EA. Have you any experience on what is the best TF/Period to be used?

All the best and thanks for your great contribution to our success.

 

1) I do not know sorry.

2) Stop loss is moved according to the lines of EMA indicator. Just attach indicator to the chart (Moving Averages is default indicator in metatrader), select indicator's settings (use my image on some previous post about how to do it), and select same settings/parameters in EA. And stop loss should be moved by indicator line.

If TrailOnlyInProfit = true so stop loss will be moved only if trade is in profit.

If false so it will be moved from the beginning (according to the line of MA indicator in EMA mode).

You do not need to attach indicator to the chart. Just attach EA only. I when I used EA - I attached indicator to the chart too just to see how and why the stop loss was moved (by the line of MA indicator).

 

You mean: indicator/EA/script to place horizontal lines on ypour stop loss level with with text about how many pips?

No I did not see ...

I think - it should be coded inside your EA which you are using for trading/stop loss.

or try to find here something similar:

Vertical/horizontal indicators (support/resistance, trading time, min/max or any):

- Two vertical lines indicator is on this thread.

- Alarm Custom Indicator For Horizontal Lines is here.

- Vertical Horizontal Filter (VHF): indicator is here (elite section).

- how to draw vertical/horizontal lines manually in MetaTrader: original thread is here.

- TradeTime_v2 indicator is here.

- TradeTime_v2a indicator with 'dead-zone' option (useful if you trade futures) is on this post.

- MktOpen: this indicator is drawing vertical lines on specific time or in market open sessions.

- 3@S & R Simple: the script to draw support/resistance horizontal lines.

- Reliable Trendlines: elite section thread with many trend lines or support/resistance lines indicators.

- MaksiGen_Range_Move: the indicator as part of MaksiGen Trading system; it drawing horizontal trend line and support/resistance lines, also - breakout lines. The same indicator with alarm is here.

- support/resistance for candles: original thread with discussion and some indicators.

- breakout indicators: the indicators are drawing horizontal lines on possible breakout levels.

- grid lines: the thread.

- disketmadu_LINES: horizontal lines indicator.

- BreakOut indicator: good indicator from cja

- daily_open_line indicator: very good indicator that draws a horizontal line from the opening price of the day. Good for traders who missed daily bar opened.

- Daily Open-SR Technique: interesting thread with some good indicators.

- WhitewaterLevels and WhitewaterLevels v Open indicators: this thread.

 

Stop loss line which calculates the distance between itself and current market price.

Hello newdigital,

I'm looking for a script, EA or an indicator which shows the distance between a horizontal line which either we put on the chart the script, EA itself puts on chart. Have you seen such thing anywhere? I've looked around forums but only I could find visual tp sl editors. I've even tried to edit some indicators but unsuccessful because I'm not a coder.

This will help me in my money management. If I drop a horizontal line on the chart and put it where my stop loss will be and text or label beside it shows what is the distance between this line and the current market price, I'll then quickly adjust my position size based on %risk and as soon as new candle opens I'll click buy or sell.

I've an EA (see picture) which shows the sl and tp of my orders (and can edit them by moving the line visually on chart) in pips. This is useful but what I want is the opposite. I want to put a horizontal line and the number above it shows the current live distance between the line and current market price in pips and I want this number updated with every market tick change, in other words I want it to be live.

Do you know any indicator or EA around that can do this simple thing? I'd be grateful if you or someone in forum can help me.

Files:
Reason: