Support Board
Date/Time: Sun, 19 Jan 2025 23:18:16 +0000
[Programming Help] - Last Price
View Count: 2415
[2018-05-04 18:47:43] |
User28682 - Posts: 233 |
What is the SC term used in studies programming for "Last Price"? "Last" isn't the same as "Close" is it?I know "L" means Low. Also, how would I program the last price crossing above the previous bars High? something like this? "Last Crosses from Below,(H[-1])" Thanks Date Time Of Last Edit: 2018-05-04 19:10:50
|
[2018-05-04 21:09:35] |
Sawtooth - Posts: 4157 |
Last is the same as Close for bars that have closed. In the current bar, Last is the current price. So in Simple Alerts syntax, C is both Close and Last. You could say that C is either Close or Current. You can use some spreadsheet functions in Simple Alerts, so your alert formula looks like this: =CROSSFROMBELOW(C,H[-1]) Study/Chart Alerts And Scanning: Available Main Price Graph Identifiers/Variables https://www.sierrachart.com/index.php?page=doc/SpreadsheetFunctions.html#CROSSFROMABOVE_Function |
[2018-05-04 22:27:38] |
User28682 - Posts: 233 |
I have this formula and I want to add the "CROSSFROMABOVE" function but can't get it to work. I don't know how to add your suggestion at the end of the formula? =CROSSFROMABOVE(C,L[-1]) I want the condition to trigger when "Last" crosses down below the previous bars Low *************** AND(H[-2]<=H[-3],L[-2]>=L[-3],L[-1]<L[-2],H[-1]>H[-2],I want to add it here) Any input much appreciated! |
[2018-05-05 00:30:20] |
Sawtooth - Posts: 4157 |
Just include it in the AND statement: =AND(H[-2]<=H[-3],L[-2]>=L[-3],L[-1]<L[-2],H[-1]>H[-2],CROSSFROMABOVE(C,L[-1])) |
[2018-05-05 04:36:41] |
User28682 - Posts: 233 |
Great thanks! With using CROSSFROMABOVE, does the alert only trigger on 1 cross down from above and the bar stays on alert? What happens if "C" (close) goes back above the crossover point during that bar? If I use C<L[-1]the alert will stay on the entire bar as long as its TRUE. So what is the real difference between using CROSSFROMABOVE and C<L[-1]? Thanks again! |
[2018-05-05 05:12:24] |
Sawtooth - Posts: 4157 |
If you want the alert at the close of bar, check 'Evaluate On Bar Close'. If you want the alert only at the first occurrence intrabar, check 'Alert Only Once Per Bar'. If you want the alert as often as it occurs intrabar, do not check either of the above. The CROSSFROMABOVE/CROSSFROMBELOW functions only trigger in the respective bar. Either could occur more than once intrabar but each could not occur more frequently than in every other bar. The C<L[-1] formula could be TRUE at the close in subsequent bars, and if so, you would only get an alert in the first bar, because a new alert cannot occur unless it goes FALSE first. You would need to check 'Reset Alert Condition On New Bar' to get an alert in every subsequent bar where C<L[-1] was TRUE at close of bar. |
To post a message in this thread, you need to log in with your Sierra Chart account: