Login Page - Create Account

Support Board


Date/Time: Sat, 04 May 2024 05:25:20 +0000



[Programming Help] - Numbers bars calculated values- duration average

View Count: 684

[2020-05-12 17:46:42]
User968625 - Posts: 256
Hello,

Whenever I use the average to get the bar duration from the number bars calculated values (e.g. 20MA for bar duration), it displays zero.
Can you advise how to solve this?

Thanks
[2020-05-13 00:08:09]
Flipper - Posts: 65
Impossible to know what you are doing without any code shown.
[2020-05-13 13:36:04]
User968625 - Posts: 256
thank you for offering to help

I have the study Number Bars Calculated values(ID44) with the variable I want to see the average fo Bar Duration (SG30) - ID44.SG1

I tried a couple of options that both put out a zero (Text display):
first, use the moving average study and chose the ID50 which chose me the list to chose from and it is there (bar duration)- Text display for a study shows 0.0

and I also tried spreadsheet formula =AVERAGE(ID44.SG30[0:-10]- Text display for a study shows 0.0

I think maybe it has to do with the number format of the Bar duration
Date Time Of Last Edit: 2020-05-13 13:38:13
[2020-05-13 14:26:09]
Ackin - Posts: 1865
I would create a study for you, but in another thread you wrote me that you don't like third-party DLLs.

"Time" needs to be converted to seconds. Moving average cannot work with this information. You can wait, if @tomgilb answers you via Spreadsheets, that should also be possible .
[2020-05-13 14:34:19]
User968625 - Posts: 256
Thanks, Ackin, Yes, I would wait for a native SC solution. I hope someone can help. have a wonderful day and thanks for the offer
Date Time Of Last Edit: 2020-05-13 14:45:24
[2020-05-13 14:39:29]
Ackin - Posts: 1865
Native SC solution:


1) Study Numbers bars Calculated Values

Total Volume SG13
Volume/Sec SG36

2) Study Study Subgraphs Divide/Ratio

- Input1 SG13 from Numbers bars study
- Input1 SG36 from Numbers bars study


"Second result" send to Moving averages study as source (based on)



have a wonderful day
Thanks, you too
Date Time Of Last Edit: 2020-05-13 14:43:16
[2020-05-13 14:46:27]
User968625 - Posts: 256
Yes, Thank you. I also found that there is a study called "Bar time duration" that when you adjust the setting for value format to time then it works. you are great. thank you

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

Login

Login Page - Create Account