Announcement

Collapse
No announcement yet.

str_macd

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

  • str_macd

    I am using str_macd (macd strategy).
    The candles become red or green dependent on the strategy. The problem is that the candles often aren't refreshed. So seen the strategy the candles should be green, but every new candle stays red.
    I can manaually do "Mouse-right-click - Reload - macd-strategy". Then the candles will get the right colors. Is someone familiar with this problem?

  • #2
    x5trader
    Post the efs (or provide a link to where it can be downloaded) and someone may be able to help
    Alex

    Comment


    • #3
      sorry, first time I use this. You can find it here.
      Second item from the bottom.

      Comment


      • #4
        Hello x5trader,

        The Strategy object is used for back testing only. It is not designed to process real time data as you are expecting. The reason the coloring works properly when you reload is because the Strategy object can properly process the historical bars. What you need to do is rewrite the study and use global variables to track your long/short state and replace the Strategy calls with your global variables in the conditional statements.
        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


        • #5
          Does anyone know an efs-file that works with about the same strategy (crossing macd), but works real-time.

          Comment


          • #6
            x5trader
            The attached efs should do what you want.
            In Edit Studies modify the settings to match those of str-macd.efs.
            The bars will be colored in real time and will be the same as in the str_macd.efs. However if you want to see the colored bars reflect the real long and short trades then open the efs with the Editor and replace the following

            if(vMACD.getValue(MACDStudy.MACD)>vMACD.getValue(M ACDStudy.SIGNAL))
            setPriceBarColor(Color.lime);
            if(vMACD.getValue(MACDStudy.MACD)<vMACD.getValue(M ACDStudy.SIGNAL))
            setPriceBarColor(Color.red);


            with

            if(Strategy.isLong())
            setPriceBarColor(Color.lime);
            if(Strategy.isShort())
            setPriceBarColor(Color.red);


            Hope this helps
            Attached Files

            Comment

            Working...
            X