Announcement

Collapse
No announcement yet.

EFS momentum code possibility??

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

  • EFS momentum code possibility??

    Is this possible in an EFS strategy??

    If momentum indicator MOM less than < -0.11 allow short trades
    providing faster EMA below slower

    If momentum indicator MOM greater than > 0.11 allow long trades providing faster Ema above slower EMA

    Do not allow any position unless these conditions are met

    Any ideas?

    Regards
    Spam

  • #2
    Spam
    Yes it is possible. Here is a very basic permissioning efs. Based on the conditions for the MOM study and for the two EMAs it sets a vFlag to 1 (for longs), -1 (for shorts) or 0 (no trades). I have added the background color only as a verification.
    You can then add to it the rest of the trading logic using if(vFlag==1 && whatever other condition) go long, etc
    Hope this helps
    Alex

    Attached Files

    Comment


    • #3
      Thanks for the reply Alexis can you also do the following for MACD?

      If difference between red line - blue line MACD less than = <0.1 No position or close all positions

      If difference between red line - blue line MACD more = > 0.2 then position taken either long or short if faster blue line is above or below

      Regards
      Spam

      Comment


      • #4
        Spam
        Wouldn't that just be the Histogram of the MACD? If the difference is greater >0.2 then by definition the blue line would be above the red and the opposite if the difference is > -0.2
        At least that is my understanding
        Alex

        Comment


        • #5
          Yes sorry your correct I think I was not taking any notice of the histogram just the relationship between the MACD lines.

          Can the histogram be linked into a EFS strategy say >0.2 long, if between 0.2 and -0.2 no position?????

          Any ideas on formula anyone???

          Regards Spam

          Comment


          • #6
            Spam
            The attached formula returns the same plot (and paints the background accordingly) as the one posted earlier except that it uses the MACD.
            FWIW both this efs and the prior one are based on the builtin(studyname).efs that you can find in the Builtin subfolder of Formulas.
            Alex

            Attached Files

            Comment


            • #7
              Alexis,

              I didnĀ“t changed anything. Do you know whats wrong?

              Tomcat
              Attached Files

              Comment


              • #8
                Tomcat
                Not sure what you think is wrong.
                Here is what I see on the same symbol/interval. Seems to be the same.
                Alex

                Comment


                • #9
                  It was my mistake. I had to reduce the settings for gb.

                  Tomcat

                  Comment

                  Working...
                  X