Announcement

Collapse
No announcement yet.

How to recall a function into an indicator

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

  • How to recall a function into an indicator

    Hi,

    I am trying to write a small indicator that gives a dot when MAs cross. While I can recall SMA or EMA into the code, I am not able to recall say Hull MA.

    For example, this below code works

    return(ema(50) - sma(5));

    But the below code giving out error...

    return (HullMA(50)-sma(5a));

    I understood that system should store these somewhere and that HullMA is not stored in the system.

    What is the solution?

  • #2
    Re: How to recall a function into an indicator

    Sam7768
    HullMA() is not an existing function like sma() or ema().
    You will need to create that function within your script at which point you can call it either directly or using the efsInternal() function or if you have an efs that already calculates the Hull Moving Average you can call that using the efsExternal() function.
    For the description, syntax and examples on these functions see the links to the corresponding articles in the EFS KnowledgeBase. See also this and this thread in the forum for more detailed examples on the use of these functions. If you search the forums you will find many other examples of this functionality as the topic has been covered at length many times before
    Alex


    Originally posted by Sam7768
    Hi,

    I am trying to write a small indicator that gives a dot when MAs cross. While I can recall SMA or EMA into the code, I am not able to recall say Hull MA.

    For example, this below code works

    return(ema(50) - sma(5));

    But the below code giving out error...

    return (HullMA(50)-sma(5a));

    I understood that system should store these somewhere and that HullMA is not stored in the system.

    What is the solution?

    Comment


    • #3
      Thank you Alexis. You are a great asset to this community.

      Rgds,

      Sam

      Comment


      • #4
        Sam
        You are most welcome
        Alex


        Originally posted by Sam7768
        Thank you Alexis. You are a great asset to this community.

        Rgds,

        Sam

        Comment

        Working...
        X