Optuma Forums › Optuma Scripting › Using Pivot(), but Not Working with Other Signals › Reply To: Using Pivot(), but Not Working with Other Signals
August 14, 2019 at 2:35 pm
#54295
- Topics: 5
- Replies: 625
- Posts: 630
Hi May,
To do this you need to use a few functions: Pivots, NONZero and IF. In the example below I’ve included some comment lines showing what each line is doing:
1 2 3 4 5 6 7 8 9 10 |
//Set Pivot Value - High Only - Remove Zeros V1 = NONZERO(PIVOT(MIN=12, TYPE=High)); //Set Previous Bars Pivot Value V2 = V1[1]; //Set Current Pivot Value - Previous Bars Pivot Value V3 = V1 - V2 ; //When Pivot Value changes find the difference IF(V1 <> V2,V3,0) |
You can see how the above script looks when applied to a Show View: