Announcement

Collapse
No announcement yet.

setChartBG() vs setBarBgColor()

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • setChartBG() vs setBarBgColor()

    Presently, my 15 minute chart background (BG) color changes via an efs using setChartBG(), based on the condition of a 60 minute study. Then I view the same study in a 15 minute interval underneath the chart and change the BarBgColor of the last 10 bars of the study based on its condition. I have this setup in 30 mini charts. The idea is, when the price BG and study BG colors match, I know the conditions in the two time frames align.

    I only paint the last 10 bars of the study, because painting all the bars I found was too CPU intensive.

    The problem is, with only the BG of the last 10 bars of the study being painted in these tiny charts, I'm still missing the color alignments. So with 80 visible price bars in the chart, I'm considering painting the BG of the most recent 40 price bars based on the 15 minute study condition, and the previous 40 price bars based on the 60 minute study condition. Then when the whole chart is one color, I know the conditions align.

    My question is, will using setBarBgColor() to paint half the chart (40 bars) one color and half the chart (40 bars) another color be more CPU intensive than using setChartBG() to paint 80 bars the same color? With this 50/50 BG color split for the price bars, I would no longer need to separately paint the BG for any study bars, which should reduce CPU loading.

    Thank you
    shaeffer

  • #2
    "Viewing" studies in multiple timeframes

    Further to my previous question, maybe the changing of background colors is a trivial CPU load relative to the processing involved with the study itself?

    If not, what other ways does eSignal have (via efs's) to show the condition of studies in multiple time frames, without actually viewing the studies. For example, could a thick bar be painted across the bottom of the chart where the color of the left half of the bar denotes the condition of the study in one time interval, and the color of the right half the condition in another interval? - would that be less CPU intensive than changing background color?

    Any other ideas on how to view the condition of a study in multiple timeframes (e.g. stochastic rising in daily and 60 minute charts)?

    Thanks in advance
    shaeffer

    Comment


    • #3
      Re: setChartBG() vs setBarBgColor()

      Hello shaeffer,

      Originally posted by shaeffer


      My question is, will using setBarBgColor() to paint half the chart (40 bars) one color and half the chart (40 bars) another color be more CPU intensive than using setChartBG() to paint 80 bars the same color? With this 50/50 BG color split for the price bars, I would no longer need to separately paint the BG for any study bars, which should reduce CPU loading.

      Thank you
      shaeffer
      I'm assuming you are using setBar() and looping through the historical bars to update each bar's bg color. This would be less efficient than using setChartBG() as this doesn't require any looping. It's one iteration vs 80. If you are allowing the looping routine to execute on every tick, then you could improve the efficiency of that routine by only allowing the loop to occur when there is a need for a color change. Just enclose the loop inside a conditional if statement that detects a color change to prevent the loop from executing on every tick.
      Jason K.
      Project Manager
      eSignal - an Interactive Data company

      EFS KnowledgeBase
      JavaScript for EFS Video Series
      EFS Beginner Tutorial Series
      EFS Glossary
      Custom EFS Development Policy

      New User Orientation

      Comment


      • #4
        Thanks for the reply Jason.

        Let me outline what I want to do, and perhaps you could suggest the best way to acheive this. I use an oscillator, say stochastics, to help me define on an intraday basis the end of a pullback in a trending stock. Intraday, when both the 15 minute and 60 minute stochastics of a stock turn up from under 20, I consider it a reasonable probability that the pullback is over. So the question is, in eSignal, how best can I see this?

        A related issue is that as an equity trader, I want to watch as many stocks as I reasonably can. Watching multiple charts in two timeframes uses too much monitor space. So instead, within one 15 minute chart, I've been using setChartBG() to identify the condition (green rising, red falling) of the (not plotted) 60 minute stochastics and then plotting 15 minute stochastics and using setBarBgColor() to hilight its condition. Then among many charts I watch for when both backgrounds (chart and study) turn green.

        Within 3"x3" charts, can you suggest the best way to readily see when these (or any) two conditions align?

        Thank you
        shaeffer

        Comment

        Working...
        X