Optuma Forums › Optuma Scripting › Days since last 5% swing low › Reply To: Days since last 5% swing low
August 17, 2021 at 10:15 pm
#65581
- Topics: 140
- Replies: 189
- Posts: 329
Hi Darren,
Thank you very much for all your work. The script works perfectly with TIMESINCESIGNAL(LOW()==Var2).
Here is the complete script for calculating with High/Low:
1 2 3 4 5 6 7 8 9 10 11 |
// Set the swing percentage using High/Low; Var1 = PERCENTSWING(PERCENT=5.0, CALCUSINGTOOL=High/Low); // Get the swingend values; Var2 = SWINGEND(Var1); // Count trading days since last swing low; Var3 = TIMESINCESIGNAL(LOW()==Var2); Var3 |
But there is a special issue if I change the property “Calculate Using” from “High/Low” to “Close”. The results of the script are completely wrong.
Here is the script for calculating with the Close:
1 2 3 4 5 6 7 8 9 10 11 |
// Set the swing percentage using CLOSE; Var1 = PERCENTSWING(PERCENT=5.0, CALCUSINGTOOL=Close); // Get the swingend values; Var2 = SWINGEND(Var1); // Count trading days since last swing low; Var3 = TIMESINCESIGNAL(LOW()==Var2); Var3 |
Is there something I have missed?
When I use the tool “Percent Swing Chart Overlay (PCSC)” and change the property “Calculate Using” from “High/Low” to “Close” the tool works as it should and changes the calculation from High/Low to Close.
Thanks again a lot,
Thomas
-
This reply was modified 1 year ago by
Thomas.