Login Page - Create Account

Support Board


Date/Time: Tue, 14 May 2024 20:25:58 +0000



Post From: How to reference a Spreadsheet output in a Color Bar Based on Alert study

[2018-11-05 09:56:55]
DaxTrader54 - Posts: 8
Hi guys, I have a trading strategy that I have automated on Sierra charts.

The strategy is a stop and reverse strategy which stays in a BUY mode or SELL mode for some time, perhaps 40-50 candles. Whilst the strategy is in a BUY mode, it may offer 6-10 buy signals. Whilst the strategy is in a SELL mode, it may offer 6-10 sell signals. What I want to do is build an alert for when we change from the BUY mode to the SELL mode and vice versa.

So I have a column (M) which records the current signal as either a '1' or a '2' based on the most recent signal being a buy or a sell.

This is based on a simple IF statement, referring to my K and L columns (these columns are grabbing my buy/sell signals from the spreadsheet):
=if(K3>0,1,if(L3>0,2,M4))

Now, I want to put an arrow on the chart (using the Color Bar Based on Alert Condition study) when it flips from a buy to a sell, or when it flips from a '2' to a '1'. So I would compare the two most recent numbers in the (M) column, to see if they have changed or not.

Currently the spreadsheet study is ID14 and the (M) column is SG3.

I was thinking I could use two Color Bar Based on Alert Condition studies, with one including something like:
=and(id14.sg3[-1]=1,id14.sg3=2)

and the other saying
=and(id14.sg3[-1]=2,id14.sg3=1)

But this is not working for me. It seems that when I reference the spreadsheet study column (using the id14.sg3) in the Color Bar Based on Alert Condition study, it is not seeing a 1 or 2, so perhaps I am misunderstanding the array, or what data is stored in the array?

My question remains: How do I refer to the spreadsheet study's formula column 'value' or 'output' in the Color Bar by Alert Condition study?

Any help would be appreciated (assuming I have provided enough background.

Regards