Login Page - Create Account

Support Board


Date/Time: Sat, 18 May 2024 10:21:30 +0000



Histogram help

View Count: 95

[2024-04-30 15:44:29]
User411320 - Posts: 267
Hello,

I'm trying to create a formula that prints an up arrow when the histogram reaches -1 and the bar following is less then the previous bar and prints a down arrow when the histogram reaches 1 and following bar is less then the previous. please see attached photo for the histogram with markings yellow is where I'd want a down arrow and blue is where I'd want an up arrow.

I tried using ID12.SG2 < -1.0 but I know I need to add something to filter when the bar goes below the peak/trough
imageScreenshot 2024-04-30 113235.png / V - Attached On 2024-04-30 15:44:21 UTC - Size: 4.89 KB - 18 views
[2024-04-30 17:14:55]
John - SC Support - Posts: 31704
To begin with, you need to use the "Color Bar Based On Alert Condition" to get the arrows. Refer to the following:
Color Bar Based on Alert Condition

For the Up Arrow situation, you would use the following formula:
=AND(ID12.SG2 < -1.0, ID12.SG2[-1] < ID12.SG2)

Where ID12 is the ID of the study that creates the bars and SG2 is the subgraph of those bars.
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2024-04-30 18:24:32]
User411320 - Posts: 267
So I think I'm doing something wrong.

The formula works only if select the color bar option but when I select "arrow up" or "arrow down", nothing happens.

also there are some instances where the peak will cross -1 and the next bar will close under -1 and it won't color, and vice versa for the 1.

please see attached photo
Date Time Of Last Edit: 2024-04-30 18:26:29
imageScreenshot 2024-04-30 142605.png / V - Attached On 2024-04-30 18:26:24 UTC - Size: 15.61 KB - 18 views
[2024-04-30 19:35:06]
John - SC Support - Posts: 31704
With regards to getting arrows, refer to the following section within the Color Bar Based on Alert Condition:
Color Bar Based on Alert Condition: Drawing Arrows/Text or Other Styles at the High or Low of Bars

With regards to not having the coloring at the locations you specified, that is due to the formula you are using. It checks the current bar to be less than -1 and the previous bar to be more negative than the current bar. These conditions are not met in the areas you are referencing.
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2024-04-30 20:42:14]
User411320 - Posts: 267
Hello John,

I was able to draw the arrows thank you for the instructions.

Ok I see what you're saying. so I tried this =AND(ID12.SG2 > ID12.SG2[-1]-1.0, < ID12.SG2) but that didn't work either
[2024-04-30 22:04:52]
John - SC Support - Posts: 31704
=AND(ID12.SG2 > ID12.SG2[-1]-1.0, < ID12.SG2)

The above formula is not formatted correctly. The second part of the AND() function (i.e. after the comma) is missing something to compare with ID12.SG2. And we are not sure what you are trying to accomplish with "ID12.SG2 > ID12.SG2[-1] - 1.0".

If you just want to color a bar when the study subgraph of ID12.SG2 goes below -1, then you would use the following:
=ID12.SG2 < -1.0

In this case, there is no point in bothering with the original formula we gave you, as this will give include that particular situation.

Think about what you really want to accomplish from this alert and make it match that situation. You have a lot of tools at your disposal to make this do what you want.
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account