Login Page - Create Account

Support Board


Date/Time: Fri, 29 Mar 2024 11:56:21 +0000



[Programming Help] - COULD USE SOME CODING HELP FROM USERS/SUPPORT

View Count: 848

[2019-09-07 21:56:43]
SierraFan - Posts: 84
IM USING THE HORIZONTAL LINES STUDY. I HAVE 12 LEVELS IM TRYING TO GET AN ALERT FOR WHEN PRICE COMES WITHIN 8 TICKS. IVE USED THIS CODE TO GET ONE LEVEL SUCCESSFULLY.

AND(H>=ID10.SG1-TICKSIZE*8,L<=ID10.SG1+TICKSIZE*8)

THE STUDY ALERT CONDITION SPACE TO WRITE THIS CODE 12 TIMES IS TO SMALL. I'VE ATTEMPTED THIS: http://prntscr.com/p36zvg

AND(H>=ID10.SG1,ID10.SG2,ID10.SG3,ID10.SG4,ID10.SG5,ID10.SG6,ID10.SG7,ID10.SG8,ID10.SG9,ID10.SG10,ID10.SG11,ID10.SG12-TICKSIZE*8,L<=ID10.SG1,ID10.SG2,ID10.SG3,ID10.SG4,ID10.SG5,ID10.SG6,ID10.SG7,ID10.SG8,ID10.SG9,ID10.SG10,ID10.SG11,ID10.SG12+TICKSIZE*8)

HAVE I WRITTEN THIS CORRECTLY? IF NOT I COULD REALLY USE SOME SUGGESTIONS THANK SIERRA USERS/SUPPORT
[2019-09-08 10:24:27]
Ackin - Posts: 1863
Hi,

If I understand it well, you want to have an alert at surrounding/break bar through lineX ....

The condition would have to be conceived differently than you have it. If you use only logical AND then it means that everything has to be fulfilled at that moment.

AND (H> line 1, H> line 2 ......... H> lineX, L <line 1, H <line2 ......... H <lineX)
would mean you want to have BARHigh Higher than Highest SG-Line and BARLow Higher than Lowest SG-Line ....





If you want one alert when it is (H> line1 and Low <line1) .... this for every line, you have to use "Logical OR" in the form:

OR (AND (condition1, condition2), AND (condition3, condition4) .... AND (conditionX, conditionY))

In words:
Create alert If condition 1 is met and condition 2 at the same time OR condition 3 is met and condition 4 at the same time OR .... etc


check this for inspiration:
Study/Chart Alerts And Scanning: Alert Formula Examples



If you want a better solution not via alerts, write me a Direct message and I will do it in ACSIL with user control (because the formula for so many lines will always be crazy)
Date Time Of Last Edit: 2019-09-08 10:25:19
[2019-09-09 20:16:20]
bradh - Posts: 846
You can simplify it a couple of ways:

1. Use AA3 instead of ID1.SG1@3, AB3 for ID1.SG2, etc. You can reduce the number of formula columns to get them in the K-Z range, eliminating a few more characters.

2. Sierra Spreadsheets also support the following syntax: =(M3>N3>O3), which will be a 1 only if M3 > N3 and N3 > O3
Date Time Of Last Edit: 2019-09-09 20:18:20

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

Login

Login Page - Create Account