Login Page - Create Account

Support Board


Date/Time: Thu, 28 Nov 2024 13:33:15 +0000



[Programming Help] - Spreadsheet Trading Price Cross a fixed level

View Count: 575

[2023-04-02 21:06:50]
User763002 - Posts: 27
Hi,

I am looking to see if its possible to have a formula for when a price crosses a fixed price level? All of the crossover functions require ranges.

Right now I have a column for each price level and the range is just the level, level-1 and level-2, but I am not sure if I am missing something simpler to complete the same task.

Thanks
[2023-04-03 13:08:15]
Sawtooth - Posts: 4120
All of the crossover functions require ranges.
This is because the crossover functions must compare the current bar with a previous bar.
IOW, there is no intrabar crossover because intrabar values cannot be made persistent in a spreadsheet study; only close of bar values are persistent.

If the levels are the same in at least rows 3 and 4, then the crossover functions will do what you want.
[2023-04-03 23:25:43]
User763002 - Posts: 27
awesome thank you very much!
[2023-04-12 14:01:37]
ForgivingComputers.com - Posts: 960
You can also do your own crossover by looking at the previous bar and comparing it to the last bar:

Assume your fixed price is H3.

Cross from Below:

=IF(AND(E4<=H3,E3>H3),1,0)

Cross from Above:

=IF(AND(E4>=H3,E3<H3),1,0)

[2023-04-21 15:09:06]
User763002 - Posts: 27
Similar question as before, but now about the anchors on the chart drawings.

I have a bunch of levels drawn on a chart, each one has a specific anchor number. It is possible on the spreadsheet to just keep the anchor number as a variable so any time price crosses any anchor on the chart a signal fires?

Right now I have the logic for 5 levels per chart, but they need to get updated daily. It would streamline things a lot if I could just place them on the chart and let some spreadsheet logic do the rest.

Thanks
[2023-04-21 15:27:00]
John - SC Support - Posts: 36350
You can not get the drawing information directly into a spreadsheet study.

But, you could reference the Anchor points in a "Spreadsheet Formula" and then that Spreadsheet Formula will be available in the Spreadsheet study. Keep in mind the Spreadsheet Formula uses the Alert Syntax, which does have a way to reference the drawing anchors (and other values). Refer to the following:
Study/Chart Alerts And Scanning: Referencing Chart Drawings

For example, to get the first anchor price in a line with drawing ID of -4, you would enter the following for the formula in the Spreadsheet Formula:
=UDID[4].A1
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2023-04-21 16:32:34]
User763002 - Posts: 27
Thanks John,

Is it possible to use wildcards in the formulas to reference every anchor on the chart? Thought being if there are 15 price levels it would be simplier to just have something like =UDID[*].A1 then having to include every single anchor on the chart.

Thanks
[2023-04-21 17:29:52]
John - SC Support - Posts: 36350
You can not use wildcards. You would have to use a new Spreadsheet Formula study for each drawing you want to reference.
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2023-04-21 17:57:33]
User763002 - Posts: 27
thank you, that is what I thought. Would it be possible to use ACSIL to reference any drawing on the chart? or is it also drawing specific on there as well?

Thanks and Thank you for the quick and Helpful info.
[2023-04-21 20:09:13]
John - SC Support - Posts: 36350
You could do this using ACSIL as well. Refer to the following section regarding drawing tools with ACSIL:
Using Drawing Tools From an Advanced Custom Study
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing

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

Login

Login Page - Create Account