ATR Trailing Stop - Help


Hi everyone:

I have absolutely no coding experience in mq4 indicators, and am asking for help in creating an indicator. The volatility trailing stop that uses a multiple of ATR has been of great use to me in Metastock when I used to trade equities, and I've been looking for an equivalent in metatrader.

I've been using Igorad's EXCELLENT indicator VoltyChannel_Stop lately - found in this post:

and it is truly great. However, sometimes I need to enter against the trend when I get a signal and must calculate the stop manually, because the indicator hasn't yet changed over.

So, what I'm looking for are TWO consistent lines indicating the long and short stops that sit x times ATR(y), above and below the closing price. The metastock code is this:

For Long: HHV(H - 2.5*ATR(5),10)

For Short: LLV(L + 2.5*ATR(5),10)

HHV means highest high value, LLV means lowest low value

I'd like to be able to modify the ATR setting (I'm using ATR(10) now) as well as the multiplier (I'm using 2*ATR now).

Please forgive me if this indicator has already been coded somewhere and I haven't found it - or, if I am asking too much.

Much appreciation, in advance, for everything,


PS: It looks something like this, but with an upper and lower stop line (PLEASE NOTE, THIS IS NOT MY PICTURE AND THE TEXT IS NOT ASSOCIATED WITH THIS REQUEST - Whew....) :


Holy Cow, that's a lot of stuff. I'll go through them and see if there's something there that'll work.

Many thanks!



New Digital:

Again, thanks for uploading your ATR files. Unfortunately, none of the indicators can get me where I need to go. But, the ATR_SL_Chanel was close - but, I cannot figure out what the ATR setting is and what the input value represents.

In any event, if anyone reading this can code the description in the first post, I would be eternally grateful.

You'd get, maybe not my first born child, but probably one of the ones later on...




I don't know how to keep thanking you for your help. I can see your generosity has no limit - and I'm sure I speak for many, many people on these forums.

This stop indicator is great; it is similar, I think, to the volatility stop (your volty_channelstop v1) I was using. I can't seem to figure out the difference, though I know one exists. They don't exactly match up even when I've make the settings equivalent.

Again, I really appreciate all your help, now, in the past, and certainly in the future (when you'll finally tire of me...).


Igor Durkin  

Hi BoiseBoy,

Thanks for good words.

I've tried use your Stops formulas with small improvements.



A Very Public Thanks

NewDigital and Igorad:

I think I've now got everything I need to do my backtesting.

You two are great examples of people who will go out of their way to help somebody they don't even know, when they get nothing in return short of appreciation (if they are lucky).

If I ever get this trading figured out so I'm consistently profitable, I'll have people like you to thank. They say one can only get to the top by standing on the shoulders of others, and the two of you are prime examples of very broad shoulders.

Thanks again,