Login Page - Create Account

Support Board


Date/Time: Fri, 03 May 2024 12:53:39 +0000



[User Discussion] - Ask volume Bid volume difference text

View Count: 1113

[2019-11-15 06:51:59]
DevTrader79 - Posts: 44
I want to display only number such as (234 instead of -234.00 without decimals and sign[-] negative and for positive 97 instead of 97.00) . Went to function studies8.cpp->scsf_AskVolumeBidVolumeDifferenceText(SCStudyInterfaceRef sc).
(1) do I have to set sc.DrawZeros = 0; or false; to turn off decimal zeros and display only number ?
(2) Couldn't figure out how to turn off the sign, especially (-) negative sign.
Any help is highly appreciated.
Thanks
[2019-11-15 08:32:38]
User907968 - Posts: 802
1) To drop trailing zeros from study subgraph output display:

In ACSIL use variable 'sc.ValueFormat', refer -
- ACSIL Interface Members - Variables and Arrays: sc.ValueFormat
or
From study settings window, refer -
- Chart Studies: Settings and Inputs Tab >> Value Format

2) To remove (-) negative sign you could change the study code so that all the values stored in the subgraph array are positive:

For example (using scsf_AskVolumeBidVolumeDifferenceText)

replace
Subgraph_Difference[sc.Index] = sc.AskVolume[sc.Index] - sc.BidVolume[sc.Index];

with
if (sc.AskVolume[sc.Index] > sc.BidVolume[sc.index])
    Subgraph_Difference[sc.Index] = sc.AskVolume[sc.Index] - sc.BidVolume[sc.Index];
  else
    Subgraph_Difference[sc.Index] = sc.BidVolume[sc.Index] - sc.AskVolume[sc.Index];

[2019-11-15 19:12:11]
DevTrader79 - Posts: 44
Thanks for getting back to me soon. Sounds good
Possibly I will inject code like this.
It is a great help highly appreciated.

if (sc.SetDefaults)
{
// initialization existing code
}
sc.ValueFormat = 0; // my addition no decimal
if (sc.AskVolume[sc.Index] > sc.BidVolume[sc.index])
Subgraph_Difference[sc.Index] = sc.AskVolume[sc.Index] - sc.BidVolume[sc.Index];
else
Subgraph_Difference[sc.Index] = sc.BidVolume[sc.Index] - sc.AskVolume[sc.Index];
// then the rest as it is
if (Input_DisplayAboveOrBelow.GetIndex() == 0)
{
//existing code
}

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

Login

Login Page - Create Account