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

Notification

Icon
Error

Options
Go to last post Go to first unread
lexology  
#1 Posted : Friday, February 25, 2011 6:46:01 PM(UTC)
lexology

Rank: Newbie

Groups: Registered, Registered Users
Joined: 2/26/2011(UTC)
Posts: 1

Hi, i am a C++ programmer and a MS newbie.
I was trying to do the following but it doesn't work.

Position := If ( (Signal > 0) & (Ref(Position, -1) >0), Ref(Position, -1) + 1000, Ref(Position, -1);

I am basically saying, if i get a buy signal and i am currently already in a long position, i would like to add 1000 units to my position. Otherwise i will keep my current position.
It seems that MS cannot use the previous element (Ref(Position,-1)) in the same array to generate the current element (Position)?

How should i code this logic in MS?

Any help is appreciated!

-MS Newbie
wblam  
#2 Posted : Friday, February 25, 2011 10:47:13 PM(UTC)
wblam

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 11/25/2006(UTC)
Posts: 79

use prev for previous value.
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.