Login Page - Create Account

Support Board


Date/Time: Tue, 11 Mar 2025 01:06:20 +0000



Post From: Colour Based on Alert Condition

[2022-04-17 13:37:34]
Sawtooth - Posts: 4181
The formulas I gave in post#2 use Alert syntax. You must use spreadsheet syntax on a spreadsheet, e.g. in cell P3:
=IF(OR(CROSSFROMBELOW(D3:D4,ID2.SG2@3:ID2.SG2@4),CROSSFROMABOVE(D3:D4,ID2.SG3@3:ID2.SG3@4)),1,IF(CROSSFROMBELOW(C3:C4,ID2.SG1@3:ID2.SG1@4),0,P4))

Then in M3:
=AND(CROSSFROMBELOW(C3:C4,ID2.SG1@3:ID2.SG1@4),P4=1)
https://www.sierrachart.com/index.php?page=doc/SpreadsheetFunctions.html#CROSSFROMBELOW_Function
Working with Spreadsheets: References to Study Subgraph Columns when using the Spreadsheet Study

For longs, use O3 and K3, respectively.
K3 to N3 are only for entry/exit signals. Other Formula Columns can be used for intermediate calculations.

Regarding which backtest mode: I gave the wrong link. Read the entire section of the documentation on backtesting.
The Bar Based Backtest might not be what you want to use. It is fast but not the most accurate.
Auto Trade System Back Testing

What you want to do is simple to explain but not as simple to program.
You will likely need to modify the formulas, and there will likely be situations where it will be difficult to get the signal you want.
The examples are only meant for you to know the concept how it might be done.