Login Page - Create Account

Support Board


Date/Time: Fri, 19 Apr 2024 19:31:17 +0000



[Programming Help] - Spreadsheet Trading not recording values correctly?

View Count: 549

[2019-12-01 20:50:57]
J4yTr4der - Posts: 20
I'm assuming I must not be understanding something correctly, but I thought I should ask here in case there is something wrong.

I've been trying to use Spreadsheet Trading lately for a few different things. But in reading the documentation, something doesn't seem to be behaving correctly.

For example, the spreadsheet has columns K through N, labeled Buy Entry, Buy Exit, Sell Entry, and Sell Exit. And the documentation says things like this:

Formula to Count Bars Since An Event

The following formula will count the number of bars since a Buy Entry event occurred (cell K3). This will also stop counting if a Sell Entry event occurs (cell M3). This could be used to cancel an unfilled Order at some number of bars.

The formula below would be entered in cell P3.

=IF(M3, 0,IF(OR(K3, P4 > 0), P4 + 1, P4))

This seems to say that there should be values in K3 and M3 if a long trade is entered and exited. But these cells are always empty for me. Even when a trade enters or exits, they never have anything in them.

Ideally I am trying to define time based exits. I see that there is a field which contains the last entry date/timestamp, but I haven't been able to figure out how to subtract it from the current time in order to determine how long it's been since the trade was opened. I found the above documentation passage looking for solutions since it was about number of bars since trade entry and came up in my searches.

What am I missing with this? How is it supposed to work? So far I just don't understand it.
[2019-12-01 21:51:37]
J4yTr4der - Posts: 20
I managed to finally get the time difference from entry I was looking for. But I'd still like to know why cells K3 through n3 are always empty.
[2019-12-02 00:27:15]
Sawtooth - Posts: 3975
The 'Formula to Count Bars Since An Event' example assumes there is an event (a cell that goes TRUE) in columns K and M.

Column K contains the Buy Entry formula that returns a non-zero value to signal an entry long.
Column M contains the Sell Entry formula that returns a non-zero value to signal an entry short.

Columns L and N are for respective exit formulas.

All formulas in Formula Columns K-Z...BR are entered in row 3.
[2019-12-02 00:33:29]
j4ytr4der_ - Posts: 914
Ohhhh hang on a sec. I think what you're saying is that I need to put my entry/exit formulas in those cells manually? I thought they were supposed to be automatically populated like much of the rest of the sheet.

If that's the case then no problem I'll just stick my formulas in there. Thanks!
[2019-12-02 00:41:53]
Sawtooth - Posts: 3975
I need to put my entry/exit formulas in those cells manually?
Yes.

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

Login

Login Page - Create Account