Announcement

Collapse
No announcement yet.

preMain fuction questions ??

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

  • preMain fuction questions ??

    preMain function questions:

    1) Is it possible to have values in preMain as parameters so you can control how the study works?

    Let's say you have a study that one time you want to load with pricestudy = true and then load it again with pricestudy = false.

    Or one time you want to use setComputeOnClose(); but then next time you don't want it use it.


    2) Should

    var iDecimals = new FunctionParameter("iDecimals", FunctionParameter.NUMBER);
    iDecimals.setDefault( 2 );

    be coded in preMain or not?

    It doesn't seem to matter but I am curious.

    THANKING YOU IN ADVANCE.

  • #2
    Re: preMain fuction questions ??

    Hello Avery,

    Originally posted by buzzhorton
    preMain function questions:

    1) Is it possible to have values in preMain as parameters so you can control how the study works?

    Let's say you have a study that one time you want to load with pricestudy = true and then load it again with pricestudy = false.

    Or one time you want to use setComputeOnClose(); but then next time you don't want it use it.
    The setPriceStudy() and setComputeOnClose() functions sets these study properties during the initialization process. Once a formula has been loaded on a chart you can not programmatically change these two properties through a formula parameter.


    2) Should

    var iDecimals = new FunctionParameter("iDecimals", FunctionParameter.NUMBER);
    iDecimals.setDefault( 2 );

    be coded in preMain or not?

    It doesn't seem to matter but I am curious.

    THANKING YOU IN ADVANCE.
    It is recommended to put FunctionParameter code inside preMain().
    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


    • #3
      Re: Re: preMain fuction questions ??

      Hey Jason:

      Looks like you are playing "catch up".

      So it looks like I have to have 2 versions of a study.. one for priceStudy = true and one for = false. That just doesn't seem smart. Too bad, preMain function parameters couldn't be loaded at load time rather than hard coded.

      So I guess, I will start putting the FunctionParameter code inside preMain.

      Thanks again.


      Originally posted by JasonK
      Hello Avery,


      The setPriceStudy() and setComputeOnClose() functions sets these study properties during the initialization process. Once a formula has been loaded on a chart you can not programmatically change these two properties through a formula parameter.


      It is recommended to put FunctionParameter code inside preMain().

      Comment

      Working...
      X