In Trendlyne's Custom Parameters section, you can create an absolute value (ABS) parameter using conditional logic. Here is an example to calculate the absolute value of Day Change %:
Formula to Create ABS(Day Change %):
( ( Day change % >= 0 ) AND Day change % ) OR
( ( Day change % < 0 ) AND (- 1 * Day change % ) )
Explanation of the Formula:
1. Condition 1: (Day Change % >= 0) AND Day Change %
If the Day Change % is greater than or equal to 0, it retains its original value.
2. Condition 2: (Day Change % < 0) AND (-1 * Day Change %)
If the Day Change % is less than 0, it multiplies the value by -1 to make it positive.
3. OR Operator: Combines both conditions to ensure the absolute value is returned regardless of whether the value is positive or negative.
When using "OR" in your screener query, make sure to use parentheses to group conditions correctly.
AND and OR can be used in the screener query to combine two different parameters. When using OR, ensure that the expressions are enclosed in brackets.
Please refer to this FAQ for more details: https://help.trendlyne.com/support/solutions/articles/84000379816-what-issues-might-arise-when-using-or-in-a-screener-query-