Login Page - Create Account

Support Board


Date/Time: Sat, 04 May 2024 02:22:21 +0000



[User Discussion] - Extension Line defined by Oscillator/MA cross

View Count: 1660

[2020-03-08 12:06:14]
User428450 - Posts: 5
Hi

I would like to draw a horizontal line on the Main Price Graph when there is a cross in an oscillator.

The length of the horizontal line should be the horizontal length between the crosses on the oscillator

<<see attached example>>

I have tried to use the "Color Bar Based on Alert Condition" study but have been unable to get this to work.

How do I do this?
imageExample.jpg / V - Attached On 2020-03-08 12:02:15 UTC - Size: 193.02 KB - 346 views
Attachment Deleted.
[2020-03-08 17:27:09]
Ackin - Posts: 1865
Hi, What you want I created it two years ago ...

Extending Crossover line until future intersection



contact link:
https://www.sierrachart.com/UserControlPanel.php?page=StudyStore&SCDLLName=zyp_download_free
[2020-03-08 20:54:18]
Sawtooth - Posts: 3993
The Color Bar Based On Alert Condition study will only return a True/False.
Use the Spreadsheet Formula study to return a value.

Try this formula in the Formula field:
=IF(CROSSFROMBELOW(ID9.SG1,ID9.SG2),L,IF(CROSSFROMABOVE(ID9.SG1,ID9.SG2),H,ID10.SG1[-1]))
Where the Stochastic-Slow study is ID9 and the Spreadsheet Formula study is ID10.
Set the Draw Style to Dash.
This will create a persistent alternating value of the High and Low at the bar where the Stochastic crosses in each direction.
[2020-03-09 07:25:48]
User428450 - Posts: 5
Thank you Tom ... this worked simply and well and taught me how to use 'nested IF' in Sierra
[2020-06-04 20:36:20]
User771423 - Posts: 25
Is it possible to color the line differently depending on whether the line is crossed from below or above? With spreadsheet formula.
[2020-06-05 13:46:02]
Sawtooth - Posts: 3993
On the Subgrpahs tab of Spreadsheet Formula study, set the Auto-Coloring to Based On Slope.
[2020-06-05 18:23:42]
User771423 - Posts: 25
Thank you, yes I tried it, but it doesnt do what I want.
I want it to alternative between two colors, support and resistance from my Hilbert SineWave crossings. Ie Sine and LeadSine-crossing.
When you have Based on slope, I understand it looks at the Spreadsheet Formula created line, not the crossing line in my Hilbert Sine Wave.
Look attached what I want (took a screenshot from Emini-watch), and what I get in SierraChart.
imagenot what I want.JPG / V - Attached On 2020-06-05 18:22:14 UTC - Size: 81.69 KB - 289 views
imagecorrect resistance and support.png / V - Attached On 2020-06-05 18:22:21 UTC - Size: 164.99 KB - 279 views
[2020-06-05 19:17:22]
Ackin - Posts: 1865
I created this three weeks ago. You can download it as study.

Hilbert sine wave SR
Ackin's indicators (SCH users requests for studies) - Update list | Post: 221235
[2020-06-05 19:40:44]
User771423 - Posts: 25
Okey, good, I will maybe try it if tomgilb does not know any standard solution within SierraChart.
[2020-06-05 19:48:58]
Ackin - Posts: 1865
Okey, good, I will maybe try it if tomgilb does not know any standard solution within SierraChart.
I wrote this in general if anyone is looking for a ready-made solution. I did this at the request of one user. He also wanted extended lines for the future. All implemented for study from user contributed studies.

I devoted a lot of time to this study, including reading the original, so I know that study in the Sierra is not according to the author's original idea. On my forum-wishlist is this study with a "period" that is missing there and in some situations does not completely correspond to the original.
[2020-06-05 20:02:01]
User771423 - Posts: 25
I see, so you took the original code from "Rocket Science for traders"? The first version he came up with? Is the DCphase also included? The code as you know calculates the DCPhase, and then plot the sine and lead sine from it. It's exactly the same code, bit it does only plot the DCPhase below. Its a separat study that you have beneath Hilbert Sine Wave.
[2020-06-05 20:22:02]
Ackin - Posts: 1865
I see, so you took the original code from "Rocket Science for traders"?
Yes, but only for experiments ...
Only SR lines for the usercontributed version can be downloaded from the forum .... which you probably also require. Many people used it x years ago to determine the trend (according to Emini)

I have a version from the original in development, I just wrote that the study from usercontributed does not match exactly. In general, it's a bit of a problem with Mr. Ehler and the interpretation of his algorithms :) He has already greatly simplified the indicators compared to earlier times and his last indicator Correlation As a trend indicator, it is quite reasonable to do :)
[2020-06-05 20:30:57]
User771423 - Posts: 25
Yes I went to your forum now and read what you wrote about Hilbert Sine Wave SR, its applied over the user contributed study Hilbert Sine Wave. I have read that the first edition from Rocket Science is the one that is working, and that the later version is not. I'm no programmer, but I have compared the user contributed study and the code in Rocket Science, if I remember correctly it looked about the same. You should have no problem port it to Sierrachart, it's only 2-3 pages or so.
Date Time Of Last Edit: 2020-06-05 20:39:11
[2020-06-05 20:49:58]
Ackin - Posts: 1865
(I only made lines for the Sierra version, my version isn't there - I wrote it just for myself and experimented with it before I put it off because I have other requirements that burn more)

In the middle of the picture you see a situation that has nothing to do there. The description of the equation is unnecessary. I will do my interpretation and also Better sine wave ... now I have other things in progress but for more people ("working on" on the forum)
Date Time Of Last Edit: 2020-06-05 22:31:54
imageHS wave.png / V - Attached On 2020-06-05 20:46:26 UTC - Size: 28.88 KB - 269 views
[2020-06-05 21:04:03]
User771423 - Posts: 25
I think you misunderstood Hilbert Sine Wave here, or atleast half of it. As Ehler writes, he means that there are two different modes. One is cyclical mode where sine and lead sine follow each other, and cross each other. The other mode is when it is a trend (either up or down), in that case the lines do not follow each other, and do not cross each other, this is what you have in your screendump, these are de facto trends. That is the very beauty with Hilbert Sine Wave, that you can track wheather the stock is in cyclic mode or trending mode.
[2020-06-05 21:24:17]
Ackin - Posts: 1865
:)

One is cyclical mode where sine and lead sine follow each other, and cross each other. The other mode is when it is a trend (either up or down), in that case the lines do not follow each other, and do not cross each other,
I agree with this and you are right. I meant the shape of that curve. I'm not interested in crossing in the picture above, .. but smoothing ... the confirmation can be seen optically in the lines in the graph, there are areas where the lines are missing at first glance (incorrect calculation of the extended trend phase will also shift the cross or omit it).

I read most of his books...As I wrote above, this is an interpretation.I think of something other than you and it doesn't matter. Until I release my version, it will be just blahblah out of my mouth ...;) Let's postpone this discussion until it is done. Then I will contact you again on the forum and we can compare the result. Have a nice day.
Date Time Of Last Edit: 2020-06-05 21:36:21
[2020-06-05 23:50:53]
Sawtooth - Posts: 3993
Okey, good, I will maybe try it if tomgilb does not know any standard solution within SierraChart.
There is a solution but it requires using the Spreadsheet Study study.
It can't be done with the Spreadsheet Formula study.
Let me know if you want the details. You would not need the Spreadsheet Formula study.
[2020-06-06 09:21:38]
User771423 - Posts: 25
Yes tomgilb I would appreciate that. Thank you.
Date Time Of Last Edit: 2020-06-06 09:22:18
[2020-06-06 14:22:41]
Sawtooth - Posts: 3993
There is a solution but it requires using the Spreadsheet Study study.

Add the Spreadsheet Study study.
- Set the Chart Region to 1.
- Give it a name in the Spreadsheet Name field.
- Note the Formula Source Sheet Number (ln:7) This will be the sheet# for the formulas.
- On the Subgraphs tab:
-- Set the K(SG1) DrawStyle to Dash, and choose the High color.
-- Set the M(SG3) DrawStyle to Dash, and choose the Low color.
-- Set all other Drawstyles to Ignore.
- On the spreadsheet, use these formulas:
Cell K3:
=IF(CROSSFROMBELOW(ID17.SG2@3:ID17.SG2@4,ID17.SG1@3:ID17.SG1@4),D3,IF(CROSSFROMABOVE(ID17.SG2@3:ID17.SG2@4,ID17.SG1@3:ID17.SG1@4),C3,K4))
Cell L3:
=IF(CROSSFROMBELOW(ID17.SG2@3:ID17.SG2@4,ID17.SG1@3:ID17.SG1@4),-1,IF(CROSSFROMABOVE(ID17.SG2@3:ID17.SG2@4,ID17.SG1@3:ID17.SG1@4),1,L4))
Cell M3:
=IF(L3=-1,K3,0)
where ID17 is the Hilbert Sine Wave study; edit K3/L3 as needed.
[2020-06-06 18:28:11]
User771423 - Posts: 25
Thank you, it works perfectly!
Date Time Of Last Edit: 2020-06-06 18:28:22

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

Login

Login Page - Create Account