## Difference

Here you can post and download custom indicators. PLEASE: Do not start topics unless you are posting your own indicator, they will be moved to appropriate section even if you do.

### Difference

This simple indicator will show the difference from the current period,
and period N periods ago.
The value can be displayed in absolute value.
Difference.lua

Anchor difference.lua

MQ4/MT4 version.
viewtopic.php?f=38&t=64838

Apprentice
FXCodeBase: Confirmed User

Posts: 27499
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

### Re: Difference

The indicator was revised and updated.

Apprentice
FXCodeBase: Confirmed User

Posts: 27499
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

### Re: Difference

Hi,

Very useful indicator indeed. Thanks for that.

One question. Is it possible to use this custom indicator in a strategy?

Regards
Jeremie
Remie9

Posts: 2
Joined: Tue May 30, 2017 4:55 pm

### Re: Difference

Sure, can you specify the entry / exit rules.

Apprentice
FXCodeBase: Confirmed User

Posts: 27499
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

### Re: Difference

Apprentice
FXCodeBase: Confirmed User

Posts: 27499
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

### Re: Difference

Very good job, thank you. Is it possible to integrate option for calculation of difference between actual value and value at defined fixed point? Thank you.
asedic

Posts: 8
Joined: Tue Jan 20, 2015 7:00 am

### Re: Difference

Sure.
"Defined fixed point", can you give me an example?
Is it defined by the user?

Apprentice
FXCodeBase: Confirmed User

Posts: 27499
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

### Re: Difference

Thank you for fast response, I really appreciate your work.

If we define formula in existing indicator as diff=A1-A2, A1 is actual value, and A2 is value N period ago. Value of A1 and A2 are continuously changing in time, but number of time periods is fixed.

I am interested in difference diff = A1-C where value of C is constant and corresponds to value in some fixed time point, let say at 9:00 am (market opening or any other interesting point ...), and does not change in time.

Maybe definition of fixed time point is problem. In that case integration of option to put constant value manually and calculation of difference between actual value and this constant would be very good solution.

Thank you.
asedic

Posts: 8
Joined: Tue Jan 20, 2015 7:00 am

### Re: Difference

Try Anchor difference.

Apprentice
FXCodeBase: Confirmed User

Posts: 27499
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

### Re: Difference

Thank you.
asedic

Posts: 8
Joined: Tue Jan 20, 2015 7:00 am