Announcement

Collapse
No announcement yet.

Geting MA of an external symbol

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

  • Geting MA of an external symbol

    I need to get Moving Average of a symbol not on the chart. I know how to get the symbols values but how do you apply a builtin such as MA?

  • #2
    Hello bpschoch,

    Currently, you can't pass an external symbol to a built-in study. You will have to use the getValue( barType [, nOffset] [, nNumBars] [,Symbol] ) to get the price data and add a routine to calculate the MA. If you need to see how to code some of the other built-in studies, look at the formulas listed in \eSignal\Formulas\Library.

    An alternative (more complex) method would be to use the universal global functions, setGlobalValue( varname, value ), getGlobalValue( varname ) and removeGlobalValue( varname ) in a formula running on a chart with your external symbol to return the built-in MA results to the global space. Then access the data in a separate formula running on the chart with your other symbol. Keep in mind that if you use different intervals between the two charts, you will have to add some synchronization routines based on time.
    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

    Working...
    X