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 : Sunday, December 12, 2010 10:24:37 AM(UTC)
Flexi

Rank: Advanced Member

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

How to code count the number of bars using close is more than historical close at 3 points. Once the close make a 3 points different, count the number of bars in between
johnl  
#2 Posted : Sunday, December 12, 2010 6:48:56 PM(UTC)
johnl

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 11/7/2005(UTC)
Posts: 602


Create an indicator for your first condition then use BarsSince(your condition=1) to
count the # bars.
Flexi  
#3 Posted : Sunday, December 12, 2010 8:49:56 PM(UTC)
Flexi

Rank: Advanced Member

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

wanted to have the close difference to be min of 10 points. Once the close different is 10 points, count the bar that make this 10 points. How is this to be coded because have to create many c-ref(c,-1) c-ref(c,-2) c-ref(c,-3) c-ref(c,-4) c-ref(c,-5) to account for the difference
wabbit  
#4 Posted : Sunday, December 12, 2010 9:45:20 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)
Can you post an annotated chart/drawing?


wabbit [:D]

Flexi  
#5 Posted : Monday, December 13, 2010 12:29:56 AM(UTC)
Flexi

Rank: Advanced Member

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

hi wabbit,

roc calculate the change in price for a specific period

10 roc calculates the change in price for 10 bars

the period is fix but the price change is dynamic

but now want to determine the period and not the price change

want to count the bars with 10 points price change

the roc calculate the price change once there are 10 bars but now is want to count number of bars once the price change is 10 points
wabbit  
#6 Posted : Monday, December 13, 2010 6:54:59 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)
So, if I understand this right, you want to count the number of bars elapsed since the price was x-points higher or lower than the price of the current bar?

If so, you cannot do this in MSFL, you need to use an ExtFml(), or if it might be possible to implement in MSFL I wouldn't bother wasting all that time and effort thinking about how to do it when it is very simple to do in more powerful languages.



wabbit [:D]

vienna  
#7 Posted : Tuesday, December 14, 2010 2:32:59 AM(UTC)
vienna

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 12/14/2009(UTC)
Posts: 140
Location: Austria

Firstly, Wabbit is completly right, MSFL is not made for doing such indicators. If you want to try it still to do it with some tricks in MSFL this code will help you further:

Code:

c1:=C*1.1;
c2:=C*0.9;
c1;c2;
b1:=BarsSince(Cross(LastValue(c1+PREV-PREV),C) OR Cross(C,LastValue(c1+PREV-PREV)));
b2:=BarsSince(Cross(LastValue(c2+PREV-PREV),C) OR Cross(C,LastValue(c2+PREV-PREV)));
b1;
b2;

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.