Support Board
Date/Time: Sat, 18 Jan 2025 19:40:28 +0000
[Programming Help] - SCinput Ref pass to Tool.BeginValue
View Count: 1136
[2018-02-19 08:10:32] |
SilentH - Posts: 16 |
Hi, I'm learning ASCIL and trying to create a custom study that I pass values that will draw rectangles on my chart as support/resistance zones. I'm slowly making progress but currently stuck on this: SCInputRef UpperPriceLevel = sc.Input[2]; SCInputRef LowerPriceLevel = sc.Input[3]; UpperPriceLevel.Name = "Upper Price on Zone"; UpperPriceLevel.SetFloat(1.0f); LowerPriceLevel.Name = "Lower Price on Zone"; LowerPriceLevel.SetFloat(1.0f); Tool.BeginValue = UpperPriceLevel; Tool.EndValue = LowerPriceLevel; I know the BeginValue and EndValue are suppose to be in float, I thought I'm converting these values to floats by using .SetFloat. When I compile I get the following: F:\SierraChart\ACS_Source\DailyLevels3.cpp(120): error C2440: '=': cannot convert from 's_SCInput_145' to 'float' F:\SierraChart\ACS_Source\DailyLevels3.cpp(120): note: No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called Let me know if you have any suggestions |
[2018-02-21 19:48:38] |
User556034 - Posts: 5 |
UpperPriceLevel represents a reference to an array of values. You can't assign an array to a member of Tool expecting a single value . Try UpperPriceLevel.GetFloat() ACSIL Interface Members - sc.Input Array: sc.Input[].GetFloat() |
[2018-02-21 20:53:39] |
SilentH - Posts: 16 |
Thanks, I'll give it a try
|
[2018-02-24 15:18:21] |
SilentH - Posts: 16 |
That fixed it and I can now plot, thank you! My next step is to properly set: Tool.BeginDateTime Tool.EndDateTime currently I'm using: SCDateTime dayOpen, dayClose; dayOpen.SetDateTimeYMDHMS(2018,02,18,15,0,0); dayClose.SetDateTimeYMDHMS(2018,02,19,13,0,0); Tool.BeginDateTime = dayOpen; Tool.EndDateTime = dayClose; What I want is to have the BeginDate to be the start of the current day's evening session and the EndDate to be the end of the day session time. So in essence I'm pulling the values set for the current symbol in the global symbol settings, or just the Session Times from the Main Settings. Date Time Of Last Edit: 2018-02-24 15:18:43
|
[2018-02-24 20:25:50] |
SilentH - Posts: 16 |
So I was able to get around the start and end plot points by passing in strings. But I'm only able to get one plot of a level currently, not really sure how to get it to plot multiple levels. |
DailyLevels3.cpp - Attached On 2018-02-24 20:24:53 UTC - Size: 5.95 KB - 441 views |
To post a message in this thread, you need to log in with your Sierra Chart account: