Login Page - Create Account

Support Board


Date/Time: Sun, 24 Nov 2024 23:24:27 +0000



High and Low for 'Number Of Trades Per Bar'

View Count: 749

[2023-03-16 15:03:50]
4LifeNeo - Posts: 40
Hello Support,

Not sure if it's available, but I can't find a study or a thread that talks about getting the High and Low for the "Number Of Trades Per Bar". I use the "Period OHLC-Variable Period" with a time-based chart and it works great.

Previous/Period OHLC-Variable Period

However, when I switch to "Number Of Trades Per Bar" or Tick chart, the values are no longer valid. Could you please let me know how to fix this?

Thank you.
[2023-03-16 16:30:37]
John - SC Support - Posts: 36238
We are not seeing an issue with the Period OHLC - Variable Period when used on a Range chart. What is happening when you do this?
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2023-03-16 18:34:04]
4LifeNeo - Posts: 40
Thanks for testing, John.

I've not used "Range" chart, so not sure if it's the same as "Number Of Trades Per Bar". Could you try with "Number Of Trades Per Bar" chart and use, say, 2000 or 3000?

I am trying to plot a horizontal line at the high and the low of 10 bars ago starting from the current bar.
[2023-03-16 18:58:09]
4LifeNeo - Posts: 40
Actually, I went back and played with the settings and tried it on the Range bar too. And it doesn't work on the Range bar either. I think this study is probably made for a time-based chart because of the "Time Period Type" and "Time Period Length" settings. If you plot it on a 5 mins chart for example and set those settings to "Minutes" and "5" respectively, you'll see that it plots nicely the high and the low for each bar. However, if you use it on a Range bar or a "Number Of Trades Per Bar", you'll see it doesn't have a high or low for each bar, but on a random number of bars. That probably is because it's based on the input of the number of minutes. And since these types of charts are not time-based, this study doesn't work on them.
[2023-03-16 19:17:47]
User90125 - Posts: 715
@4LifeNeo,

Under File >> Data/Trade Service Settings what is your Intraday Data Storage Unit set to?
[2023-03-16 19:23:37]
4LifeNeo - Posts: 40
hey @User90125,

Thanks for trying to help. The "Intraday Data Storage Unit" is set to "1 Tick".
[2023-03-16 22:32:18]
John - SC Support - Posts: 36238
It is working on them properly, it's just that if there are multiple bars that are created within the time span, then it will include those bars. In other words, it is going to create a new line based on the time, but since a bar time for Number of Trades varies, it is going to start and end where the bar includes those times.
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2023-03-16 23:44:12]
4LifeNeo - Posts: 40
Yes, John. That's exactly what I meant in my first post. I know it works great with a time-based chart, but not the way I would like on a non-time-based chart. I thought I would point out the "Period OHLC-Variable Period" study to show that I've looked into it and to save time in case I would be asked to give it a try, but it looks like it creates confusion instead - sorry.

Anyways, maybe let me rephrase my question, is there another study or way to get the high and the low for each bar on a "Number Of Trades Per Bar" chart?

Thanks.
[2023-03-17 00:04:51]
User90125 - Posts: 715
Just overlay it from a time-based chart onto your non-time based chart, if you're certain that's the case.

Study/Price Overlay Study
[2023-03-17 01:12:34]
4LifeNeo - Posts: 40
Thanks User90125,

Unfortunately, "Study/Price Overlay Study" from a time-based chart will not help because it's already plotted using a specified time. As John said, it's plotting but it still uses the specified time period even though it's being used on a non-time-based chart. Let's say I set it to 5 mins or even at the lowest, 1 minute, and the tempo is fast so within that 1 minute, there were 3 bars of "Number Of Trades Per Bar" that were completed already. What I need is the high and low for each of those 3 bars and not the high and low for the past minute (which is what it would do even if I overlay it from another time-based chart). Hope that makes sense.
[2023-03-17 14:21:38]
John - SC Support - Posts: 36238
An easy way to do this is to use the Spreadsheet Formula, as it works on a per bar basis. You would need two instances of the study, one for the high and one for the low. Then you would enter the following formulas into the studies (1 in each one)
=H

=L

Then set the Draw Style for the subgraph to Dash.

This should get you what you want.
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2023-03-17 18:37:24]
4LifeNeo - Posts: 40
Nice, John! Thanks for the tips. However, a new issue showed up when I tried that :)

The problem is with the extension lines. It's a bit complicated, but I'll try to explain.

First, I am able to get the values for the high and the low for each bar using the way you described above (using 2 Spreadsheet formulas, one for high and one for low) and they plot the high and the low nicely on this "Number Of Trades Per Bar" chart now. However, the new issue is that when I use them in combination with the "Color Bar Based On Alert Condition".

Color Bar Based on Alert Condition

In the "Output When Condition True", I set it to "Study Subgraph Reference" and use the Study for the "high" for example as the referenced study. In the "Draw Extention Lines at Color Bar Value", I set it to "Extend to Future Intersection". This works fine with the time-based chart along with the "Period OHLC-Variable Period" as a reference for high and low, but the extension lines won't stop when using the Spreadsheet Formula on the "Number Of Trades Per Bar" chart.

Anyways, just wanted to let you know in case you want to test. I need to get back to focusing on trading instead. At least I got their values from the procedure you gave me. I'll do further testing when I have time. Thank you again and have a nice day.
[2023-03-17 21:10:00]
John - SC Support - Posts: 36238
The method you are describing to get the Extension Lines is something Tomgilb came up with.

I think the trick to making this work is that the Based On needs to be set to Main Price Graph. We tried this and it is working as expected with your setup. Let us know if you are able to get it to work.
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2023-03-19 17:52:22]
4LifeNeo - Posts: 40
Thanks, John. The studies were already set to Main Price Graph for the Based On section.

I have hidden them since the last time I tried (when the extensions won't stop at the intersection) and was thinking of going back to try again when I have time. I went back to them again today (after the SierraChart has been restarted as well) and when I unhide them, to my surprise, nothing changed. So I hit Ctrl+Insert to have the studies recalculated. And guess what happened, the lines came out the way they should be afterward - drawing at the correct high and low and will stop when they intersected with a new bar.

I was so happy, but when I made some changes to any study in the chart and hit Apply for the changes, these extensions are gone again. I have to hit Ctrl+Insert to get these extension drawings back again.

I'll see how these lines show up with real-time market data when the markets open. Not perfect, but it works for now. So, thank you again for your time. It has been helpful! :)
[2024-04-27 21:11:32]
feelingtheblues - Posts: 6
Could the "High/Low for Time Period - Extended" study have another study created that's titled, "High/Low for Bar Period - Extended"?

Line 2, "End Time", could be changed to "Number of Bars". After X number of bars, the High and Low for the bar period(s) would be drawn.

All other lines, 1, 3-10, would remain the same.
[2024-04-28 03:09:20]
4LifeNeo - Posts: 40
Maybe Donchian Channel would work for that?

Donchian Channel
[2024-04-28 18:04:13]
feelingtheblues - Posts: 6
Thank you for the suggestion. Unfortunately, that study didn't work for what I'm needing.

I'm looking to draw the high and low beginning at a time period but ending after a specific bar count. Example being, at market open, start drawing the high and low and complete the drawing after 20 renko bar closes. The start of the study is time-based but the end of the study is after X number of bars (renko or tick bars), rather than ending at a specific time.

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

Login

Login Page - Create Account