/*********************************************************************************************** Title: Gann Box Script for eSignal By: Divergence Software, Inc. Web: http://www.sr-analyst.com ================================================================================================ Disclaimer: For educational purposes only! Obviously, no guarantees whatsoever and use at your own risk. **********************************************************************/ The Gann Box script allows you to create accurate Gann Boxes in any Advanced Chart and it includes a number of useful features and options. Operation is straight-forward. Load the script into any Advanced Chart, double-click on any swing-high (or swing-low) to set the anchor point and then double-click on another point in the chart and a fixed-ratio Gann Box will be drawn. Once the box has been drawn, you can use the "X" and "Y" +/- buttons that you will see at the bottom-left of the chart to resize either axis of the Gann Box to the next (or prior) pre-defined ratio. To clear a Gann Box, simply right-click in the chart and choose the "Refresh" option or double-click on a new swing-high or swing-low to start the drawing process all over again. Note that only one Gann Box can be on the chart at any given time. When a Gann Box is drawn, the Rise (e.g., the height of the Gann Box, in points) will always be displayed at the top of the box above the anchor point. The Run (e.g., the width of the Gann Box in bars) will be displayed at the lower-end of the box. The current ratio (e.g., Rise over Run) will be displayed at the top-corner of the box, opposite from the anchor point. These values will also be displayed directly to the right of the Script Title which appears at the top-left of your chart. The Gann Box script has 3 Modes of Operation: -------------------------------------------- Fixed-Ratio: This is the default setting when you load the script. In this mode, when you double-click on the second point in the chart, the script will calculate the box size based upon the pre-defined ratios and will draw the box to the ratio nearest the second point that you double-clicked on. Once the box has been drawn on the chart, you can use the "X" and "Y" +/- buttons on the chart to resize the box, again based upon the pre-defined ratios. Opt-Angle: When this mode is selected, the box will be constructed so that the primary 1/3 line (e.g., the green 1/3 line that extends from the anchor point) will be drawn to the high or low of the bar nearest the second point on the chart where you double-clicked. Note that the "X" and "Y" resize buttons are not active when you are in Opt-Angle mode so you cannot resize the Gann Box once it has been drawn. Freeform: When this mode is selected, the box will be drawn from the anchor point to precisely the second point that you double-click on in the chart. Again, the "X" and "Y" resize buttons are not available when you are in Freeform mode. Button Console -------------- Once a Gann Box has been drawn, a button control console will be drawn at the lower-left of your chart. The button control console contains several buttons which are described below: Mode Button: This is the top button on the console and it reads "fixed" by default. Click on this button to change the Gann Box Mode of Operation, as described above. If you click on this button when it reads "fixed", the Mode will change to Opt-Angle and the button will now read "opt-ang". If you click this button again, the Mode will change to Freeform and the button will read "free". This button simply allows you to change Modes without having to go into the Edit Studies menu to do so. Note that when you change Modes, the Mode will not take effect until you create your next box (by first double-clicking on the desired anchor point and then double-clicking on a second point in the chart). Grid Button: This is the second button down on the console and it reads "grid". This button is simply a toggle that allows you to turn the Gann Box grid display On and Off. Mirror Button: This is the third button down on the console and it reads "mirror". When you click on this button the first time, it will draw a mirrored set of Gann Lines in your Gann Box. When you click on it a second time, it will remove the mirrored lines. "Y" Button: This button allows you to resize the Y Axis (e.g., Price Axis) of the Gann Box when you are in Fixed-Ratio mode. Click on the "+" button to increase the height of the Gann Box. Click on the "-" button to decrease the height of the Gann Box. "X" Button. This button allows you to resize the X Axis (e.g., Time Axis) of the Gann Box when you are in Fixed-Ratio mode. Click on the "+" button to increase the width of the Gann Box. Click on the "-" button to decrease the width of the Gann Box. Gann Box Script Parameters -------------------------- You can access the script parameter menu by right-clicking in your chart and selecting the Edit Studies option. Select the Gann Box study from the drop-down box at the top-left of the Study Properties dialog and the Gann Box menu parameters will be displayed. Ratio #1 through #6: These are the ratios used by the Gann Box script when the script is being used in Fixed-Ratio Mode. You can change these, as needed. The only requirements are that each ratio MUST be a number that is greater than 0 and less than 10. Also, all 6 ratios MUST be used and the ratios MUST be in ascending order. 1/1 Line Color: Select the color to be used for drawing the 1/1 Gann Lines in the Gann Box. 1/2 Line Color: Select the color to be used for drawing the 1/2 and 2/1 Gann Lines in the Gann Box. 1/3 Line Color: Select the color to be used for drawing the 1/3 and 3/1 Gann Lines in the Gann Box. Box Color: Select the color to be used for drawing the actual Gann Box. Grid Color: Select the color to be used for drawing the grid inside the Gann Box. Text Color: Select the color to be used for drawing the Rise, Run and Ratio numbers. Line Thickness: Adjust the line thickness of the Gann Box, Gann Lines and Grid. Type: Select the Mode to use for drawing the Gann Box. Select from Opt-Angle, Freeform and Fixed-Ratio. The default is Fixed-Ratio. Show Box? Draw the actual Gann Box? Select "T" (True) or "F" (False). Show Grid? Draw the internal Gann Box Grid? Select "T" (True) or "F" (False). Show Gann Lines? Draw the Gann Lines in the Gann Box? Select "T" (True) or "F" (False). Show Mirror Lines? Turn Gann Lines mirroring on? Select "T" (True) or "F" (False). Show Buttons? Display the button control console at the lower left of your chart? Select "T" (True) or "F" (False). Button Vert Offset: Adjust the button control console up or down on your chart by changing this number.