Login Page - Create Account

Support Board


Date/Time: Sat, 04 May 2024 00:27:54 +0000



[Programming Help] - storing low of past candle in a spreadsheet

View Count: 1393

[2017-08-29 04:22:30]
aydex - Posts: 110
Hi,
In a Spreadsheet System for Trading, how can I capture the price of the low of the entry candle, and set it as a stop?
When use =D3 in the Buy Exit column L, after another candle is created, it updates to the low of the current candle.
I'm not sure there is a way to store that value, is there?
[2017-08-29 11:18:15]
Sawtooth - Posts: 3993
Try this, in a Formula Column e.g. P3:
=IF(K3,D3,IF(M3,0,P4))

This will create a persistent variable of the low of the buy entry candle, and release it at a sell entry candle.
[2022-12-11 20:14:14]
User103448 - Posts: 69
@Tomgilb

ive tried to use this command for a short trade with same logic and used:

=IF(M3,C4+0.5,IF(K3,0,X4)), to set the stop loss above last candle.

Using Cell X instead of P. I have noticed that on replay mode, short trade is triggered but in Cell M3 there still a 0 shown.

=IF(K3,D3,IF(M3,0,P4)) works well for buy signals.

Any Ideas?

Thanks a lot!
[2022-12-11 22:22:34]
Sawtooth - Posts: 3993
I have noticed that on replay mode, short trade is triggered but in Cell M3 there still a 0 shown.
M3 will have gone TRUE/1 for the short to be triggered. It might return to 0 before close-of-bar.
How is Signal Only On Bar Close (K,M) set?

A spreadsheet study cannot make an intrabar event persistent; the condition must exist at close-of-bar.
[2022-12-12 12:11:28]
User103448 - Posts: 69
Signal Only On Bar Close (K,M) is set to "NO".

Same behaviour happening for buy signals now.

The condition is very simple:

=AND(J8=0,E4<AN4)

Where AN4 is lower BB-Band.
[2022-12-12 14:01:13]
Sawtooth - Posts: 3993
Same behaviour happening for buy signals now.
This is expected, since Signal Only On Bar Close (K,M) is set to "NO".

From post# 4:
A spreadsheet study cannot make an intrabar event persistent; the condition must exist at close-of-bar.

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

Login

Login Page - Create Account