Announcement

Collapse
No announcement yet.

Macd Alerts

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

  • Macd Alerts

    Hi,

    I have found a formula for MACD hist, However I would like to set alerts into it, I have looked around and added bits to it but they have not worked, I was wondering if someone had a MACD hist alert formula.

    I know you can just use a moving average alert for the cross overs, However I would Like to work on the movement of the Hist itself: For example if the hist is has 2 consecutive days below previous high it is a sell signal, and if the hist has 2 consecutive days above the pervious low it is a buy signal.

    Thanks

    W
    Attached Files

  • #2
    Walton
    Attached is a functioning copy of your efs.
    FYI all I did was to get it to work by adding a few variables that were either incorrectly named or missing, Nothing else has been done to it and it is possible that it may need some further work to clean it up and optimize it.
    Alex
    Attached Files

    Comment


    • #3
      That is much appreciated Alex thank you. Now I would like to add on an alert for the Hist to sell when there is a lower high and buy when there is A higher high, is it possible to do this.

      In the Formula that is written it has red Hists when there is a lower high and green for higher highs, so I think there would be a simple add on to it to make this work… I think.

      I would much appreciate the Help

      W

      Comment


      • #4
        Walton
        The attached revision of the efs adds the Alerts triggered by the Hist
        Alex
        Attached Files

        Comment


        • #5
          Alex,

          Thank you, for that, I was just wondering how do you chang it form an alert to a backtest?

          Thanks

          W

          Comment


          • #6
            Walton
            You will need to add the doLong, doShort, etc commands in the appropriate section(s) of the efs ie where the buy/sell signals would be generated.
            There should be a number of examples among the formulas you already have in your folders (see in Formulas->BackTesting folder)
            Alex

            Comment


            • #7
              macdcolorhist problems

              Both efs have some bug - sometimes - higher then previous histogram is red, and sometimes lower than previous histogram is green.

              When you reload efs - everything get fixed, but then when intraday data starts coming - same problem again. Growing histogram sometimes red, decreasing sometimes green.

              Is there a way to fix it? (it is great efs concept - alarms, arows, popups + sound)
              Attached Files

              Comment


              • #8
                -

                robert_ch
                The reason for that behavior is probably because the formula was originally intended to run using the global compute on close setting. To resolve this open the efs with the Editor and replace the following section of code
                PHP Code:
                if (vHist != null) {
                    
                vHist1 vHist;

                with either
                PHP Code:
                if (getBarState()==BARSTATE_NEWBAR && vHist != null) {
                    
                vHist1 vHist;

                or
                PHP Code:
                vHist1 study.getValue(MACDStudy.HIST,-1); 
                Once you make this change the script should be working correctly when computing on every tick
                Alex


                Originally posted by robert_ch
                Both efs have some bug - sometimes - higher then previous histogram is red, and sometimes lower than previous histogram is green.

                When you reload efs - everything get fixed, but then when intraday data starts coming - same problem again. Growing histogram sometimes red, decreasing sometimes green.

                Is there a way to fix it? (it is great efs concept - alarms, arows, popups + sound)

                Comment

                Working...
                X