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

Notification

Icon
Error

Options
Go to last post Go to first unread
PROFIT306  
#1 Posted : Saturday, February 18, 2023 10:43:04 AM(UTC)
PROFIT306

Rank: Member

Groups: Registered, Registered Users
Joined: 8/11/2013(UTC)
Posts: 24
Location: MUMBAI

Was thanked: 1 time(s) in 1 post(s)

Hello

With 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

MS Support  
#2 Posted : Monday, February 20, 2023 3:28:22 PM(UTC)
MS Support

Rank: Advanced Member

Groups: Moderators, Registered, Registered Users, Subscribers
Joined: 10/8/2010(UTC)
Posts: 1,960

Thanks: 91 times
Was thanked: 155 time(s) in 150 post(s)
Originally Posted by: PROFIT306 Go to Quoted Post

Hello

With 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)
PROFIT306

Rank: Member

Groups: Registered, Registered Users
Joined: 8/11/2013(UTC)
Posts: 24
Location: MUMBAI

Was thanked: 1 time(s) in 1 post(s)

Hello

Thanks for all the support.

Originally Posted by: MS Support Go to Quoted Post
Originally Posted by: PROFIT306 Go to Quoted Post

Hello

With 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.