Error

 Previous Topic Next Topic
 Perigon #1 Posted : Monday, June 5, 2006 8:34:52 AM(UTC) Rank: NewbieGroups: Registered, Registered UsersJoined: 12/24/2005(UTC)Posts: 7 Hey gys! Im trying to make a formula that's counting the days my condition have been true. The problem here, is that metatocks built-in function for counting bars only calculates the number of bars with criteria true WITHIN a fixed number of reference bars ie. it return 13 true bars of a period of 50 bars, without any relations to WHEN the criteria was true. What I want to do, is that I want to measure how many days IN A ROW that my criteria has been true. Ie. If yesterday was true, then it checks the day before yesterday and so on.. but if yesterday wasn't true, it only return a zero... you get my point? I think the only way to solve this is with a loop, but I don't know how to state the criteria in the loop.. anyone that can help me / give me some tips? Thanks in advance! /Perigon
 Wanna join the discussion?! Login to your Discussions forum accountor Register a new forum account.
 wabbit #2 Posted : Monday, June 5, 2006 9:12:36 AM(UTC) Rank: Advanced MemberGroups: Registered, Registered Users, Subscribers, Unverified UsersJoined: 10/28/2004(UTC)Posts: 3,111Location: Perth, Western AustraliaWas thanked: 16 time(s) in 16 post(s) Have you tried using Roy Larsens's free signal counter? --8<------------------------------ {Signal Counter} {© 2003 Roy Larsen} {rlarsen@man.quik.co.nz} a:=C=Ref(C,-4); {signal to reset} i:=Cum(a+b>-1)=1; f:=BarsSince(i OR a)
 mstt #3 Posted : Monday, June 5, 2006 9:13:34 AM(UTC) Rank: Advanced MemberGroups: Registered, Registered Users, SubscribersJoined: 7/25/2005(UTC)Posts: 1,042Was thanked: 57 time(s) in 54 post(s) Perigon There are several ways to do this. Here's one you can try first. BarsSince("my condition"=FALSE); Roy MetaStock Tips & Tools
 Perigon #4 Posted : Monday, June 5, 2006 9:16:33 AM(UTC) Rank: NewbieGroups: Registered, Registered UsersJoined: 12/24/2005(UTC)Posts: 7 I've tried them both, and they do work :-) Tough the last one is a little bit easier :-) Thanks mates! Good trading..
 Users browsing this topic
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.