Login Page - Create Account

Support Board


Date/Time: Sat, 23 Nov 2024 03:28:48 +0000



Automatically change background color based on position?

View Count: 135

[2024-09-19 19:34:47]
User594974 - Posts: 34
Is there a way to automatically change the color of the background based on a position?

For example...when executing long...background then turns a shade of green...then goes to black when flat. All done automatically.

Thanks for your help.
[2024-09-19 20:34:05]
John - SC Support - Posts: 36238
Yes, this can be done. Are you wanting the entire background or just the bars from where the position is opened?
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2024-09-19 20:58:26]
User594974 - Posts: 34
Hi John, thanks for the quick response.

A change of the entire background on entry and exit would be just fine.
[2024-09-20 13:13:08]
John - SC Support - Posts: 36238
That actually is the harder one to do.

But, to do it, you need the following studies (note that you will need to repeat this process for each chart you want to change color):
- Trading: Position Quantity
- 2 copies of the Color Background Based on Alert Condition
- Spreadsheet Study

Do the following:
- Add the studies to the chart. You can hide the "Trading: Position Quantity" and "Spreadsheet Study".
- In the "Color Background Based on Alert Condition" studies set the following conditions (just one condition per study):
=ID1.SG1 < 0 [to color background on a short]
=ID1.SG1 > 0 [to color background on a long]

where ID1 is the ID of the "Spreadsheet Study" study.

- In the Spreadsheet Study enter the following in cell K3:
=ID2.SG1@$3

Where ID2 is the ID of the "Trading:Position Quantity" study
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2024-09-20 13:28:00]
User594974 - Posts: 34
Thank you for the detailed response. It is much appreciated.

I’ll get to work on this.

Cheers.

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

Login

Login Page - Create Account