Login Page - Create Account

Support Board


Date/Time: Tue, 23 Jul 2024 23:18:23 +0000



Moving Average Simple with SCDateTime input

View Count: 1333

[2015-07-26 22:04:31]
User53601 - Posts: 105
I have the following studies in the Graph :

1.)  Bar Time Duration

2.)  Moving Average Simple
- Input data is subgraph from BarTimeDuration study – DURATION, which is a SCDateTime type

So far I got the moving average from Bar Time duration.

Now I wanted to get this subgraph to my ACSIL study. However, I have some problem, I get zero values only.


Here I imported the Bar Time Duration Average
sc.GetStudyArrayUsingID(3,0,BarTimeDurationAverage);

Then I wanted to get the value from BarTimeDurationAverage array.

I am not sure what is the type of output Subgraph AVG in the Moving Average Simple,
whether it is SCDateTime or float type or something else.

That is why, I tried these two ways how to get the Moving average values, however, both ways give me zero values:

as INT variable: TIME_PART(BarTimeDurationAverage[sc.Index]
as FLOAT variable: BarTimeDurationAverage[sc.Index]

can you help with this, thank you
[2015-07-27 04:56:50]
Sierra Chart Engineering - Posts: 104368
The Bar Time Duration Subgraph contains SCDateTime values stored as 4-byte floating-point values.

How have you defined this:
BarTimeDurationAverage

And if you check the size of it after getting the array, is it zero?


Both of these are valid:
as INT variable: TIME_PART(BarTimeDurationAverage[sc.Index])
as FLOAT variable: BarTimeDurationAverage[sc.Index]

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: 2015-07-27 04:57:26
[2015-07-27 21:26:31]
User53601 - Posts: 105
(I used this definition: SCFloatArray BarTimeDurationAverage )

I did another check, and found out the values are correct, my excuse.


However when I want to display the value, it gives me the zero value:

sc.FormatString(Text01," %.1f ", BarTimeDurationAverage[sc.Index] )
[2015-07-28 05:31:02]
Sierra Chart Engineering - Posts: 104368
Where is the mistake? For the formatting string, only use %f. You need at least six digits of precision.
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
[2015-07-28 07:46:27]
User53601 - Posts: 105
Now it is clear, thank you.

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

Login

Login Page - Create Account