Support Board
Date/Time: Tue, 24 Mar 2026 22:41:54 +0000
Spreadsheet System For Trading: IF Candle@4 is Green and Candle@5 is Red, then.....
View Count: 110
| [2026-02-05 06:22:03] |
| PeaceFrog - Posts: 116 |
|
Hello, In Spreadsheet System For Trading I'd like to create a formula with the condition that: IF(AND( the Heikin Ashi Candle (ID1) in Row 4 is Green (closed up), and the Heikin Ashi Candle (ID1) in Row 5 is Red (closed down) then) 1,0) Basically, if the candle before the current active candle is Green and the candle before that one is Red, then 1 I've searched but haven't found a way to do it. Thank you for your help. |
| [2026-02-05 15:43:37] |
| John - SC Support - Posts: 45269 |
|
In general, the calculation for an Up bar is that the close is higher than the open, and for a Down bar is that the Close is lower than the Open. Therefore, your formula would look like the following: =AND(ID1.SG4@$4 > ID1.SG1@$4, ID1.SG4@$5 < ID1.SG1@$5) You do not need the IF in this case, as the formula will evaluate to either True or False. Also, just so you are aware, if the Heikin-Ashi study has the option for "Display as Main Price Graph" enabled, then the Open/High/Low/Close values in columns B, C, D, and E in the Spreadsheet are those for the Heikin-Ashi study. Otherwise, you will have the Heikin-Ashi data in the spreadsheet after the last formula column (as all other studies are displayed in that area). But, in either case, the ID of the study will be reflected properly and it is best to reference the study through the IDs as we have done in the formula above. For the most reliable, advanced, and zero cost futures order routing, use the Teton service: Sierra Chart Teton Futures Order Routing |
| [2026-02-06 13:44:31] |
| Sawtooth - Posts: 4321 |
|
Here is an example for determining the candle color: Spreadsheet Example Formulas and Usage: Formula that Matches the Coloring of Up and Down Price Bars This example deals with doji candles. |
To post a message in this thread, you need to log in with your Sierra Chart account:
