Login Page - Create Account

Support Board


Date/Time: Wed, 27 Nov 2024 22:46:39 +0000



Post From: Looking for a Simple Formula in an Alert that

[2014-10-12 18:18:00]
vegasfoster - Posts: 444
You can use an if statement and refer to the previous bar for the alert conditions, for example two moving averages as ID1 and ID2 and a colorbar based upon alert condition as ID3, can highlight color if ma1 greater than ma2 with ID1.SG1>ID2.SG1, but could also highlight the first cross and ever bar after with =if(ID3.SG1[-1]=1, 1, if(AND(ID1.SG1[0]>ID2.SG1[0], ID1.SG1[-1]<=ID2.SG1[-1]), 1, 0)). In the second formula, it is first evaluating whether the previous bar is true or not before calculating the current bar. You can use this basic concept in combination with multiple alert studies to create states that hold true until some other condition is met. That said, if it starts getting complicated and your head start spinning, then you are better off going to a spreadsheet.