Login Page - Create Account

Support Board


Date/Time: Sat, 04 May 2024 23:22:00 +0000



[Programming Help] - SPREADSHEET FORMULA HELP

View Count: 1430

[2020-02-22 20:28:00]
User597941 - Posts: 6
I am new to spreadsheets and am trying to make a buy entry that occurs after price opens with a green bar, makes a high, then makes a low that does not extend below the opening price, then buys at the break of the high. What I have so far is:

=AND(ABS($J$8)=0,AA3>0,AB3>0,T3=1)

POSITION QUANTITY GREATER THAN 0, SWING HIGH TRUE (indicator in AA3), SWING LOW TRUE (indicator in AB3), CANDLE IS GREEN (formula in T3)

This obviously won't work as it says all conditions must apply at the same time for a buy.

How would I say "if opening candle is green and there is a swing high, followed by a swing low that doesn't break below the open price, then buy break of the swing high"? Also, how would I cancel the setup if price does extend below the low of the opening candle?

Any help would be appreciated!
[2020-02-22 22:26:14]
User48838 - Posts: 112
This is where I started with that type of problem

https://www.sawtoothtrade.com/example-9.html
[2020-02-23 02:48:38]
Sawtooth - Posts: 3993
Locking the TRUE state of a formula condition can only lock a TRUE, not a value.

I would approach this by creating a persistent variable of each of the conditions in their own Formula Column, then reference each in the K3 formula.
You'll need a persistent variable of:
- TRUE if the Opening Candle is green.
- the Opening Candle's Open price.
- TRUE when the Swing High occurs at or subsequent to the Opening Candle.
- the Swing Low's price at or subsequent to the Swing High going TRUE.
Some of the above persistent variables will need to be released, which will essentially cancel the setup.

Here are some examples of persistent variable formulas:
Spreadsheet Example Formulas and Usage: Persistent and Incrementing Variables

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

Login

Login Page - Create Account