Support Board
Date/Time: Wed, 27 Nov 2024 22:34:04 +0000
[User Discussion] - Drawing A 1x1 Square
View Count: 1063
[2023-06-16 14:46:44] |
User688525 - Posts: 259 |
Hello Sierra Chart, Can you please provide instructions on how to draw a 1x1 square with a 45 degree line drawn from one corner to the opposite side? I have had limited success achieving this with the rectangle tool. Is it also possible to draw a 1x2, 2x2, etc., square? Thank you |
[2023-06-16 19:49:19] |
John - SC Support - Posts: 36350 |
There is not an easy way to do this, but we are curious as to what you are defining as a 1 x 1. Is this 1 tick by 1 bar? If it is what we think, you would have to change your scales to make each increment large enough to be able to do what you want. In terms of drawing a 45 degree line, refer to the following: Chart Drawing Tools: Drawing a Line with a Specific Angle or Slope For the most reliable, advanced, and zero cost futures order routing, use the Teton service: Sierra Chart Teton Futures Order Routing |
[2023-06-19 10:42:28] |
User688525 - Posts: 259 |
Hi John, I'll put together a document explaining what I am trying to achieve, as well some other features/tools. Also, can custom tools be created using ASCIL? For example, would ACSIL be used to create a variation of the Price Retracement tool that instead of calculating levels based on a %, does so based on a ratio? Thank you |
[2023-06-19 11:09:59] |
Sierra_Chart Engineering - Posts: 17198 |
Please do not do this. We are not going to be adding any new features or tools. You are going to go nowhere with this. We do not need to be looking at a document. It is not going to get looked at or it would be looked many years from now and that is the literal truth. If you cannot determine how to achieve what you want, then it is just not achievable or is not easy to achieve as you want. To some extent yes: For example, would ACSIL be used to create a variation of the Price Retracement tool that instead of calculating levels based on a %, does so based on a ratio?
But we do not provide any programming help. Sierra Chart Support - Engineering Level Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy: https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation For the most reliable, advanced, and zero cost futures order routing, use the Teton service: Sierra Chart Teton Futures Order Routing Date Time Of Last Edit: 2023-06-19 11:10:52
|
[2023-06-19 14:33:37] |
JohnR - User831573 - Posts: 306 |
Soooo.... As with most things related to SC, if you think about it and learn enough about SC, there is usually a way to accomplish what you want. After digging, and trying various thought processes, I did come up with a way to do something similar to what you want to do. Change the Price levels tool from calculating % to ratios. My goal, was a fan that was based on 3 price/bar points. SC Gann fan tool only uses 2 points. Here is what I did to accomplish my goal. It is a hack, but I get what I want. You would do a similar project starting with the price replacement tool. 1 - Set up a configuration of the tool with the numbers you want for the levels and delete the rest of them. Also set the line values, color, style, etc. 2 - K E Y -- uncheck ALL of the levels -> EXCEPT <- the first one - tool. You always need this to be able to see the original drawing to be able to move change it. I made it a different color and line type to be able to see it easily. 3 - create ACSIL code that eithers starts your script via buttons or menu lines to the chart popup menu. SC provides examples for doing both. In this ACSIL code, you will do a search for a user drawn Price Retracements Tool. Once you find it, you then read the base price / bar points and other pertinent properties, then read each of the levels and get values, lines, colors, etc. still in the same set of code, Now draw a set of lines on your chart your ratio formula. You also will most likely want to write code to be able to delete that set of lines with one command button / menu choice. I chose to do this via a menu selection, while having the pointer on the bar that was the start of my drawing(s), and either deleted or deleted and then redrew, to simulate a move if it needed to match the move of the base object (Price Ret tool). Not smooth, or complete, but I have the tool I want on my charts and I have sufficient control. Also, don't forget to save the tool configuration. So, by doing it this way, I was able to retain all of the ability already built into a SC tool, in my case Pitchfork. It's ability to add, remove lines/levels, colors, etc. Basically I needed a way within SC to select 3 points and retain the ability to have all of the user popup menu, line, level and other property 'stuff' already taken care of instead of having to write all of that. I draw a pitchfork, then select a menu item to draw my fan for that bar, it reads the pitchfork info and then draws my fan, including if I use the cut ability of shortening an object. There are a few known quirks, like I needed a menu item to erase all fans, redraw all fans and change a single fans line properties to increase / decrease visibility. Your milage may vary. Hope this helps, John PS - I'm self taught C++ -- so there are surely more elegant ways to accomplish this task. |
Custom tool.png / V - Attached On 2023-06-19 13:18:59 UTC - Size: 43.4 KB - 102 views custom chart menu.png / V - Attached On 2023-06-19 14:31:47 UTC - Size: 13.05 KB - 97 views |
[2023-06-20 12:18:53] |
User688525 - Posts: 259 |
Hello John & Sierra Chart Engineering, About the 1x1 square, this is also referred to as a Gann Square whereby a 45-degree angle (1x1) is drawn from a point on the chart, either on an incline if a low is selected, or a decline if a high is selected. Other common ratios and angles are 1x2 (63.75 degrees), 1x3 (71.25 degrees), 2x1 (26.25 degrees) and 3x1 (18.75 degrees) among others. What’s important is that the angle and ratio aren’t distorted if either the X-axis or Y-axis are stretched or resized. Refer to the attached “Gann Square.png”. The above refers to standard geometric angles. It would also be ideal if the same functionality can be used for offset geometric angles whereby the offset is set by clicking on a second point. For example, clicking from a low to high will create the axis for which the angles are drawn. The reverse applies if clicking from high to low. Another ideal feature would be if a circle can be drawn with the radius being two points that have been selected. For example, if clicking from a low to high, this would be the radius, with a circle then drawn using the low to high (or high to low) as the radius. Does the above adequately explain my original post? The only way to currently draw correct angles is by using a protractor, by hand! Thank you |
Gann Square.png / V - Attached On 2023-06-20 12:18:24 UTC - Size: 3.97 KB - 92 views |
[2023-06-20 12:20:18] |
User688525 - Posts: 259 |
Hi JohnR, Thank you for your input and direction. It looks like, with some heavy lifting, that I might be able to achieve what I'm looking to do. So as to keep this thread on point, do I have your permission to message you? |
[2023-06-21 14:26:25] |
JohnR - User831573 - Posts: 306 |
Yes, you can message me directly, if you prefer. JohnR |
[2023-06-22 14:48:53] |
WarEagle - Posts: 73 |
The easiest way I have found to do this is to use the Gann Fan tool. First calculate a valid 1x1 line, your 45° angle. You can manually scale your chart if you want the square to look like a square, but I found this to be a pain and thankfully it is not necessary. With the Gann Fan tool, once you set the angle you can drag it around wherever you want and the scale will change with the chart scale because the anchors are set from the base to the future point that measures 45°. So just find two points that you know on a properly scaled paper chart would be 45° (like 1 day for 1 point or whatever) and anchor your fan with them. Then add your ratios via percentage equivalents and you will have your fan. If you really want it "square" you can then adjust the price scale to narrow or widen it visually. In the attached pics I have a square of 28 drawn with the rectangle tool (28 days by 112 points in this case) and then added the Gann Fan on top. The first one is scaled to look like a square and the second with the scale narrowed to show how the fan will adjust properly to still give the correct ratios. All you need are the points at the start of the square and the 1x1 through the other corner. I have the "Copy and Move" and "Flip Vertical" items added to my drawing tool right click menu to quickly create a new one and flip it from high to low. |
gannfan1.jpg / V - Attached On 2023-06-22 14:41:45 UTC - Size: 103.2 KB - 125 views gannfan2.jpg / V - Attached On 2023-06-22 14:41:55 UTC - Size: 39.45 KB - 103 views |
[2023-06-26 12:23:35] |
User688525 - Posts: 259 |
Hi WarEagle, Thank you for the help and instructions. Adding the "Flip Vertical" option to the chart drawing menu is a real time saver. I also came across a nifty tool called Meazure that greatly helps with drawing correct angles ( https://github.com/cthing/meazure/). |
To post a message in this thread, you need to log in with your Sierra Chart account: