Support Board
Date/Time: Tue, 26 Nov 2024 04:35:19 +0000
[Programming Help] - Request for simple alert / bar coloring
View Count: 1685
[2016-06-11 14:14:00] |
EuropeanTrader - Posts: 290 |
Hi everyone! Can someone please help me do the following. I would like to have a "3 day triangle" marked up on a chart since it is one of pre-conditions for potential breakouts and beginning of new potential trend, as Linda Raschke says it. It's a simple formula: 1. It includes last 3 bars (Daily is my choice but obviously bar is a bar). 2. Last bar is within prev 2 day bar high and low (not the same but within). 3. That last 3rd bar is withing 1st bar - so that a triangle formation is formed. See examples: http://www.sierrachart.com/image.php?Image=1465654369312.png If it is possible I would love to have connected trendlines marked over these 3 bars so that a triangle is nicely seen. If that is too hard to do, a simple "bar coloring" would also be good or some sort of dot beyond last bar. Thank you very much for anyone's assistance! |
[2016-06-11 15:37:11] |
Sawtooth - Posts: 4120 |
Try this: Put this formula in the Alerts tab of an instance of the Color Bar Based On Alert Condition study: =AND(H<MAX(H[-1],H[-2]),L>MIN(L[-1],L[-2])) This will color the price bar when it is inside the max H and min L of the previous 2 bars. Drawing the 'triangle' lines is not possible with Simple Alerts. |
[2016-06-13 06:56:56] |
EuropeanTrader - Posts: 290 |
I see. Thanks. Is there a way to add that a 3rd bar is within 1st bar as well? That way I would automatically know that it's a triangle. http://www.sierrachart.com/image.php?Image=1465800944940.png (pic shows one as it does not meet that criteria) I woula appreciate it. Thanks a lot! :) Date Time Of Last Edit: 2016-06-13 06:57:14
|
[2016-06-13 12:05:14] |
Sawtooth - Posts: 4120 |
The pic shows that the colored bar is within the max H and min L of the previous 2 bars. Is this not the criteria? If you want to include a 3rd previous bar: =AND(H<MAX(H[-1],H[-2],H[-3]),L>MIN(L[-1],L[-2],L[-3])) |
[2016-06-16 07:58:16] |
EuropeanTrader - Posts: 290 |
Hello, yes it is,... Maybe I expressed myself wrongly. So, it is like this: There are 3 bars included here. Day 1 is today, Day 2 is yesterday and Day 3 is a day before yesterday. 1. The high of Day 1 is lower than the highest high of Day 2 and Day 3. The low of Day 1 is higher than the lowest low of Day 2 and Day 3. 2. Also, it should look like a triangle as well, because just based on first criteria it can happen that it doesn't. So I thought that would be most easily achieved with the condition: Day 1 high low is also WITHIN Day 3 high low price range. How can we adapt the formula so it meets both of these criterias, please? :) Thank you very much! Date Time Of Last Edit: 2016-06-16 08:00:05
|
[2016-06-16 14:00:24] |
Sawtooth - Posts: 4120 |
Try this: =AND(H[0]<MAX(H[-1],H[-2]),L[0]>MIN(L[-1],L[-2]),H[0]<H[-2],L[0]>L[-2]) Note that Simple Alert formulas identify the current day as [0], yesterday as [-1], and the day before yesterday as [-2]. The [0] can be omitted but I included it for clarification and example. MAX, MIN, and AND are spreadsheet functions that also work in Simple Alerts. Their inputs/conditions are between open and close parenthesis, and separated by commas. So if you examine the formula: The MAX function has 2 inputs, each separated by a comma: H[-1],H[-2] The MIN function has 2 inputs, each separated by a comma: L[-1],L[-2] The AND function has 4 conditions using the comparison operators > < with each condition separated by commas: H[0]<MAX(H[-1],H[-2]) L[0]>MIN(L[-1],L[-2]) H[0]<H[-2] L[0]>L[-2] |
[2016-06-16 14:44:16] |
EuropeanTrader - Posts: 290 |
Thanks a lot. I really appreciate your effort.
|
[2016-06-16 14:47:07] |
EuropeanTrader - Posts: 290 |
I also have one other idea that I posted at Upwork.com and I am willing to pay for it. Please see attached pic and let me know if you can do that, I am willing to pay for it. Thanks. *this is the link mentioned in the pic: http://www.sierrachart.com/image.php?Image=1466076359339.png Date Time Of Last Edit: 2016-06-16 14:47:46
|
momoleg.png / V - Attached On 2016-06-16 14:46:52 UTC - Size: 52.17 KB - 351 views |
[2016-06-16 15:36:24] |
infpz - Posts: 826 |
Tom - as usual, extremely helpful, I learned something today.
|
[2016-06-16 15:41:54] |
infpz - Posts: 826 |
Tom, one more question - attached is image showing this formula: H>MAX(H[-1],H[-2],H[-3],H[-4],H[-5],H[-6],H[-7],H[-8],H[-9],H[-10],H[-11],H[-12],H[-13],H[-14],H[-15],H[-16],H[-17],H[-18],H[-19],H[-20]) Basically: H > last 20 bars' high. Do you know of a way to only display the most current signal, the last one? I can reduce the # of bars to calculate but that doesn't quite do it. |
[2016-06-16 19:31:30] |
Sawtooth - Posts: 4120 |
Tom, one more question - attached is image showing this formula:
H>MAX(H[-1],H[-2],H[-3],H[-4],H[-5],H[-6],H[-7],H[-8],H[-9],H[-10],H[-11],H[-12],H[-13],H[-14],H[-15],H[-16],H[-17],H[-18],H[-19],H[-20]) Basically: H > last 20 bars' high. Do you know of a way to only display the most current signal, the last one? I can reduce the # of bars to calculate but that doesn't quite do it I don't know of a way to do it with Simple Alerts because there is no current bar Identifier. It can be done with a spreadsheet study, using this formula: =AND(ROW()=3,C3>MAX(C4:C23)) Row 3 is the current bar and column C is the High. On the spreadsheet the MAX function can use a : for a range, but this syntax is not supported in Simple Alerts. |
[2016-06-16 19:35:46] |
Sawtooth - Posts: 4120 |
Please see attached pic and let me know if you can do that
EuropeanTrader, Please contact me here: http://www.sawtoothtrade.com/contact.html |
[2016-06-16 19:36:06] |
infpz - Posts: 826 |
OK understood - thank you!
|
[2016-06-25 11:09:03] |
EuropeanTrader - Posts: 290 |
Tom, thank you for your email. I'll put this on hold for now. |
[2024-01-05 04:35:05] |
User624595 - Posts: 207 |
@EuropeanTrader, did you get the 3 Bar Triangle breakout alert to work?
|
To post a message in this thread, you need to log in with your Sierra Chart account: