Stock Meeting Place Last active: Never
Not logged in [Login - Register]
Go To Bottom

Printable Version
Subscribe | Add to Favourites

Post new thread Poll:
Author: Subject: coding problem - i hate code
Herlequin
Junior Member
**




Posts: 5
Registered: 18-12-2007
Member Is Offline

Mood: Pov

posted on 19-11-2008 at 04:23 AM Edit Post Reply With Quote
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.
View User's Profile View All Posts By User U2U Member
roach
Junior Member
**




Posts: 95
Registered: 4-9-2004
Location: VIC Australia
Member Is Offline


posted on 19-11-2008 at 09:42 PM Edit Post Reply With Quote


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.
View User's Profile View All Posts By User U2U Member
Herlequin
Junior Member
**




Posts: 5
Registered: 18-12-2007
Member Is Offline

Mood: Pov

posted on 20-11-2008 at 01:53 AM Edit Post Reply With Quote


Thanks Roach that is a great starting point. :D
View User's Profile View All Posts By User U2U Member
rsb_44
Junior Member
**




Posts: 8
Registered: 14-11-2005
Member Is Offline


posted on 10-12-2008 at 03:35 AM Edit Post Reply With Quote


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
View User's Profile View All Posts By User U2U Member
Post new thread Poll:


Go To Top


Powered by XMB 1.9.1 RC2 Nexus (RC2)
Developed By Aventure Media & The XMB Group © 2002-2004



[PHP: 76.4% - SQL: 23.6%]