Herlequin
Junior Member

Posts: 5
Registered: 18-12-2007
Member Is Offline
Mood: Pov
|
|
posted on 19-11-2008 at 04:23 AM
|
|
|
coding problem - i hate code
Hi guys,
Hoping someone can help me with this.
i am looking for some code but have been unable to find it anywhere. i want to take the last 5 days of price action and get the difference between the
open and close as a real number.
so if the open is 2.00 and the close is 1.97 the difference is 3.
Look forward to your assistance.
|
|
|
roach
Junior Member

Posts: 95
Registered: 4-9-2004
Location: VIC Australia
Member Is Offline
|
|
posted on 19-11-2008 at 09:42 PM
|
|
|
I cannot provide any code but ,suggest using the REF function and probably the Absolute function. Possibly:
Value = ABS(Ref(O, 5)- C)
The ansolute value of the Open 5 days ago - the close of today.
|
|
|
Herlequin
Junior Member

Posts: 5
Registered: 18-12-2007
Member Is Offline
Mood: Pov
|
|
posted on 20-11-2008 at 01:53 AM
|
|
|
Thanks Roach that is a great starting point.
|
|
|
rsb_44
Junior Member

Posts: 8
Registered: 14-11-2005
Member Is Offline
|
|
posted on 10-12-2008 at 03:35 AM
|
|
|
Do you want to get the difference of the open of 4 days ago and the close of the current bar?
The open of 4 days ago is
ref(O,-4)
The close of the current bar is C
The directed difference is
C-ref(O,-4)
otherwise
ABS(C-ref(O,-4))
4 bars >ago< plus the current bar gives a total of 5 bars.
In your example 2.00-1.97 is .03
|
|
|