Support Board
Date/Time: Fri, 28 Feb 2025 13:51:50 +0000
Accessing retracement/projection price with ACSIL
View Count: 2256
[2016-07-17 17:00:59] |
User162368 - Posts: 3 |
Hi, I'm working on a trading system that is using the retracement tool. Is there a way of accessing the price of the different retracements/projections levels from the s_UseTool instance that I created, without having to store them myself when I create the instance? |
[2016-07-17 23:30:36] |
|
Yes this can be accessed with the s_UseTool::RetracementLevels member.
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, *change* to the Teton service: Sierra Chart Teton Futures Order Routing Date Time Of Last Edit: 2016-07-17 23:30:50
|
[2016-07-18 21:16:58] |
User162368 - Posts: 3 |
I am using the s_UseTool::RetracementLevels to set the percentage levels and other visual properties of the retracement tool, but I can't seem to get the PRICE of the levels.
|
[2016-07-18 21:39:22] |
|
You should have no trouble with this. Show us the code you are using to get the prices. 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, *change* to the Teton service: Sierra Chart Teton Futures Order Routing |
[2016-07-19 16:38:53] |
User162368 - Posts: 3 |
Well, right now I am calculating the price from the fib levels, like so SCFloatArrayRef fib1LevelValues = sc.Subgraph[0].Arrays[0]; SCFloatArrayRef fib2LevelValues = sc.Subgraph[1].Arrays[0]; Tool.RetracementLevels[0] = 100.0f; Tool.RetracementLevels[1] = 61.8f; Tool.RetracementLevels[2] = 50.0f; Tool.RetracementLevels[3] = 38.2f; Tool.RetracementLevels[4] = 23.6f; Tool.RetracementLevels[5] = 0.0f; // Store price for fib1 levels for (int i = 0; i<6; i++) { // Get the retracement level float a = Tool.RetracementLevels[i]; // Calculate the price for current retracement level float price = Tool.BeginValue - (Tool.BeginValue - Tool.EndValue) * (a / 100); // Set tick size float tickSize = 0.25; // Round price to the nearest tick fib1LevelValues[i] = price - fmod(price, tickSize) + ((fmod(price, tickSize) < tickSize / 2) ? 0.0 : tickSize); } [/i][/i] I cant find anything in the documentation about getting the price from the RetracementLevels array, only visual properties. But maybe I'm looking in the wrong place? |
[2016-07-19 17:25:05] |
|
You need to get the Chart Drawing using this function: https://www.sierrachart.com/index.php?page=doc/doc_ACSILDrawingTools.html#scGetUserDrawnChartDrawing You can then use the RetracementLevels array to access the values. 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, *change* to the Teton service: Sierra Chart Teton Futures Order Routing Date Time Of Last Edit: 2016-07-19 17:26:20
|
[2021-08-24 17:01:54] |
User485461 - Posts: 9 |
@User162368 Hi, I'm trying to draw price retracement on every daily candle with only one level. Do you know is there a way to get it. |
To post a message in this thread, you need to log in with your Sierra Chart account: