EA_based Trailing Stop - page 14

 
Gfuchs:
Ok. How can I find out what is allowed by the broker?

That is done using MarketInfor(Symbol(),MODE_STOPLEVEL) function

 
mladen:
That is done using MarketInfor(Symbol(),MODE_STOPLEVEL) function

Thanks Mladen, is that meant to be used in a script file? If so, can you please help me with that as I am not a coder.

 
Gfuchs:
Thanks Mladen, is that meant to be used in a script file? If so, can you please help me with that as I am not a coder.

Gfuchs

That willl be the way how it will control the minimal distance of the trailing stop loss

 
mladen:
Gfuchs That willl be the way how it will control the minimal distance of the trailing stop loss

Hi Mladen, any news about this issue?

 
mladen:
An update of the EMATrailingStop EA

__________________________

Changes :
It can monitor all the symbols or just the symbol it is attached to. If TrailAllSymbolsoption set to true it will trail all the symbols (regardless of the symbol it is attached to - you can freely jump between symbols, it will not change the way it is working), if set to false, it will trail only the symbol it is attached to

It can monitor stopLoss less EAs. With magicNumber.from and magicNumber.to you "regulate" which magic numbers should it trail (magic number 0 are usually only manual trades, so if you include 0 it will monitor and trail manual trades along with chosen magic numbers)

It can close monitored trades when certain profit is reached. When CloseWhenProfitis set to > 0, it starts "profit monitoring" and if the total profit for trades it takes care of exceeds CloseWhenProfitit will close all those trades

It can trail trades that are "in profit" or every trade. if TrailOnlyInProfitis set to true, it will trail only those trades that are already in positive profit, otherwise it will traill all the trades

__________________________

One more new feature is the regulated with the showMessagesoption : if set to true it will show messages like those on the right lower side of the picture (as you can see you do not have to be at the chart where you symbols of interest are), otherwise messages are going to be redirected to journal tab

Rest of the parameters did not change and they have the same meaning as in previous version.

Finally able to find this equivalent MA trailstop after a tremendous search .

Hi mladen,

Could you or anyone please explain the following question? :

The trailstop stops when the price hits or closed below the ema? For example, I'm long and the ema is below the price, does it close the position when it hit the ema or the price has to close below the ema? Assuming TrailOnlyInProfit is set to false.

Possible to add another parameter of pips buffer (number of pips away from the ema before stop) rather than close a position immediately when ema hits? For example, I'm long and the ema is below the price, rather than closing the position when it hits the ema, I would like to have a number of "x" pips below the ema before stop takes place in order to avoid any sudden spike.

Thank you,

 
pastecopy:
Finally able to find this equivalent MA trailstop after a tremendous search .

Hi mladen,

Could you or anyone please explain the following question? :

The trailstop stops when the price hits or closed below the ema? For example, I'm long and the ema is below the price, does it close the position when it hit the ema or the price has to close below the ema? Assuming TrailOnlyInProfit is set to false.

Possible to add another parameter of pips buffer (number of pips away from the ema before stop) rather than close a position immediately when ema hits? For example, I'm long and the ema is below the price, rather than closing the position when it hits the ema, I would like to have a number of "x" pips below the ema before stop takes place in order to avoid any sudden spike.

Thank you,

Which will take precedence when the following settings are set?

TrailOnlyInProfit = False

Initial Stop = 16

If TrailOnlyInProfit set to false, it will trail the ema immediately however I had set Initial Stop @ 16pip. Which one will take precedence? Thank you

Files:
picture1.png  160 kb
 
pastecopy:
Finally able to find this equivalent MA trailstop after a tremendous search .

Hi mladen,

Could you or anyone please explain the following question? :

a) The trailstop stops when the price hits or closed below the ema? For example, I'm long and the ema is below the price, does it close the position when it hit the ema or the price has to close below the ema? Assuming TrailOnlyInProfit is set to false.

b) Possible to add another parameter of pips buffer (number of pips away from the ema before stop) rather than close a position immediately when ema hits? For example, I'm long and the ema is below the price, rather than closing the position when it hits the ema, I would like to have a number of "x" pips below the ema before stop takes place in order to avoid any sudden spike.

Thank you,

Please ignore a) as I had found the answer already.

 
pastecopy:
Please ignore a) as I had found the answer already.

for b) that is just one case. You would have the iinverse when you have a sell order. I think it is best to keep that EA as is

 
mladen:
for b) that is just one case. You would have the iinverse when you have a sell order. I think it is best to keep that EA as is

Hi mladen,

Yes, for sell order, it will be the other way round, and the pip buffer will be "x" pips above the ema. Tried on various ema combination with shift to emulate "x" pips buffer away from the intended ema but still to no avail. Possible to add this additional parameter?

thank you,

 

Upgraded version of ema trailing stop EA compatible with the latest builds : ematrailingstop_v1.401_nmc.mq4

________________________

There is already a nmc version at this thread, but in newer build they have changed some things and some code changes were necessary to avoid some compiler warnings - unfortunately that is the thing the we probably must get used to since they are still changing the new mql coding language and forcing us to rewrite the code over and over