Login Page - Create Account

Support Board


Date/Time: Sat, 27 Apr 2024 18:57:47 +0000



Pull Multiple Timeframes into a Single Indicator

View Count: 1989

[2020-05-14 01:42:45]
User497645 - Posts: 7
Hello,

I am working on a custom indicator, nothing fancy its 5 colored layers that reflect various moving average positons. What I want to achieve is have each moving average reflects a different time zone. See attached image for how this indicator looks.

Initially in the settings, my goal was to add "timeframe" so that I could set type, period, and time for each moving average. But I believe this cannot be done, adding multiple time-frames (MTF) into the indicator directly. Each timeframe has to be added via the chart, so using Study/Price Overlay.

Using the Study/Price Overlay is fine, but it only allows one timeframe to be selected for the indicator as a whole, so all 5 layers ar set to either chart time, or Study/Price Overlay time. My goal is to have one timeframe per Layer, each of the colored bars.

I can of course just create the indicator with 1 Layer, and add 5 of them but this defeats the purpose and is quite messy on the charts.

So the question is there a way I can reference multiple timeframes to a single indicator, either via Study/Price Overlay or similar or via specific indicator coding?

Thanks Marc
Date Time Of Last Edit: 2020-05-14 01:50:11
imageMALaerSettings.PNG / V - Attached On 2020-05-14 01:42:19 UTC - Size: 89.34 KB - 417 views
imageMALayer1.PNG / V - Attached On 2020-05-14 01:42:24 UTC - Size: 250.98 KB - 452 views
[2020-05-14 02:36:19]
Sierra Chart Engineering - Posts: 104368
For every different timeframe per bar of a particular study in another chart, you want to include in the chart, you are going to need a separate Study/Price Overlay Study for that.
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
[2020-05-14 04:03:07]
User497645 - Posts: 7
Thanks for the support,

I understand that I will have to add multiple Study/Price Overlay studies, one per timeframe.

However, in the indicator settings when I assign the "based on" to another timeframe, it changes the timeframe for the whole indicator, all MAs with the indicator.

Is it possible to code the indicator, so that once I have added multiple Study/Price Overlay studies, I can select a different timeframe per each MA in the one indicator?

Thanks
[2020-05-14 18:41:41]
Sierra Chart Engineering - Posts: 104368
However, in the indicator settings when I assign the "based on" to another timeframe, it changes the timeframe for the whole indicator, all MAs with the indicator.
We are not understanding this. Or at least it is not making sense to us.

Is it possible to code the indicator, so that once I have added multiple Study/Price Overlay studies, I can select a different timeframe per each MA in the one indicator?
This is not entirely clear for us because we cannot see exactly what you are doing, but in the case of an ACSIL study, it can certainly reference multiple Study/Price Overlay studies.
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: 2020-05-15 19:27:31
[2020-05-15 12:04:07]
User497645 - Posts: 7
Please take a look at the attached screenshot. There must be a way to have a single indicator pull in multiple different timeframes, especially if using ACSIL.

I found this online, You are able to add multiple instances of the Study/Price Overlay study in order to overlay multiple price graphs and studies from other charts.

Once you have all of the chart bars and/or studies overlayed on the destination chart, then the next step is to reference the data in your custom study. Below is a code example that demonstrates this. The primary function that is used is sc.GetStudyArrayUsingID.

Referencing Other Time Frames and Symbols When Using the ACSIL

Then just create a dropbox or similar in the setting and inputs tab, so that you can connect the various Study/Price Overlays to the MA Layers, 1,2,3,4,5.

Thanks again, appreciate the help and support.
Date Time Of Last Edit: 2020-05-15 12:04:39
imageScreen Shot 5-15-2020 at 9.55 PM.png / V - Attached On 2020-05-15 12:04:31 UTC - Size: 336.05 KB - 398 views
[2020-05-15 19:09:51]
JohnR - User831573 - Posts: 300
Here is the URL for the area of the docs that describes using data and/or studies from another chart that can be based on a different timeframe. There is sample code there to get one (data or study subchart value). You would have to replicate each part of the code for each timeframe you want. So... you can solve your dilemma this way. You create a 2nd, 3rd, 4th, etc. chart each with a different timeframe. Then access those data(s) in your "main" study as the data source - a different one for each avg you want to calculate, or how ever you want to use this data. This will allow you to have all of the inputs for the various parameters in one study.

Referencing Other Time Frames and Symbols When Using the ACSIL

Hope this helps.
JohnR
[2020-05-15 19:18:28]
Sierra Chart Engineering - Posts: 104368
It sounds like you know what to do in post #5.

There must be a way to have a single indicator pull in multiple different timeframes, especially if using ACSIL.
Yes you can do this in ACSIL in a single study as you understand in post #5.
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

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

Login

Login Page - Create Account