Login Page - Create Account

Support Board


Date/Time: Tue, 18 Jun 2019 17:56:10 +0000



spreadsheet syntax error

Support Request:
[2019-03-13 00:26:49]
CB12310 - Posts: 72
Need a nudge here to get going...in the default Spreadsheet System for Trading Study, I'm placing a conditional in cell J106 that I want to return '1' (True) if the range of the prior candle/bar's High price, minus the prior Low price, is less than or equal to 4*TICKSIZE (where TICKSIZE is listed by-default in cell J21); else '0' (False). This is what I've input, but it throws a syntax error, whether as-shown or adding spaces between the math operators:

=IF((ID0.SG2[-1]-ID0.SG3[-1])<=(J21*4),1,0)

I also tried this, to same result: =IF((ID0.SG2[-1]-ID0.SG3[-1])<=(TICKSIZE*4),1,0)

Any suggestion?
Date Time Of Last Edit: 2019-03-13 00:28:30
[2019-03-13 01:09:27]
tomgilb - Posts: 2176
You are using a Simple Alert syntax on a spreadsheet. The spreadsheet syntax is different.
Try this:
=C4-D4<=J21*4
or this:
=ID0.SG2@4-ID0.SG3@4<=J21*4

Notes:
- If the result is Boolean (T/F), you don't need to use the IF function.
- The current bar is in row 3 and previous bars are in rows below.
- When referencing cells in Formula Columns, or in columns A-J, you can use traditional column/row references.
- When referencing study output columns, it is best to use this format:
https://www.sierrachart.com/index.php?page=doc/WorkingWithSpreadsheets.php#ReferencesStudySubgraphColumnsSpreadsheetStudy
- SC Engineering might add new system outputs so it is not recommended to use open cells in columns I or J. Column H is open for the user.
Date Time Of Last Edit: 2019-03-13 04:26:26
[2019-03-13 17:12:57]
CB12310 - Posts: 72
Thank you very much for the help, Tom. The '@4' portion makes sense now too, since you noted current bar as row 3.

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

Login

Login Page - Create Account