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

### Notification

Error

 Previous Topic Next Topic
 PROFIT306 #1 Posted : Saturday, February 18, 2023 10:43:04 AM(UTC) Rank: MemberGroups: Registered, Registered UsersJoined: 8/11/2013(UTC)Posts: 24Location: MUMBAIWas thanked: 1 time(s) in 1 post(s) HelloWith the alert function: alert(v>100000,10)Here the condition v>100000 have to be true at least once in the last 10 bars.How to code if the condition v>100000 needs to be true for more than once i.e.2 times or say three or 4 times  in the last 10 bars....Is there a way to code it.Kindly guide.Thanks
 Wanna join the discussion?! Login to your Discussions forum accountor Register a new forum account.
 MS Support #2 Posted : Monday, February 20, 2023 3:28:22 PM(UTC) Rank: Advanced MemberGroups: Moderators, Registered, Registered Users, SubscribersJoined: 10/8/2010(UTC)Posts: 1,949Thanks: 89 timesWas thanked: 155 time(s) in 150 post(s) Originally Posted by: PROFIT306 HelloWith the alert function: alert(v>100000,10)Here the condition v>100000 have to be true at least once in the last 10 bars.How to code if the condition v>100000 needs to be true for more than once i.e.2 times or say three or 4 times  in the last 10 bars....Is there a way to code it.Kindly guide.Thanks Hello,In this case you probably want to Sum the condition, i.e.:Code:``Sum(V > 100000,10)`` After summing the condition, you can add whatever criteria you wish the sum to be greater than or equal to, such as:Code:``Sum(V > 100000,10) >= 2`` Edited by user Monday, February 20, 2023 3:29:17 PM(UTC)  | Reason: Not specified
 PROFIT306 #3 Posted : Tuesday, February 21, 2023 3:03:09 AM(UTC) Rank: MemberGroups: Registered, Registered UsersJoined: 8/11/2013(UTC)Posts: 24Location: MUMBAIWas thanked: 1 time(s) in 1 post(s) HelloThanks for all the support. Originally Posted by: MS Support Originally Posted by: PROFIT306 HelloWith the alert function: alert(v>100000,10)Here the condition v>100000 have to be true at least once in the last 10 bars.How to code if the condition v>100000 needs to be true for more than once i.e.2 times or say three or 4 times  in the last 10 bars....Is there a way to code it.Kindly guide.Thanks Hello,In this case you probably want to Sum the condition, i.e.:Code:``Sum(V > 100000,10)`` After summing the condition, you can add whatever criteria you wish the sum to be greater than or equal to, such as:Code:``Sum(V > 100000,10) >= 2``
 Users browsing this topic
 Similar Topics BUY SELL ALERT FUNCTION (Advanced Coding Techniques) by sennal999 6/17/2010 1:04:39 AM(UTC) Alert function for a single event possible? Who can program this? (Formula Assistance) by exito100 5/26/2010 7:40:23 AM(UTC) Frustrating Alert Function (MetaStock) by Raymond 8/22/2006 3:20:43 AM(UTC) Re: Quotecenter Alert function (MetaStock) by iphilosophise 4/10/2006 2:58:22 PM(UTC) Line indicator & Alert function (Formula Assistance) by GiddyUp 4/8/2006 1:03:34 PM(UTC) ALERT function problem in MetaStock RT [RESOLVED] (Product Wish List) by Mac 2/26/2006 9:28:29 PM(UTC) Using the Alert function (Formula Assistance) by dieselpr 6/13/2005 7:01:37 PM(UTC)
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.