Support Board
Date/Time: Sun, 22 Dec 2024 15:15:45 +0000
How to detect price cross a constant on the same bar
View Count: 937
[2015-01-26 23:38:30] |
User26860 - Posts: 14 |
Hi there, After reading the documentation for quite some time, I am still unable to figure out how to write ACSIL to detect a cross over of price above or below a pre-determined constant level on the SAME bar. I tried to use sc.Close, but sc.Close[index-1] seems to give me the close price of last bar, not the last tick price as wanted, or am I missing something here? Thank you in advance! |
[2015-01-27 02:34:34] |
Sierra Chart Engineering - Posts: 104368 |
What would be the difference between the close price of the last bar and the last tick price?
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 |
[2015-01-27 04:12:54] |
User26860 - Posts: 14 |
The difference would be, for example, in an intraday daily chart, the close price of last bar is yesterday's close price, while the last price is simply the last traded price.
|
[2015-01-28 03:46:09] |
Sierra Chart Engineering - Posts: 104368 |
Here is the documentation for a crossover compared to a fixed value: https://www.sierrachart.com/index.php?page=doc/doc_ACSIL_Members_Functions.html#CrossoverBetweenArrayAndFixedValue In an Intraday chart the most reliable way to get the previous day's close is to use the Daily OHLC study: https://www.sierrachart.com/index.php?page=doc/doc_TechnicalStudiesReference.html#s137 And reference it following the documentation here: https://www.sierrachart.com/index.php?page=doc/doc_ACSILProgrammingConcepts.html#UsingStudyData 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 |
To post a message in this thread, you need to log in with your Sierra Chart account: