Announcement

Collapse
No announcement yet.

Basics - Basics - Basics

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

  • Basics - Basics - Basics

    When using the wizard is there a way to add to the "Built-In" list of formulas?
    I found code for RMI (Relative Momentum Index) and would like to use it in the strategy I created using the Wizard.

    If not...................

    I have discovered the Editor, and I see where my criteria goes, BUT where in the code does the RMI formula get "called" OR does the code for my formula need to be within the code for the entire strategy?

    I THINK ONCE I GRASP THIS LITTLE BIT OF INFO, I WILL "GET IT".

    What's confusing me is that is see something like CCI being used in the strategy, but not the code for the CCI formula. I'm guessing the code says to search the formula folder.

    Thanks in advance for any help.

  • #2
    Basic Code question

    Basics - Basics - Basics

    Can I simply copy/paste a formula file in the "Built-In" formula to then use when constructing strategies?

    If not...................I know I need to hard code into the Editor,

    I have discovered the Editor, and I see where my criteria goes, BUT where in the code does the RMI formula get "called" OR does the code for my formula need to be within the code for the entire strategy?

    I THINK ONCE I GRASP THIS LITTLE BIT OF INFO, I WILL "GET IT".

    What's confusing me is that is see something like CCI being used in the strategy, but not the code for the CCI formula. I'm guessing the code says to search the formula folder.

    Thanks in advance for any help.

    Comment


    • #3
      Sam

      When using the wizard is there a way to add to the "Built-In" list of formulas?
      No there isn’t. The Formula Wizard can only use the built-in legacy functions and not custom functions.

      I have discovered the Editor, and I see where my criteria goes, BUT where in the code does the RMI formula get "called" OR does the code for my formula need to be within the code for the entire strategy?
      It can be done both ways using either an external formula and calling it using the efsExternal() function or creating a separate function that calculates your indicator within your existing formula and calling that function using the efsInternal() function.
      Search the EFS KnowledgeBase for efsInternal() and efsExternal for information syntax and examples on the use of those functions. Also search the forum for the same keywords as there are literally hundreds of examples of studies of studies using them

      What's confusing me is that is see something like CCI being used in the strategy, but not the code for the CCI formula.
      That is more than likely because the formula is calling the CCIStudy() or cci() built-in functions which calculate the indicator directly
      Alex


      Originally posted by uhehs View Post
      When using the wizard is there a way to add to the "Built-In" list of formulas?
      I found code for RMI (Relative Momentum Index) and would like to use it in the strategy I created using the Wizard.

      If not...................

      I have discovered the Editor, and I see where my criteria goes, BUT where in the code does the RMI formula get "called" OR does the code for my formula need to be within the code for the entire strategy?

      I THINK ONCE I GRASP THIS LITTLE BIT OF INFO, I WILL "GET IT".

      What's confusing me is that is see something like CCI being used in the strategy, but not the code for the CCI formula. I'm guessing the code says to search the formula folder.

      Thanks in advance for any help.

      Comment


      • #4
        Sam

        Can I simply copy/paste a formula file in the "Built-In" formula to then use when constructing strategies?
        If your question is in reference to your previous one regarding being able to add a custom indicator to the built-in studies so that it can be used by the Formula Wizard then the answer is no for the same reason I explained in my previous reply.
        That said the Formula Wizard can create some studies on studies which can be used within the context of that specific script created with the Formula Wizard
        As to your other questions they seem to be just reiterations of your first post to which I have already answered
        Alex


        Originally posted by uhehs View Post
        Basics - Basics - Basics

        Can I simply copy/paste a formula file in the "Built-In" formula to then use when constructing strategies?

        If not...................I know I need to hard code into the Editor,

        I have discovered the Editor, and I see where my criteria goes, BUT where in the code does the RMI formula get "called" OR does the code for my formula need to be within the code for the entire strategy?

        I THINK ONCE I GRASP THIS LITTLE BIT OF INFO, I WILL "GET IT".

        What's confusing me is that is see something like CCI being used in the strategy, but not the code for the CCI formula. I'm guessing the code says to search the formula folder.

        Thanks in advance for any help.

        Comment


        • #5
          Can you direct me to sample code for a simple RMI formula? (I am migrating from Metastock where I use the 15 period Close with a 5 period Momentum. RMI(C,15,5))

          Comment


          • #6
            Sam
            See this thread. FYI I found it by searching the forum for the keywords *RMI* or Relative Momentum
            If - as it seems from the context of your posts - you are unfamiliar with programming in EFS [which is quite different from Metastock's language] then you may want to review the JavaScript for EFS video series and the Core JavaScript Reference Guide. These will provide you with a thorough introduction to programming in JavaScript which is at the foundation of EFS. Then go through the EFS KnowledgeBase and study the Help Guides and Tutorials which will provide you with the specifics of EFS.
            Alex


            Originally posted by uhehs View Post
            Can you direct me to sample code for a simple RMI formula? (I am migrating from Metastock where I use the 15 period Close with a 5 period Momentum. RMI(C,15,5))

            Comment


            • #7
              Google "esignal rmi". You will find it there.

              Comment


              • #8
                Worked great. Thank you.

                NOW - Why are my shapes hiding behind the candle (see chart)?

                Click image for larger version

Name:	esignal-forum.PNG
Views:	1
Size:	39.2 KB
ID:	242941

                I would like to have them fully visible ABOVE the high point of the candle.

                This is the code (in Formula Wizard)
                drawShapeRelative(0, high(), Shape.UPARROW, "", Color.RGB(0,128,0), Shape.TOP)

                Comment


                • #9
                  Sam
                  That is in part due to the candle spacing (in as much as the shapes increase in size as you increase the bar spacing thereby overlapping the candle) and also to a bug in 10.6 which does not properly use the alignement flags (is Shape.TOP, Shape.BOTTOM, etc).
                  That said note that the alignement is relative to the shape and not the bar hence Shape.TOP refers to the top margin of the shape. In your case (assuming no bug was there) you should use Shape.BOTTOM ie you would align the bottom of the shape to the High of the bar.
                  The workaround in your case is to edit that line of code to the following
                  drawShapeRelative(0, AboveBar1, Shape.UPARROW, "", Color.RGB(0,255,0), Shape.PRESET)
                  If that is still too close based on your bar spacing then try AboveBar2. See the related article in the EFS KnowledgeBase for the description opf the flags in the drawShapeRelative() function
                  Alex


                  Originally posted by uhehs View Post
                  Worked great. Thank you.

                  NOW - Why are my shapes hiding behind the candle (see chart)?

                  [ATTACH=CONFIG]16622[/ATTACH]

                  I would like to have them fully visible ABOVE the high point of the candle.

                  This is the code (in Formula Wizard)
                  drawShapeRelative(0, high(), Shape.UPARROW, "", Color.RGB(0,128,0), Shape.TOP)

                  Comment

                  Working...
                  X