Announcement

Collapse
No announcement yet.

Multi Time Frame Alert Study - Where to go from here?

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

  • Multi Time Frame Alert Study - Where to go from here?

    Hello everyone,
    I'm trying to construct an alert system that will fire when the stochastic values agree with each other across 3 time frames, with a few small conditions.
    I'm not too familiar with eSignal scripting so I used the wizard in 10.6 to create the main structure and continued with my code from there, using forum posts as a reference (Thanks Alexis!).

    My question is, where do I go from here? I've programmed all of the conditions, and I would like to be able to attach the study to my watch list.
    As it stands, the code compiles but gives me the error "failed to call function 'getValue': invalid number of arguments, 2. Expected arguments, 1." when added to the watch list. I suspect I'm not using getValue properly.
    I hope I have sufficiently commented the code to make it understandable. See attachment.


    Thanks.


  • #2
    spaceboy
    In each instance of .getValue() you are using the syntax for the legacy StochStudy() function instead of that for the efs2 stochK() and stochD() functions [hence the error message]
    See this article in the EFS KnowledgeBase for examples of the appropriate syntax
    Additionally you have a logic error in some of the conditions where you are looking at the values of the following bar [ie bar index 1] instead of those at the previous bar [ie -1]
    Lastly you do not need the new constructor when declaring the studies
    Alex


    Originally posted by spaceboy View Post
    Hello everyone,
    I'm trying to construct an alert system that will fire when the stochastic values agree with each other across 3 time frames, with a few small conditions.
    I'm not too familiar with eSignal scripting so I used the wizard in 10.6 to create the main structure and continued with my code from there, using forum posts as a reference (Thanks Alexis!).

    My question is, where do I go from here? I've programmed all of the conditions, and I would like to be able to attach the study to my watch list.
    As it stands, the code compiles but gives me the error "failed to call function 'getValue': invalid number of arguments, 2. Expected arguments, 1." when added to the watch list. I suspect I'm not using getValue properly.
    I hope I have sufficiently commented the code to make it understandable. See attachment.


    Thanks.

    [ATTACH=CONFIG]16437[/ATTACH]

    Comment


    • #3
      Thanks for the reply Alexis.

      Should the condition look more like this: vStochDk.getValue(0) > vStochDk.getValue(-1) &&
      And after those revisions, will the script run properly as a column added to my watch list?

      Comment


      • #4
        spaceboy
        That is correct
        Alex


        Originally posted by spaceboy View Post
        Thanks for the reply Alexis.

        Should the condition look more like this: vStochDk.getValue(0) > vStochDk.getValue(-1) &&
        And after those revisions, will the script run properly as a column added to my watch list?

        Comment


        • #5
          The script seems to be working well but I forgot to add something very basic, a text pop-up to tell me which symbol triggered the alert.

          This is what I have so far:
          if (vLastAlert != 1)
          Alert.playSound("D:\\Users\\Administrator\\Documen ts\\Interactive Data\\Sounds\\alerttarget.wav") &&
          Alert.addToList("Long", "Long", Color.green, Color.black);
          vLastAlert = 1;

          Right now the audio alert is working but no text. I would also like to specify the symbol in the pop-up but I'm not sure how to fetch that data.

          Comment


          • #6
            spaceboy
            For examples on how to do this see the formulas provided with the application in the Alerts Examples subfolder of Formulas
            Also search the forums as there are literally hundreds of examples available since this is a common topic
            Alex


            Originally posted by spaceboy View Post
            The script seems to be working well but I forgot to add something very basic, a text pop-up to tell me which symbol triggered the alert.

            This is what I have so far:
            if (vLastAlert != 1)
            Alert.playSound("D:\\Users\\Administrator\\Documen ts\\Interactive Data\\Sounds\\alerttarget.wav") &&
            Alert.addToList("Long", "Long", Color.green, Color.black);
            vLastAlert = 1;

            Right now the audio alert is working but no text. I would also like to specify the symbol in the pop-up but I'm not sure how to fetch that data.

            Comment


            • #7
              Great, thanks.

              Comment


              • #8
                spaceboy
                You are welcome
                Alex


                Originally posted by spaceboy View Post
                Great, thanks.

                Comment

                Working...
                X