Login Page - Create Account

Support Board


Date/Time: Mon, 24 Feb 2020 14:14:26 +0000



[Programming Help] - Help with Referencing A Range of Data

[2020-01-21 03:13:10]
sourdubber - Posts: 47 | Ending Date: 2019-11-06 [Expired]
I have a question about "Referencing A Range of Data"

https://www.sierrachart.com/index.php?page=doc/StudyChartAlertsAndScanning.php#ReferencingARangeOfData

In the spreadsheet, I created a custom formula using a moving average crossover and placed it in Column P3. Whenever there is a MA crossover WITHIN THE LAST 3 days and the close is below the open, I want to BUY. Here is the formula I wrote for this, to be placed in K3:

=AND(SUM(P[3:5]>0,E3<B3)

But I get a Syntax error. What am I doing wrong? Thanks in advance.
[2020-01-21 03:41:09]
sourdubber - Posts: 47 | Ending Date: 2019-11-06 [Expired]
Please disregard. Found the fix.

=AND(SUM(P3:P5)>0,E3<B3)

In the document the examples was given in this format, which was a bit confusing:
AVERAGE(ID0.SG1[0:-10])
=AVERAGE(O[0:-10]) > 100
[2020-01-21 14:33:39]
tomgilb - Posts: 2380 | Ending Date: 2020-02-29
Spreadsheet syntax is different than Simple Alert syntax.

(However, the Spreadsheet Formula study uses Simple Alert syntax.)
[2020-01-21 23:37:25]
sourdubber - Posts: 47 | Ending Date: 2019-11-06 [Expired]
(However, the Spreadsheet Formula study uses Simple Alert syntax.)

Not sure I follow but if what you wrote is true, shouldn't =AND(SUM(P[3:5])>0,E3<B3) be accepted?
[2020-01-22 01:03:41]
tomgilb - Posts: 2380 | Ending Date: 2020-02-29
shouldn't =AND(SUM(P[3:5])>0,E3<B3) be accepted?

No. This is a combination of the two syntaxes.

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

Login

Login Page - Create Account