Login Page - Create Account

Support Board


Date/Time: Sat, 27 Apr 2024 16:50:35 +0000



[Programming Help] - Questions on Spreadsheet_Studies

View Count: 2882

[2018-07-25 23:06:30]
2garin - Posts: 184
I ask the help of experienced users of Spreadsheet_Studies.
Prompt please (in brief yes, is not present):
1. In Spreadsheet_System_for_Trading, you can record your indicators in the O-Z columns without installing Technical studies on the chart (AA columns and so on)?
2. In the O-Z column, you can write the expression with the result of calculating the True / Log example: [(PriceRange (High, Low, 5) / Lag (PriceRange (High, Low, 5), 5)) <0.75]?
3. Can the results of calculations (for example C3 + B3 / 2) be applied from the column O-Z to the chart?
Prompt a resource (forum) where you can ask questions about using SC.
[2018-07-26 01:09:01]
Sawtooth - Posts: 3979
1. No, you must add the study to the chart. You could use columns O-Z to reference the study's outputs in columns AA and above.
2. Yes, you could create a formula that would return a True/False from your example, but it must only use the available spreadsheet functions with the correct syntax.
Spreadsheet Functions
3. Yes, you can plot results on the chart from formulas in columns O-Z.

This is the primary forum to ask question about using Sierra Chart.

Here is another excellent forum:
https://futures.io/sierra-chart/
[2018-07-26 03:38:03]
2garin - Posts: 184
4. How does Technical Studies mark PriceRange for the last five bars?
[2018-07-26 04:24:03]
Sawtooth - Posts: 3979
4. You can use the Highest High / Lowest Low Over N Bars study.
Then if you want to mark where the range is <0.75, you can use a formula on the Alerts tab of the Color Bar Based On Alert Condition study.
Color Bar Based on Alert Condition

You could also do it with only a spreadsheet study.
[2018-07-30 05:20:15]
2garin - Posts: 184
5. The Spreadsheet System for Trading table contains a Highest High / Lowest Low Over 4 Bars study (columns AA and AB).
How to determine (record for intermediate calculations) the value of the PriceRange of the last 4 bars and the PriceRange of the previous 4 bars (do I need to add the Highest High / Lowest Low Over 8 Bars to the table)?
image5.png / V - Attached On 2018-07-30 05:19:33 UTC - Size: 30.22 KB - 388 views
[2018-07-30 14:17:01]
Sawtooth - Posts: 3979
5. With the Length set to 4, the price range of the last 4 bars is the difference between AA3 and AA4. To calculate that, use this formula, for example in O3:
=ABS(AA3-AA4)

However, the preferred way to reference a study's output is to use this syntax:
Working with Spreadsheets: References to Study Subgraph Columns when using the Spreadsheet Study
=ABS(ID4.SG1@3-ID4.SG2@3)
This is the difference in points. To calculate the difference in ticks:
=ABS(ID4.SG1@3-ID4.SG2@3)*$J$21

To calculate the difference of the previous previous 4 bars, use the OFFSET function referencing O3, for example in P3:
=OFFSET(O3,4,0)
Date Time Of Last Edit: 2018-07-30 16:38:39
[2018-07-30 22:58:12]
2garin - Posts: 184
This is the difference in points.
=ABS(ID4.SG1@3-ID4.SG2@3)
To calculate the difference in ticks:
=ABS(ID4.SG1@3-ID4.SG2@3)*$J$21
Count the range in the ticks did not work.
imagepoints.png / V - Attached On 2018-07-30 22:56:58 UTC - Size: 43.64 KB - 391 views
imageticks.png / V - Attached On 2018-07-30 22:57:08 UTC - Size: 44.13 KB - 396 views
[2018-07-30 23:18:10]
Sawtooth - Posts: 3979
The range in ticks will be very small for the symbol you are using.

-Highlight column O by clicking on the O at the top of the column.
-In the main menu, go to Spreadsheet >> Number Format
-Change the format to 0.000000001
[2018-07-30 23:33:20]
2garin - Posts: 184
6.
When a Sheet cell contains a formula, at the top right of the cell there is a red indicator indicating this.
The triangle inside is the presence of a formula. This is not the presence of errors?
Date Time Of Last Edit: 2018-07-30 23:38:24
imagetr.png / V - Attached On 2018-07-30 23:32:26 UTC - Size: 1.8 KB - 353 views
[2018-07-31 00:39:02]
Sawtooth - Posts: 3979
6. The red triangle indicates that the cell contains a formula. It does not indicate errors.

If there are formula errors, an error code will be displayed in the cell:
Working with Spreadsheets: Spreadsheet Errors
[2018-07-31 01:50:49]
2garin - Posts: 184
7. Division of two cells is correct?
8. The ratio of the two cells is recorded correctly?
imagedivision.png / V - Attached On 2018-07-31 01:49:58 UTC - Size: 6.7 KB - 392 views
imageratio.png / V - Attached On 2018-07-31 01:50:05 UTC - Size: 8.11 KB - 373 views
[2018-07-31 02:44:55]
Sawtooth - Posts: 3979
7. This is a valid division formula, and it is the ratio.
8. This is a valid boolean formula, and it will return a 1 if TRUE, and a 0 if FALSE.
[2018-08-03 00:17:09]
2garin - Posts: 184
9. How to build a bar graph on the chart from the results of calculating the column Q?
10. How to mark bars satisfying the condition <0.75?
imageoutput of bars.png / V - Attached On 2018-08-03 00:15:44 UTC - Size: 2.96 KB - 374 views
[2018-08-03 00:49:24]
Sawtooth - Posts: 3979
9.
Add the Moving Average - Simple study
- set the 'Based On' to the spreadsheet study
- set the 'Chart Region' to the one where you want the bar graph
- set the 'Input Data' to Q
- set the 'Length' to 1
- On the Subgraphs tab, set the Draw Style to Bar

10.
On the Subgraphs tab of the spreadsheet study's settings, set the Draw Style of R(SG8) to Color Bar.
[2018-08-03 02:27:22]
2garin - Posts: 184
9. Add the Moving Average - Simple study
Why are the values in column Q different from the values of the indicator?
For what the column appeared in the table AB?
image9.png / V - Attached On 2018-08-03 02:26:20 UTC - Size: 40.03 KB - 375 views
[2018-08-03 03:25:53]
Sawtooth - Posts: 3979
Why are the values in column Q different from the values of the indicator?
Go to Spreadsheet >> Recalculate All Formulas
or go to Chart >> Recalculate

For what the column appeared in the table AB?
Column AB has left-over data when the Lowest Low was using that column. You can ignore it, or you can highlight the column and delete it.
[2018-08-04 10:14:08]
2garin - Posts: 184
Recorded the formulas in the OPQR columns. On the basis of column Q, I constructed a bar chart. On the chart and in the table everything is displayed correctly. If the chart is recalculated (Insert), then the values in the column AA are played in the table. Recalculate All Formulas in the table does not change the situation. Indicator Moving Average - Simply from the chart does not disappear. Values in the AA can be restored by opening the settings Moving Average - Simple and after clicking OK. Why is this happening?
imagechart.png / V - Attached On 2018-08-04 10:01:29 UTC - Size: 12.48 KB - 399 views
imagebefore Insert.png / V - Attached On 2018-08-04 10:01:39 UTC - Size: 36.22 KB - 400 views
imageafter the insert.png / V - Attached On 2018-08-04 10:01:45 UTC - Size: 34.7 KB - 311 views
[2018-08-04 13:49:07]
Sawtooth - Posts: 3979
Why is this happening?
I don't know.
But the bar graph is still displayed so it shouldn't matter unless you need the historical values on the spreadsheet for other calculations.

Here is a workaround to output all historical SMA values in a spreadsheet column:
Put this in S3:
=AVERAGE(OFFSET(Q3,0,0,1,1))
This is a formula to create a SMA on the spreadsheet, from examples here:
https://www.sierrachart.com/index.php?page=doc/SpreadsheetExampleFormulasAndUsage.php#SimpleMovingAverag
[2018-08-05 09:57:42]
2garin - Posts: 184
10. Can Spreadsheet System for Trading mark the bars (the second region) whose height is below 0.75?
tomgilb thanks for the help.
image10.png / V - Attached On 2018-08-05 09:53:37 UTC - Size: 46.34 KB - 323 views
[2018-08-05 14:18:17]
Sawtooth - Posts: 3979
10.

What is your final goal for this?
If you are using the Spreadsheet System for Trading study for autotrading, it must be set to Region 1, which is what my previous posts are based on.
If you only want to produce a bar graph in Region 2, use the Spreadsheet Study study set to Region 2. In this case, you don't need to use the SMA to draw the bar graph in Region 2, and you could also use the spreadsheet to color the bars when <0.75.
If you also want alerts when the bar graph is <0.75, use the Spreadsheet System/Alert study set to Region 2.

To color the bars in Region 2 if the spreadsheet must use Region 1:
-Add the Color Bar Based On Alert Condition study.
-Set the 'Chart Region' to 2
-On the Subgraphs tab, set the Draw Style to 'Bar'
-On the Alerts tab, use this formula:
=ID1.SG1<0.75
This assumes the SMA study is ID1. Edit as necessary.

Note: The color bar study must be below the SMA study in the Studies to Graph list.
[2018-08-05 23:50:37]
2garin - Posts: 184
What is your final goal for this?
Write several indicators (expressions) whenever possible in one table.
Based on the indicators, build a trading system.
Get skills in working with tables.
Note: maybe I was not right trying to visualize each indicator in a separate area.
[2018-08-21 05:16:18]
2garin - Posts: 184
11. Did I correctly write down the condition?
(the average volume of four bars with a lag of -4 bars)> (the average volume of four bars with a lag of -8 bars)

R3
=AVERAGE(ID0.SG5@7:ID0.SG5@10) > AVERAGE(ID0.SG5@11:ID0.SG5@14)
Date Time Of Last Edit: 2018-08-21 05:17:03
image11.png / V - Attached On 2018-08-21 05:13:39 UTC - Size: 10.87 KB - 397 views

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

Login

Login Page - Create Account