Fit full price history on chart w/o having to scroll
Author: betatester
Creation Date: 9/28/2020 2:04 PM
profile picture

betatester

#1
Hello, I have a strategy that changes background color when a signal triggers on a weekly time frame for the S&P 500. My chart window is approximately 800px wide. No matter how much I minimize bar spacing, I can only fit about 10 years of history on the chart, then need to scroll to see past signals. Is there a way to get the bar spacing so that I can fit the entire price history into the chart?
profile picture

Eugene

#2
Hi,

You might have noticed how this is solved by various charting websites. To fit the whole history they step up the time frame. You can do the same by switching to Monthly, Quarterly or Annual charts.
profile picture

Eugene

#3
No way to affect it programmatically in a strategy:
CODE:
Please log in to see this code.
profile picture

betatester

#4
That doesn't always work. E.g. I reference an external indicator showing FOMC meeting dates. They show fine on daily, but when changing to a weekly time frame, they disappear.
profile picture

Eugene

#5
This is pretty expected if the Weekly (Quarterly, whatever) ending date is different from the FOMC meeting date. But it's an altogether different problem which can be approached in a different forum topic (e.g. Trade on Fed (FOMC) Announcement Dates) or you can start a new one if your code is different.
profile picture

betatester

#6
The (e.g. Trade on Fed (FOMC) Announcement Dates) thread wasn't anything like I was referencing. I started a new thread with the code, and that was deleted after a response that didn't address the topic (though which I tried anyway with no success). I could find no other threads which addressed this specific issue.

My code points to a daily time series file when a date (typically a Wednesday) shows a 1 when the condition is triggered. All other days show a zero. When plotting this on a daily time frame chart, it works fine. When changing to weekly to get a broader perspective, it disappears because it doesn't recognize that Wednesday was part of that week. All I'm looking for is a way to display more history than is currently allowable.
profile picture

Eugene

#7
Let's continue conversation in the topic that you've created:

Displaying indicator in higher time scale with missing date

Disregard "my" response to it (already deleted): my auto-response bot kicked in but that was a false positive (it mistakenly recognized your post as a known bug).
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).