ATR change of direction code

 
Hi, I'm trying to code (mql4) a change of direction on the ATR as part of the conditions to enter a trade. Could someone please point me in the right direction ? TIA
 
In future please post in the correct section
I will move this topic to the MQL4 and Metatrader 4 section.
 
Matthew Williams: 'm trying to code (mql4) a change of direction on the ATR

ATR is an average distance price moved per candle, (true range) There is no direction. What is the direction of the size of your screen?

 
Keith Watford:
In future please post in the correct section
I will move this topic to the MQL4 and Metatrader 4 section.
Apologies
 
William Roeder:

ATR is an average distance price moved per candle, (true range) There is no direction. What is the direction of the size of your screen?

Let me try and be more specific. The change of direction of the line in the indicator window, from pointing down to up or visa versa.
 
Matthew Williams: Let me try and be more specific.

And your problem is?

 
Matthew Williams:
Let me try and be more specific. The change of direction of the line in the indicator window, from pointing down to up or visa versa.

You mean if it's increasing or decreasing?

Just compare previous offset values... so:

iATR(NULL, 0, 12, 1) > iATR(NULL, 0, 12, 2) is increasing

iATR(NULL, 0, 12, 1) < iATR(NULL, 0, 12, 2) is decreasing 

 
iRick:

You mean if it's increasing or decreasing?

Just compare previous offset values... so:

iATR(NULL, 0, 12, 1) > iATR(NULL, 0, 12, 2) is increasing

iATR(NULL, 0, 12, 1) < iATR(NULL, 0, 12, 2) is decreasing 

Thank you. That's exactly what I was looking for.
Reason: