Optuma Forums › Optuma Scripting › Gann Swing – Show Bar › Reply To: Gann Swing – Show Bar
January 30, 2017 at 1:03 pm
#28567
- Topics: 5
- Replies: 616
- Posts: 621
Hi Jonathan,
Thank you for your post.
There are two main issues i can see in the script, the first is with SWINGUP(). It should be SWINGUP(GS1).
Secondly, looking at your screen shot you are using Gann Swing Settings of Use Outside Bar however the script is set to Use Next Bar. I’ve kept the adjusted scripts to Next Bar, but if you are comparing them to your chart you will need to update the Gann Swing Overlays settings.
I believe the following scripts are what you are after…
To Buy
1 2 3 4 5 6 7 8 9 |
GS1 = GANNSWING(METHOD=Use Next Bar); // current swing is Up swing SWINGUP(GS1) and // current high breaks above previous swing high (High() > SWINGSTART(GS1,OFFSET=1)) and // current up swing's low is higher than previous up swing's low. preivous up swing is offset by 2 SWINGSTART(GS1) > SWINGSTART(GS1,OFFSET=2) |
To Sell
1 2 3 4 5 6 7 8 9 |
GS1 = GANNSWING(METHOD=Use Next Bar); // current swing is Down swing SWINGDOWN(GS1) and // current low breaks below previous swing low (Low() < SWINGSTART(GS1,OFFSET=1)) and // current down swing's high is lower than previous down swing's high. SWINGSTART(GS1) < SWINGSTART(GS1,OFFSET=2) |