Why, in Multicharts tarnation, the sessionbreaks don't go all the way through all the subcharts makes me shake my head in wonder.
Here's a few lines of code that can be added to any indicator to allow for session breaks. Of course, I use TICK charts of CME globex emini - so beware, they might not work for you.
I tried using SessionLastBar, but that only gives me the last bar of the day, just like the single session break in the regular charts at 3:15 pm Chicago Time.
Also, SessionStartTime(1,1) gives an erroneous return. (ie: if the overnight session (session 1) Actually starts at 1530 Chicago Time (3:30 pm), SessionStartTime(1,1) = 1700 (5:00 pm). It's a bug. So I had to write a work around.
Also notice the use of "time_s" for tick bars (bartype = 0). It allows the code to find the proper first bar of the next session and then put a vertical trendline on the bar before. Weird, huh. If drawing and text objects were only defined by price and barnumber, things would be simpler. Or there was some reserved word that you could go back and forth between Tick barnumbers (or Volume barnumbers, or Range barnumbers, or Moonphase barnumbers, etc) and time_s. Minute bars are so 1990's stock charts. But I digress...
edit 12/27/2008 - I discovered "FindBar(Date,Time)" which tells you the bars back from CurrentBar. So there's that.
Hope this helps,
Los Altos, CA
Studies that have been contributed to the community by other users. If you’ve got something useful to share, that’s great!
3 posts • Page 1 of 1
- Posts: 375
- Joined: 12 Jul 2006
- Location: Los Altos, California, USA
- Has thanked: 31 times
- Been thanked: 12 times