Announcement

Collapse
No announcement yet.

Returning multiple values from a Function other than Main

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

  • Returning multiple values from a Function other than Main

    Hi

    I'm pretty new to JavaSoft/ EFS programming and despite having searched the internet, Esignal database and spoken to a programmer friend, but I am still struggling to get this working.

    I have a function which I call from my main function which fits a curve and calculates the standard deviation (and some other stats), and I wish to plot these on every bar. It's a bit similar to plotting a Bollinger band with the +/- 2sd channels.

    I can't figure out how to return from my curve fitting function to my main function more than one value. I have tried looking at passing an array which I understand is (effectively) passed by reference, but when I do this the array seems to have the value for the final bar for all previous bars.

    Do you have an example of how I might do this? (I know how to return multiple values from the main function to the Advanced Chart).

    I've spent days on this now and am tearing my hair out in frustration

    Thanks in advance

    Gary

  • #2
    Re: Returning multiple values from a Function other than Main

    Gary
    Assuming I understood correctly what you are asking you can do that using the efsInternal() function. See the link to the related article in the EFS KnowledgeBase for the description and syntax of the function.
    See also this thread for some additional examples of its use. Also search the forum using efsinternal* as the keyword and you will find many more examples and/or complete formulas that make use of the function
    Alex


    Originally posted by Gary6612
    Hi

    I'm pretty new to JavaSoft/ EFS programming and despite having searched the internet, Esignal database and spoken to a programmer friend, but I am still struggling to get this working.

    I have a function which I call from my main function which fits a curve and calculates the standard deviation (and some other stats), and I wish to plot these on every bar. It's a bit similar to plotting a Bollinger band with the +/- 2sd channels.

    I can't figure out how to return from my curve fitting function to my main function more than one value. I have tried looking at passing an array which I understand is (effectively) passed by reference, but when I do this the array seems to have the value for the final bar for all previous bars.

    Do you have an example of how I might do this? (I know how to return multiple values from the main function to the Advanced Chart).

    I've spent days on this now and am tearing my hair out in frustration

    Thanks in advance

    Gary

    Comment


    • #3
      Hi Alex

      Thank you very much. I was using the efsintenal() but with getValue rather than getSeries, and didn't have the right format.

      It seems to be working now

      Much relieved of Manchester

      Gary

      Comment


      • #4
        Gary
        You are welcome
        Alex


        Originally posted by Gary6612
        Hi Alex

        Thank you very much. I was using the efsintenal() but with getValue rather than getSeries, and didn't have the right format.

        It seems to be working now

        Much relieved of Manchester

        Gary

        Comment

        Working...
        X