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

Notification

Icon
Error

Options
Go to last post Go to first unread
Flexi  
#1 Posted : Monday, January 30, 2012 1:42:35 PM(UTC)
Flexi

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 5/27/2006(UTC)
Posts: 135

How to plot the recent C constant for previous 10 bars

The recent C maybe 2.21

Want to plot 2.21 constant for the previous 10 bars
wabbit  
#2 Posted : Monday, January 30, 2012 7:43:37 PM(UTC)
wabbit

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 10/28/2004(UTC)
Posts: 3,111
Location: Perth, Western Australia

Was thanked: 16 time(s) in 16 post(s)
What code have you tried?


wabbit [:D]

Flexi  
#3 Posted : Tuesday, January 31, 2012 12:20:16 AM(UTC)
Flexi

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 5/27/2006(UTC)
Posts: 135

Wabbit,

The below plot the C constant for the previous 10 bars but the C is the intial C of previous 10 bars not the most recent C of previous 10 bars

ri:=LastValue(Cum(1))-Cum(1);
ri2:=Mod(ri,10);
ValueWhen(1,ri2>Ref(ri2,-1),C)


wabbit  
#4 Posted : Tuesday, January 31, 2012 12:53:33 AM(UTC)
wabbit

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 10/28/2004(UTC)
Posts: 3,111
Location: Perth, Western Australia

Was thanked: 16 time(s) in 16 post(s)
I don't understand precisely what you're trying to do, so this may or may not help.

Code:

ri:=LastValue(Cum(1))-Cum(1);
ri:=Mod(ri,10);

ExtFml("forum.ref",C,-ri);



Again annotated charts help more than anything else...



wabbit [:D]

Flexi  
#5 Posted : Wednesday, February 1, 2012 3:28:16 AM(UTC)
Flexi

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 5/27/2006(UTC)
Posts: 135

Is there a easy method to find the below rather inputting the ref() for each data
With 100 data would not have to input 100 ref() very cude
Ref(C,-10)-C+Ref(C,-9)-C+Ref(C,-8)-C to Ref(C,-1)-C
wabbit  
#6 Posted : Wednesday, February 1, 2012 3:44:53 PM(UTC)
wabbit

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 10/28/2004(UTC)
Posts: 3,111
Location: Perth, Western Australia

Was thanked: 16 time(s) in 16 post(s)
Code:
sum(c,10)-10*c;
wabbit [:D]
Flexi  
#7 Posted : Thursday, February 2, 2012 10:15:47 AM(UTC)
Flexi

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 5/27/2006(UTC)
Posts: 135

Wabbit,

For

ri:=LastValue(Cum(1))-Cum(1);
ri:=Mod(ri,10);
ExtFml("forum.ref",C,-ri);

Is there a alternative without using the forum ref?
wabbit  
#8 Posted : Thursday, February 2, 2012 4:31:42 PM(UTC)
wabbit

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 10/28/2004(UTC)
Posts: 3,111
Location: Perth, Western Australia

Was thanked: 16 time(s) in 16 post(s)
What's wrong with using the free function which actually returns the correct values? wabbit [:D]
Flexi  
#9 Posted : Friday, February 3, 2012 3:33:45 AM(UTC)
Flexi

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 5/27/2006(UTC)
Posts: 135

Don't want use dll rather want to use ms directly
wabbit  
#10 Posted : Friday, February 3, 2012 4:02:17 AM(UTC)
wabbit

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 10/28/2004(UTC)
Posts: 3,111
Location: Perth, Western Australia

Was thanked: 16 time(s) in 16 post(s)
Not wanting to use the solution that works... ... whatever
jjstein  
#11 Posted : Friday, February 3, 2012 2:19:32 PM(UTC)
jjstein

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 5/13/2005(UTC)
Posts: 715
Location: Midwest, USA

Was thanked: 1 time(s) in 1 post(s)
Hi Wabbit! I can understand wantig to do thing in "pure" MSFL, if for no other reason than to make sure I know what's going on, and why another way might be better...

I'd think these two should be identical, but they're not:
Code:
ri:=LastValue(Cum(1))-Cum(1);

ri:=Mod(ri,10)*-1;

ExtFml("forum.ref",C,ri);



Code:
ri:=LastValue(Cum(1))-Cum(1);
ri:=Mod(ri,10)*-1;
Ref(C,LastValue(ri+PREV-PREV));


wabbit  
#12 Posted : Tuesday, February 7, 2012 9:56:29 PM(UTC)
wabbit

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 10/28/2004(UTC)
Posts: 3,111
Location: Perth, Western Australia

Was thanked: 16 time(s) in 16 post(s)
jjstein wrote:
I can understand wantig to do thing in "pure" MSFL, if for no other reason than to make sure I know what's going on, and why another way might be better...

I'd think these two should be identical, but they're not



So... the MSFL code should be doing one thing, but returning a different than expected value, whereas the extfml() returns the expected value... so the thing you're not sure of here is how MS is dealing with the forward looking "workaround" (which in this instance doesn't work!)

I have said it before and I am sure I will have to say it again in the future, if I have to spend more than a few minutes thinking about how to defeat the limitations of the MSFL, I will simply write the required functionality as an extfml().



wabbit [:D]

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.