Optuma Forums › Optuma Scripting › Gann Swing – Show Bar › Reply To: Gann Swing – Show Bar
February 1, 2017 at 10:26 am
#28611
- Topics: 5
- Replies: 616
- Posts: 621
The results in the red box appear to be due to the how normal High() data lists join to the Swing list when using High() >= SWINGSTART(), and where the criteria is placed in the script.
The following modified scripts should provide the results you are after:
Bull Script
1 2 3 4 5 6 7 8 9 10 |
GS1 = GANNSWING(METHOD=Use Next Bar, USECLUSTERS=False, USEBREAKOUT=False); // current swing is Up swing SWINGUP(GS1) and // current up swing's low is higher than previous up swing's low. preivous up swing is offset by 2 SWINGEND(GS1, OFFSET=1) >= SWINGSTART(GS1,OFFSET=2) and // current high breaks above previous swing high (High() >= SWINGSTART(GS1,OFFSET=1)) and SWINGSTART(GS1) >= SWINGSTART(GS1,OFFSET=2) |
Bear script
1 2 3 4 5 6 7 8 9 10 |
GS1 = GANNSWING(METHOD=Use Next Bar); // current swing is Down swing SWINGDOWN(GS1) and // current down swing's high is lower than previous down swing's high. SWINGSTART(GS1) <= SWINGSTART(GS1,OFFSET=2) and // current low breaks below previous swing low (Low() <= SWINGSTART(GS1,OFFSET=1)) and SWINGEND(GS1, OFFSET=1) <= SWINGSTART(GS1,OFFSET=2) |
With your other question – (would > than 0.01c be a way to limit even highs?)
I think we could replace High() >= SWINGSTART() with (High() – SWINGSTART(GS1,OFFSET=1) > 0.01)