Login Page - Create Account

Support Board


Date/Time: Fri, 26 Apr 2024 12:25:33 +0000



[Programming Help] - Cell Reference

View Count: 1360

[2018-01-02 21:04:14]
User612649 - Posts: 40
In the spreadsheet, how do I reference the value or tell the spreadsheet to follow the cell when doing its calculations.

Example: ID0.SG1@3
Value: 24779

I want to reference this same value when it moves down to ID0.SG1@4, or just save the value.

Absolute specifies the cell which is not what I want.
Relative will reference back to ID0.SG1@3 which is not what I want.

I want it to follow that specific cell or if I can, extract and save the value from that cell.

I tried INDIRECT(ID0.SG1@3). This didn't work.
Can I pull the content or numerical value from the cell and store it in a "J" column cell?
Date Time Of Last Edit: 2018-01-03 01:52:50
[2018-01-03 04:45:07]
Sierra Chart Engineering - Posts: 104368
Maybe someone has a suggestion, but inherently these types of things are more difficult to do with Spreadsheets as compared to ACSIL:
Advanced Custom Study Interface and Language (ACSIL)
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
[2018-01-03 06:03:29]
Sawtooth - Posts: 3976
Yes, this is possible with a spreadsheet study. You must use a Formula Column to create a persistent variable where it is brought to row 3 where you can reference it. You must use an event that can be identified with a formula, like this in P3:
=IF(AND(FRACTIME(A3)>TIMEVALUE("08:00:00"),FRACTIME(A3)<TIMEVALUE("08:01:00")),ID0.SG1@3,P4)

There are many variations to this concept. You can use a second IF statement to set it to 0. You can count bars since an event.

You could also use the NMATCH function to find an event, then return a value with the INDEX function,
using a INDEX(...NMATCH(... combination:
=INDEX(B3:B1002,NMATCH(1,93,G3:G1002,0),1)
This finds the most recent occurrence of the bar with 93 trades, and returns the Open price of that bar.
https://www.sierrachart.com/index.php?page=doc/SpreadsheetFunctions.html#NMATCH_Function
You might not need a Formula Column for this, depending on what you're doing.
[2018-01-03 13:43:48]
User612649 - Posts: 40
Thank you for your reply tomgilb,

All I am trying to do is not let the price fall below the low of the entry bar. I have my buy entry formula figured out. When my buy entry order triggers and puts me into a position, I do not want to allow price action to fall below the low of that bar.

In the Buy Exit (L3) cell, I was trying to use (ID0.SG4@3 < ID0.SG3@3). The problem that I am having is when the next bar occurs, this formula is incorrect referencing the new bar and not the first original ID0.SG3@3.

Can I put in a static stop order in at ID0.SG3@3 price point upon entry, so then I don't have to worry about keeping track of that bar, or would you suggest something different?
Date Time Of Last Edit: 2018-01-03 14:46:21
[2018-01-03 17:03:14]
Sawtooth - Posts: 3976
Can I put in a static stop order in at ID0.SG3@3 price point upon entry
Not in the same bar as the entry.

My preference would be to use an Attached Orders' trade window config so that the stop is in the market, and move it with the Trade Management by Study study referencing a spreadsheet Formula Column containing a formula that returns the price.

This requires creating a persistent variable using the concept in post #3, where in your case, the event is the entry signal bar.
=IF(K3,D3,P4)
where the above formula is in P3, and the Trade Management by Study study references SG6 (column P).
[2018-01-03 18:37:40]
User612649 - Posts: 40
tomgilb,

Thank you so so much for your help! I was able to accomplish what I was trying to by adding the "Trade Management By Study" study that you recommended.

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

Login

Login Page - Create Account