Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Peaking Volume alert

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

    #16
    Originally posted by cachevery View Post
    The problem that it prints the arbitrary number of consecutive bars,it could be 2,1 or 7,as long asd i`m testing it now.I`m not sure what it is, but the logic suggests,that a desired amount of bar must appear to trigger alert.If one set it to 4 then it should trigger when four bars are in play,and not 5-6-7 or whatever.
    Hello Cachevery,

    I tested your modifications with market replay and found that the indicator sends one e-mail when the condition "gotBar" is true. I changed the number of bars and the indicator adjusted to that, sending an e-mail when the number of bars met the specific conditions within the indicator. I used the indicator on 1 minute data and with calculate on bar close = true.

    The indicator has parameters that you can change such as Lowerlow, lowerHigh and bardown. I tested them all set to true and all set to false. In all cases it appears to only function on a down condition.

    When you set the indicator to 4 bars (for example) and all conditions true, you will get less e-mails. When you set all conditions false you will get more e-mails because the logic is not filtering conditions.

    If you have more than 4 consecutive bars down (and assuming the bars meet the logic conditions specified), for each bar down after 4 you will get another e-mail because the indicator counts back only 4 bars, so if you have 7 down bars you will get 3 e-mails, one for bar 5, bar 6 and bar 7 because at each of those bars there for 4 preceding bars meeting the logic condition..

    Hope this helps.

    Comment


      #17
      Originally posted by Tasker-182 View Post
      Hello Cachevery,

      I tested your modifications with market replay and found that the indicator sends one e-mail when the condition "gotBar" is true. I changed the number of bars and the indicator adjusted to that, sending an e-mail when the number of bars met the specific conditions within the indicator. I used the indicator on 1 minute data and with calculate on bar close = true.

      The indicator has parameters that you can change such as Lowerlow, lowerHigh and bardown. I tested them all set to true and all set to false. In all cases it appears to only function on a down condition.

      When you set the indicator to 4 bars (for example) and all conditions true, you will get less e-mails. When you set all conditions false you will get more e-mails because the logic is not filtering conditions.

      If you have more than 4 consecutive bars down (and assuming the bars meet the logic conditions specified), for each bar down after 4 you will get another e-mail because the indicator counts back only 4 bars, so if you have 7 down bars you will get 3 e-mails, one for bar 5, bar 6 and bar 7 because at each of those bars there for 4 preceding bars meeting the logic condition..

      Hope this helps.
      Hello Tasker,

      much appreciated your assistance.But is thhere a way to set such conditions to have alert only when 4 consecutive bars appears.Just one alert for 4 consec.bars,no more,no less?

      Comment


        #18
        Originally posted by cachevery View Post
        Hello Tasker,

        much appreciated your assistance.But is thhere a way to set such conditions to have alert only when 4 consecutive bars appears.Just one alert for 4 consec.bars,no more,no less?
        Hi Cachevery,
        If you don't mind I am going to explain a bit to help in understanding the modification needed.

        The bars/candles are integer numbered left to right as they progress across the chart. For example the right most candle could be bar number 1702, the next bar that forms on the very right side would be 1703, then 1704, then 1705, etc. If we make note of the bar number when the e-mail is produced, we can then compare the bar number from that event to the current bar at the right edge. We can then compare that difference in bar numbers to the barCount variable. So lets say barCount is set to 4 and lets use the above numbering example.

        A system variable called CurrentBar always holds the bar number that is forming at the right edge of the chart so we can use that to our advantage. At bar 1702 we get the signal and the send mail is activated, great, so now we need to put that bar number, which is the CurrentBar into a variable to store for later use. Lets call it "bargot". To assign the current bar to "bargot" in code is simply:
        Code:
         bargot = CurrentBar ;
        . The above code statement needs to go just below the SendMail statement. so that when the sendmail is issued we are recording the bar that it was issued on.

        So now here comes the next bar, 1703 and the conditions are the same such that it would generate another signal and send another e-mail. To prevent this we can make a check to see that CurrentBar - bargot is greater than barcount. Remember that CurrentBar is always the right most bar and its value is now 1703, the variable bargot holds 1702, so the math becomes 1703 - 1702 =1 and 1 is not > barcount which was 4, thus the condition is not true and the e-mail would not be sent. Code wise this looks like:

        Code:
        if (i == barCount && CurrentBar-bargot > barCount)
        You already have the "if (i==BarCount)" so modify to the above, be careful of the capitalization please.

        One more bit of modification required, in the #region Variables please add the declaration:

        Code:
        private int	bargot =	0	;
        This is simply to tell the compiler that we need an integer reserved to store a number.

        In closing please understand that the modification will require the indicator to wait barCount+1 before issuing a new e-mail. In the case barCount = 4 then 5 candles will pass before it can send an e-mail again. Again using the above example, signal at bar 1702 means the earliest another one can be issued is 1707.

        Also, this is one way to avoid issuing multiple e-mails/alerts in this case. You have to evaluate the need of the alert verses the frequency of the alerts and adjust your code accordingly.

        Regards,
        Last edited by Tasker-182; 05-26-2014, 05:33 PM.

        Comment


          #19
          Originally posted by Tasker-182 View Post
          Hi Cachevery,
          If you don't mind I am going to explain a bit to help in understanding the modification needed.

          The bars/candles are integer numbered left to right as they progress across the chart. For example the right most candle could be bar number 1702, the next bar that forms on the very right side would be 1703, then 1704, then 1705, etc. If we make note of the bar number when the e-mail is produced, we can then compare the bar number from that event to the current bar at the right edge. We can then compare that difference in bar numbers to the barCount variable. So lets say barCount is set to 4 and lets use the above numbering example.

          A system variable called CurrentBar always holds the bar number that is forming at the right edge of the chart so we can use that to our advantage. At bar 1702 we get the signal and the send mail is activated, great, so now we need to put that bar number, which is the CurrentBar into a variable to store for later use. Lets call it "bargot". To assign the current bar to "bargot" in code is simply:
          Code:
           bargot = CurrentBar ;
          . The above code statement needs to go just below the SendMail statement. so that when the sendmail is issued we are recording the bar that it was issued on.

          So now here comes the next bar, 1703 and the conditions are the same such that it would generate another signal and send another e-mail. To prevent this we can make a check to see that CurrentBar - bargot is greater than barcount. Remember that CurrentBar is always the right most bar and its value is now 1703, the variable bargot holds 1702, so the math becomes 1703 - 1702 =1 and 1 is not > barcount which was 4, thus the condition is not true and the e-mail would not be sent. Code wise this looks like:

          Code:
          if (i == barCount && CurrentBar-bargot > barCount)
          You already have the "if (i==BarCount)" so modify to the above, be careful of the capitalization please.

          One more bit of modification required, in the #region Variables please add the declaration:

          Code:
          private int	bargot =	0	;
          This is simply to tell the compiler that we need an integer reserved to store a number.

          In closing please understand that the modification will require the indicator to wait barCount+1 before issuing a new e-mail. In the case barCount = 4 then 5 candles will pass before it can send an e-mail again. Again using the above example, signal at bar 1702 means the earliest another one can be issued is 1707.

          Also, this is one way to avoid issuing multiple e-mails/alerts in this case. You have to evaluate the need of the alert verses the frequency of the alerts and adjust your code accordingly.

          Regards,
          Tasker,I`ve made all the changes you suggested and i get errors now in lines:

          95,104,113,122,129

          What could be possibly wrong?

          Comment


            #20
            Originally posted by cachevery View Post
            Tasker,I`ve made all the changes you suggested and i get errors now in lines:

            95,104,113,122,129

            What could be possibly wrong?
            Please post your indicator (minus the e-mail names) and I'll take a look.

            Comment


              #21
              Originally posted by Tasker-182 View Post
              Please post your indicator (minus the e-mail names) and I'll take a look.
              Please see the attached.
              Attached Files

              Comment


                #22
                Originally posted by cachevery View Post
                Please see the attached.
                Hi Cachevery,

                There were too many problems with your file. Some statements were missing, some "{" were incorrectly located.

                Please
                1) Delete your file or move it out of the indicators folder entirely, you must do one or the other.
                2) THEN place the attached in your indicator folder
                3) Edit it to uncomment and enter your e-mail specifics
                4) Then compile it.
                Attached Files

                Comment


                  #23
                  Originally posted by Tasker-182 View Post
                  Hi Cachevery,

                  There were too many problems with your file. Some statements were missing, some "{" were incorrectly located.

                  Please
                  1) Delete your file or move it out of the indicators folder entirely, you must do one or the other.
                  2) THEN place the attached in your indicator folder
                  3) Edit it to uncomment and enter your e-mail specifics
                  4) Then compile it.
                  Tasker,please take a look at the screenshot.What is the red dot for,and why it`s now signalling for four bars up and four bars down simultaneously?
                  Attached Files

                  Comment


                    #24
                    Originally posted by cachevery View Post
                    Tasker,please take a look at the screenshot.What is the red dot for,and why it`s now signalling for four bars up and four bars down simultaneously?

                    Sorry,my bad.It was my mistake when i compilled and copied from one file, i forgot to change sign for the up logic in the statement.But,still,why is the red dot?

                    Comment


                      #25
                      Originally posted by cachevery View Post
                      Sorry,my bad.It was my mistake when i compilled and copied from one file, i forgot to change sign for the up logic in the statement.But,still,why is the red dot?
                      Hi Cachevery,

                      I used the dot as a debug indicator for me and I forgot to remove it. You can comment out the drawdot statement.

                      Comment


                        #26
                        Originally posted by Tasker-182 View Post
                        Hi Cachevery,

                        I used the dot as a debug indicator for me and I forgot to remove it. You can comment out the drawdot statement.
                        Okay.

                        Thanks Tasker for helping me out.I appreciate your time and support.You`ve been great!

                        Best Wishes!

                        Comment


                          #27
                          P.S.

                          Hello Tasker,

                          One final question would be,is there a way to set up the conditions to include the price value in the alert message,for that 4 bars combination alert?So when the conditions are met,would be great to know the current price value.

                          Thanks in advance!

                          Comment


                            #28
                            Originally posted by cachevery View Post
                            Hello Tasker,

                            One final question would be,is there a way to set up the conditions to include the price value in the alert message,for that 4 bars combination alert?So when the conditions are met,would be great to know the current price value.

                            Thanks in advance!
                            Hi,

                            Certainly this can be done. Here is the existing statement in the file (e-mail names removed to protect the innocent...)

                            Code:
                            SendMail("[email protected]", "[email protected]","FourBarsDown"," "+Instrument.FullName+" "+Time[0]);
                            The syntax from the help file says: SendMail(string from, string to, string subject, string text)

                            So the text "FourBarsDown" is the "subject" of the e-mail. That means everything after will be included in the body of the e-mail. As it stands now, this is what shows up in the body of the e-mail: "+Instrument.FullName+" "+Time[0]

                            Just change the last part to: "+Instrument.FullName+" "+Time[0]+" Price: "+Close[0]

                            Your statement then should look like:

                            Code:
                            SendMail("[email protected]", "[email protected]","FourBarsDown"," "+Instrument.FullName+" "+Time[0]+" Price: "+Close[0]);

                            Comment


                              #29
                              Originally posted by tasker-182 View Post
                              hi,

                              certainly this can be done. Here is the existing statement in the file (e-mail names removed to protect the innocent...)

                              aha!:d:d:d

                              Comment


                                #30
                                Originally posted by Tasker-182 View Post
                                Hi,

                                Certainly this can be done. Here is the existing statement in the file (e-mail names removed to protect the innocent...)

                                Code:
                                SendMail("[email protected]", "[email protected]","FourBarsDown"," "+Instrument.FullName+" "+Time[0]);
                                The syntax from the help file says: SendMail(string from, string to, string subject, string text)

                                So the text "FourBarsDown" is the "subject" of the e-mail. That means everything after will be included in the body of the e-mail. As it stands now, this is what shows up in the body of the e-mail: "+Instrument.FullName+" "+Time[0]

                                Just change the last part to: "+Instrument.FullName+" "+Time[0]+" Price: "+Close[0]

                                Your statement then should look like:

                                Code:
                                SendMail("[email protected]", "[email protected]","FourBarsDown"," "+Instrument.FullName+" "+Time[0]+" Price: "+Close[0]);

                                Thanks a lot!

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                                0 responses
                                566 views
                                0 likes
                                Last Post Geovanny Suaza  
                                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                                0 responses
                                330 views
                                1 like
                                Last Post Geovanny Suaza  
                                Started by Mindset, 02-09-2026, 11:44 AM
                                0 responses
                                101 views
                                0 likes
                                Last Post Mindset
                                by Mindset
                                 
                                Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                                0 responses
                                547 views
                                1 like
                                Last Post Geovanny Suaza  
                                Started by RFrosty, 01-28-2026, 06:49 PM
                                0 responses
                                548 views
                                1 like
                                Last Post RFrosty
                                by RFrosty
                                 
                                Working...
                                X