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 11:32:13 AM(UTC)
Flexi

Rank: Advanced Member

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

how to do a bar count from the most recent data and reset to 0 on a specific count? Reset to 0 on 25 bars from the most recent bar
jjstein  
#2 Posted : Monday, January 30, 2012 11:49:46 AM(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)
This will do it from the start:
Code:
Mod(Cum(1),25)=0


Try a variation with BarsSince(), for whatever you're doing.


wabbit  
#3 Posted : Monday, January 30, 2012 7:42:32 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:

count:=Cum(1);
reverseBarIndex:=lastvalue(count)-count;

{plot}
mod(reverseBarIndex,25);



wabbit [:D]


thanks 1 user thanked wabbit for this useful post.
vikas on 7/21/2016(UTC)
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.