Login Page - Create Account

Support Board


Date/Time: Fri, 26 Apr 2024 02:30:47 +0000



Color bar using Swing High and Low Indicator

View Count: 3472

[2017-03-27 18:54:29]
User600819 - Posts: 43
I am trying to create a color bar when the last swing bar low (highlighted by an arrow) is higher than than the previous swing bar low. The swing bar low is ID1.SG2 and the length is 3. I'm still not sure what the length means in the indicator. I currently have =AND(ID1.SG2[-3]>ID1.SG2[-6],C[-3]>C[-6]) and it works, but it colors the bar way after the swing bar arrow comes on the screen. Essentially I want to color a bar as soon as the swing low is shower a higher low.

Thanks
[2017-03-27 19:58:02]
Sawtooth - Posts: 3976
The Swing High and Low study draws the arrows when the length is reached, so there will be a lag of that many bars.

You can easily extend the previous swing high/low to the next one with a spreadsheet study, and color a bar when there is a higher low or a lower high. Post again if you want the details.
[2017-03-27 20:53:30]
User600819 - Posts: 43
Oh yes please details. I've never used the spreadsheet study. Thanks so much.
[2017-03-28 00:34:36]
Sawtooth - Posts: 3976
Try this:

Add the Spreadsheet System/Alert study.
-give it a name in the Spreadsheet Name field
-set the Draw Style of SG1 and SG2 to Color Bar
-set the Draw Style of SG3 and SG4 to Ignore

Use these formulas on the spreadsheet:
cell K3:
=O3<O4
cell L3:
=P3>P4
cell O3:
=IF(ID1.SG1@3>0,ID1.SG1@3,O4)
cell P3:
=IF(ID1.SG2@3>0,ID1.SG2@3,P4)
where ID1 is the Swing High and Low study; edit as necessary.

If you also want audible alerts, they are set on the Settings and Inputs tab of the spreadsheet study, at Column K Alert and Columns L Alert
[2017-03-28 01:01:38]
User600819 - Posts: 43
Thanks a ton!!
[2017-03-28 01:34:01]
Sierra Chart Engineering - Posts: 104368
We tested the formula in post #1 and this is what we see:
http://www.sierrachart.com/image.php?Image=1490664819888.png

We also tested this during a replay and the coloring of the bar was at the expected time. As soon as the swing high/low arrow appears and the condition has been met, the bar is colored.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2017-03-28 01:34:41
[2017-03-30 06:14:40]
Executor - Posts: 40
Sierra chart engineering can you provide the code?
[2017-03-30 07:33:17]
Sierra Chart Engineering - Posts: 104368
The code for what?
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2017-03-31 01:22:11]
Executor - Posts: 40
http://www.sierrachart.com/image.php?Image=1490664819888.png

it seems you tested the formula and it worked. Would like to know how you went about creating the formula
[2017-03-31 02:23:40]
User600819 - Posts: 43
I created the formula that was tested. ID1.SG2 is the swing low indicator with a length of 3
=AND(ID1.SG2[-3]>ID1.SG2[-6],C[-3]>C[-6])
[2017-03-31 20:28:11]
Executor - Posts: 40
thanks
[2020-12-19 11:42:26]
User135370 - Posts: 160
Any way to do this with the normal Trading System based on Alert condition colour bar on alert condition?

So for a short signal want to include that the recent Swing High is Lower than the previous Swing High and vice versa for a Swing Low.

Is there a way or must I use the Spreadsheet?
[2020-12-19 13:05:13]
Ackin - Posts: 1865
Is there a way or must I use the Spreadsheet?

https://www.sierrachart.com/UserControlPanel.php?page=StudyStore&SCDLLName=zyp_download_free
imagelast swing HL.png / V - Attached On 2020-12-19 13:04:22 UTC - Size: 46.57 KB - 311 views

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

Login

Login Page - Create Account