Login Page - Create Account

Support Board


Date/Time: Sat, 01 Mar 2025 07:30:38 +0000



[Programming Help] - Create a New Custom Study

View Count: 724

[2021-09-17 12:50:58]
SierraTraders - Posts: 69
Hello, Can anyone look at this study and help with this issue please

The remote build did not succeed. Result:

In file included from sierrachart.h:22,
from UTP_Pro.V4.cpp:1:
UTP_Pro.V4.cpp: In function 'void scsf_ProfitLossTextStudy(SCStudyInterfaceRef)':
scstructures.h:117:28: error: expected unqualified-id before string constant
117 | #define SCDLLEXPORT extern "C" __declspec(dllexport)
| ^~~
scstructures.h:117:28: note: in definition of macro 'SCDLLEXPORT'
117 | #define SCDLLEXPORT extern "C" __declspec(dllexport)
| ^~~
UTP_Pro.V4.cpp:18:1: note: in expansion of macro 'SCSFExport'
18 | SCSFExport scsf_ProfitLossTextStudy(SCStudyInterfaceRef sc)
| ^~~~~~~~~~
UTP_Pro.V4.cpp:26:49: error: expected ']' before ';' token
26 | SCInputRef Input_ShowClosedPL = sc.Input[7;
| ^
| ]
UTP_Pro.V4.cpp:51:3: error: 'Input_HorizontalPosition' was not declared in this scope; did you mean 'Input_VerticalPosition'?
51 | Input_HorizontalPosition.Name.Format("Horizontal Position From Left (1-%d)", (int)CHART_DRAWING_MAX_HORIZONTAL_AXIS_RELATIVE_POSITION);
| ^~~~~~~~~~~~~~~~~~~~~~~~
| Input_VerticalPosition
attachmentUTP_Pro.V4.cpp - Attached On 2021-09-17 12:48:06 UTC - Size: 4.81 KB - 281 views
[2021-09-17 13:00:33]
User907968 - Posts: 833
Attached with edits
attachmentUTP_Pro.V4.cpp - Attached On 2021-09-17 13:00:17 UTC - Size: 4.85 KB - 376 views
[2021-09-17 14:20:56]
SierraTraders - Posts: 69
Thanks for the help it has compiled and is in input list for study....... but no text on chart

As these where added to calculate the account balance

SCInputRef Input_ShowCurrentAccountBalance = sc.Input[21]; (this would be the total of IN:8 and IN:21)

SCInputRef Input_ShowStartingAccountBalance = sc.Input[22]; (This would need to type in a start balance amount)
[2021-09-17 15:41:12]
User907968 - Posts: 833
The attached code only contained the 'sc.SetDefaults' section, assumed you'd deleted the main study code for privacy reasons.
So unless you have added anything in, it will not do anything other than configure the inputs (as you've noticed).

Also, the 'return', is missing at the end of 'sc.SetDefaults'.


if sc.SetDefaults
{
/// do stuff

return;
}

[2021-09-19 10:36:30]
SierraTraders - Posts: 69
Attached is the source code for the SC Study "Trading Profit/Loss Text"
attachmentUTP_Pro.V5-2-Test.cpp - Attached On 2021-09-19 10:31:59 UTC - Size: 10.43 KB - 390 views
Attachment Deleted.

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account