Login Page - Create Account

Support Board


Date/Time: Wed, 15 Jan 2025 21:46:48 +0000



SPreadsheet function - bars since entry

View Count: 1827

[2017-09-16 03:24:39]
vectorTrader - Posts: 86
I am trying to use a spreadsheet since I do not know how to code in sierra. I am trying to take trades and then exit based on x bars later. Is there a way to do that? I tried counting the number of bars $j$8>0 but that always gave me 1000. I cant seem get it right.
[2017-09-16 19:07:06]
Sawtooth - Posts: 4153
J8 is not relative to any one bar so you'll need to count bars since the entry signal's bar with a formula like this (for long entries), e.g. in cell P3:
=IF(K3,0,P4+1)
Then reference P3 in your exit formula:
=AND($J$8>0,P3>=5)

This only works if signals are at close of bar.
[2017-09-17 03:06:19]
Sierra Chart Engineering - Posts: 104368
What about using the elapsed time since entry? That can be calculated.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2017-09-17 23:24:25]
vectorTrader - Posts: 86
I cannot use time based as my strategy is using volume bars. Its great to know MFE buy I am looking for signal decay and knowinfg how many bars to MFE is very helpful.

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

Login

Login Page - Create Account