logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
ericlawok  
#1 Posted : Thursday, May 6, 2010 12:10:49 PM(UTC)
ericlawok

Rank: Newbie

Groups: Registered, Registered Users
Joined: 4/9/2008(UTC)
Posts: 7

Hello everyone I would like to build indicator and am having a real problem with something real simple. This is what I'm trying to program – I used security options to see two securities And with this formula I can see % change in the same day. : Security("_EUR_JPY",100*(C-O)/C) + Security("_EUR_USD",100*(C-O)/C); But I would like to see previous day close in this formula; I start with Ref function but it is not working: Security("_EUR_JPY",100*(Ref(C,-1)-O)/(Ref(C,-1)) + Security("_EUR_USD",100*(Ref(C,-1)-O)/(Ref(C,-1)); Any help of ideas and you'd make my day. Thanks a lot and good trading/researching everyone. Eric
mhk1234  
#2 Posted : Thursday, May 6, 2010 3:23:18 PM(UTC)
mhk1234

Rank: Newbie

Groups: Registered, Registered Users
Joined: 3/19/2010(UTC)
Posts: 5

Dear Eric

whenever I have an issue like this I use a variable.

The below example is with the NASDAQ 100 Index.

IndexOpen:= Security("C:\MetaStock Data\StocksCommon\Nasdaq 100\.NDX",O) ;
IndexClose:= Security("C:\MetaStock Data\StocksCommon\Nasdaq 100\.NDX",C) ;

100*((Ref(IndexClose, -1) - IndexOpen)/Ref(IndexClose, -1)) ;

I don't know if it is the smartest solution but it works for me.

Have a great week.

Best regards


mhk1234

Users browsing this topic
Guest (Hidden)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.