Login Page - Create Account

Support Board


Date/Time: Fri, 03 Dec 2021 16:38:00 +0000



[User Discussion] - Color bar based Alert disappears

[2021-10-18 14:27:44]
VolTrader73 - Posts: 46
Hello
Im trying to have a simple color bar set a 10 trade bar chart so that when the condition is true, all bars will remain same color yellow until condition is false.

condition is =ID3.SG11>0
The bar is colored correctly when the condition is true but reverts to the original color once the bar end and so on. Instead of seeing a series of yellow bars each time ID3.SG11>0

ID3.SG11 is a spreadsheet value in cell U3. To make sure it is available and correct, I can see the correct value as the indicator: "Text Display for study" on the chart And every time the text study shows ID3.SG11 value >0 the bar indeed becomes yellow but reverts back to the original bar color when a new bar opens.

In the "study to graph" window (where all studies are listed), the spreadsheet indicator shows as:
ID3 [1 ms | calorder:10 | S_ID:67 (maybe this is relevant for something)

Im not sure as to what to choose in both the "settings and input tab" and in the "alert" tab.

Please advise or send if possible a chart that does this on your end.
Thank you.
[2021-10-18 14:54:10]
tomgilb - Posts: 3078
In order to make an intrabar TRUE persistent in a spreadsheet study, you will need to use this:
https://www.sierrachart.com/index.php?page=doc/SpreadsheetStudiesSpecialTasks.php#StateLocking

Here is another example:
https://www.sawtoothtrade.com/example-9.html
[2021-10-18 15:59:20]
VolTrader73 - Posts: 46
Thank you for the reply
But, I do not want to lock it for ever or manually resetting it.
I want the bars to be colored so long as the condition is true. Isnt this what the Study should do in the first place ? It dose not even hold the color for a bar that had the condition till it closes.
[2021-10-18 17:20:21]
tomgilb - Posts: 3078
Isnt this what the Study should do in the first place ?
No, there is no way to retain an intrabar TRUE without using that locking method.

It is possible to automatically release the lock with a formula.
Follow the instructions here:
https://www.sawtoothtrade.com/example-9.html

Getting it to work properly can be difficult, but it is possible.
You will need a locking condition, which for you is ID3.SG11>0
You will need an unlocking condition that is different than the locking condition,
because the unlocking condition must cycle from TRUE to FALSE (to unlock) to TRUE.
[2021-10-19 10:42:37]
VolTrader73 - Posts: 46
Hello and thank you for the reply.
Following your reference to sawtoothtrader

Im not fluent with this but will try.

=AND(OR(H3=TRUE,H4>1),H5)
If I understand correctly,
H3 will have the formula value I created and and was previously referencing to using the color bar.
H4 > X is basically H3 > 0 ? (that was the condition I was using in the color bar)
H5 would be like: if the current tick is the opening tick of the current bar then false. Any other tick then True ?
If this is correct, how do I create that for H5 ?
[2021-10-19 11:51:46]
tomgilb - Posts: 3078
H5 would be like: if the current tick is the opening tick of the current bar then false. Any other tick then True ?
Not exactly.

In the example:
H3 is the single cell where the entire locking formula exists.
H4 is the single cell that, when TRUE, will lock H3 to TRUE.
H5 is the single cell where it is TRUE before and during the lock, and FALSE at the moment of unlock.

Play with the example to see how it works.
Then you'll get an idea of what you need to do for your H5 formula.

For you, H4 is ID3.SG11>0

Which study and subgraph is ID3.SG11 ?
What is the FALSE (unlock) condition?
Date Time Of Last Edit: 2021-10-19 12:19:01
[2021-10-20 13:06:36]
VolTrader73 - Posts: 46
Hello and thank you for the reply.
First off, if there is another study that can color and fix the color or anything similar that I can use to see the history on the chart of those periods when the condition was met, without this complication than pls referee me to it.
I don't want to fix our discussion to specifically Color bar based on alert condition study as it dose not matter to me how I get the result Im looking for. This goes back to my original problem with SC where I have the ID3.SG11 value which has no column array in the spreadsheet and thus shows only the last value on the chart with no history. I thought using the above study would show the history through the coloring on any candle from 10 Ticks to any duration relevant.

Back to the problem:
Obviously I lack some basic knowledge on this.

If I understand correctly:

H3 =If(And(ID3.SG11[1]<=0,ID3.SG11>0),1,0) this is the trigger and it happens only once but once ID3.SG11 > 0 then the condition should be locked so long ID#.SG11 >0 so,
H4 =IF(ID3.SG11>0,1,0) and that leaves
H5 =IF(ID3.SG11<0,1) but this dose not meet the BEFORE and DURING condition ?

So in the color bar alert condition formula window, I enter (not using the full ID.SG format for the sake of the concept only):
=AND(H3=1ת H4=1, H5=0)

It doesn't seem to work.

Please advise
[2021-10-20 13:36:39]
tomgilb - Posts: 3078
Clarifying our mutual understanding of the problem and its solution is more than can be accomplished in this forum venue.
If you want me to pursue a solution for you, please contact me here:
https://www.sawtoothtrade.com/contact.html

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

Login

Login Page - Create Account