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

Notification

Icon
Error

Options
Go to last post Go to first unread
essemkay  
#1 Posted : Thursday, July 25, 2019 2:38:28 PM(UTC)
essemkay

Rank: Member

Groups: Registered, Registered Users, Unverified Users
Joined: 1/1/2013(UTC)
Posts: 21

Thanks: 4 times

Hi All

Whats the formula for highlights the bar when formula A change to formula B.

Thanks in advance

MS Support  
#2 Posted : Thursday, July 25, 2019 2:48:54 PM(UTC)
MS Support

Rank: Advanced Member

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

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

Hi All

Whats the formula for highlights the bar when formula A change to formula B.

Thanks in advance

Hi,

The Expert Advisor's "Highlights" tab is how you can formulaically color price bars. Expert Advisors can be attached to charts, but you can only have one Expert attached at a time.

As for the formula logic itself, it largely depends on the type of conditions you are looking for. "Ref" is the function that allows you to change the price bar you are looking for the condition on, so you can build out some simple logic like:

Ref("Condition1",-1) AND "Condition2"

Ref shifts the reference point back 1 bar to look for Condition1, and Condition2 looks for the condition to be happening on the current bar. If you want the prior bar condition to specifically be -not- true on the current bar you can also look for Condition1 to be 0 on the current bar, in addition to Condition2 being true:

Ref("Condition1",-1) AND "Condition1"=0 AND "Condition2"

Edited by user Thursday, July 25, 2019 2:50:56 PM(UTC)  | Reason: Not specified

thanks 1 user thanked MS Support for this useful post.
essemkay on 7/25/2019(UTC)
essemkay  
#3 Posted : Monday, July 29, 2019 5:13:45 AM(UTC)
essemkay

Rank: Member

Groups: Registered, Registered Users, Unverified Users
Joined: 1/1/2013(UTC)
Posts: 21

Thanks: 4 times
Originally Posted by: MS Support Go to Quoted Post
Originally Posted by: essemkay Go to Quoted Post

Hi All

Whats the formula for highlights the bar when formula A change to formula B.

Thanks in advance

Hi,

The Expert Advisor's "Highlights" tab is how you can formulaically color price bars. Expert Advisors can be attached to charts, but you can only have one Expert attached at a time.

As for the formula logic itself, it largely depends on the type of conditions you are looking for. "Ref" is the function that allows you to change the price bar you are looking for the condition on, so you can build out some simple logic like:

Ref("Condition1",-1) AND "Condition2"

Ref shifts the reference point back 1 bar to look for Condition1, and Condition2 looks for the condition to be happening on the current bar. If you want the prior bar condition to specifically be -not- true on the current bar you can also look for Condition1 to be 0 on the current bar, in addition to Condition2 being true:

Ref("Condition1",-1) AND "Condition1"=0 AND "Condition2"

How can i try this using Barssince code??

MS Support  
#4 Posted : Monday, July 29, 2019 2:59:26 PM(UTC)
MS Support

Rank: Advanced Member

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

Thanks: 92 times
Was thanked: 155 time(s) in 150 post(s)
Originally Posted by: essemkay Go to Quoted Post
Originally Posted by: MS Support Go to Quoted Post
Originally Posted by: essemkay Go to Quoted Post

Hi All

Whats the formula for highlights the bar when formula A change to formula B.

Thanks in advance

Hi,

The Expert Advisor's "Highlights" tab is how you can formulaically color price bars. Expert Advisors can be attached to charts, but you can only have one Expert attached at a time.

As for the formula logic itself, it largely depends on the type of conditions you are looking for. "Ref" is the function that allows you to change the price bar you are looking for the condition on, so you can build out some simple logic like:

Ref("Condition1",-1) AND "Condition2"

Ref shifts the reference point back 1 bar to look for Condition1, and Condition2 looks for the condition to be happening on the current bar. If you want the prior bar condition to specifically be -not- true on the current bar you can also look for Condition1 to be 0 on the current bar, in addition to Condition2 being true:

Ref("Condition1",-1) AND "Condition1"=0 AND "Condition2"

How can i try this using Barssince code??

Hi again,

Formula function outputs can be compared to a numerical value to make them into a conditional statement, such as:

Code:
BarsSince( MACD() > 0) < 2 AND BarsSince( MACD() < 0) < 1

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.