Announcement

Collapse
No announcement yet.

Alert based on specific end time

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

  • Alert based on specific end time

    Hello,

    I am trying to determine if it is possible to write an EFS that will alert me when a certain condition occurs at the end of similiar timeframes.

    Here is my example, assume I am using a 2 min and 4 minute time frame, and I would like the EFS to alert me when the 3EMA for both timeframes are both going down, I would also like this EFS to be on a 1 minute chart.

    But because the 2min and 4min, do not end at the same time, I am only expecting a possible alert to occur at 4min, 8min, 12min, 16min, etc... as these will be the only time when both the 2 and 4min end at the same time.

    Can anyone please advise me if this is possible, if a sample of this exists on the forum, I have not been able to find it. I have searched and searched with no luck, guidance or a example EFS would be greatly appreciated.

    Thank you in Advance

    Royce

  • #2
    Re: Alert based on specific end time

    Royce

    I am trying to determine if it is possible to write an EFS that will alert me when a certain condition occurs at the end of similiar timeframes....
    ...But because the 2min and 4min, do not end at the same time, I am only expecting a possible alert to occur at 4min, 8min, 12min, 16min, etc
    You could create a condition that checks for each new 4 minute bar
    Enclosed in that conditional statement you can then check for the prior bar's values of your studies [based on the 2 and 4 minute intervals] to be lesser (or greater) than those of two bars back and if that evaluates to true you can then execute your alert

    PHP Code:
    if(getBarStateInterval("4")==BARSTATE_NEWBAR){
        if(
    my2MinStudy.getValue(-1) < my2MinStudy.getValue(-2) && my4MinStudy.getValue(-1) < my4MinStudy.getValue(-2){
            
    //trigger alerts
        
    }

    Can anyone please advise me if this is possible, if a sample of this exists on the forum, I have not been able to find it.
    If I remember correctly you have asked the same or similar question before so you may want to search through your messages and review the example(s) that were provided at the time
    Alex


    Originally posted by Royce
    Hello,

    I am trying to determine if it is possible to write an EFS that will alert me when a certain condition occurs at the end of similiar timeframes.

    Here is my example, assume I am using a 2 min and 4 minute time frame, and I would like the EFS to alert me when the 3EMA for both timeframes are both going down, I would also like this EFS to be on a 1 minute chart.

    But because the 2min and 4min, do not end at the same time, I am only expecting a possible alert to occur at 4min, 8min, 12min, 16min, etc... as these will be the only time when both the 2 and 4min end at the same time.

    Can anyone please advise me if this is possible, if a sample of this exists on the forum, I have not been able to find it. I have searched and searched with no luck, guidance or a example EFS would be greatly appreciated.

    Thank you in Advance

    Royce

    Comment


    • #3
      Hi Alex

      Thank you for the response, unfortunately I am not sure that I understand what you have written.

      Does it mean that I would create two if(getBarStateInterval() .. statements, each representing 2 min and 4 min ?

      The logic in the second if statement makes sense, but how to I link the "my2MinStudy" variable to the associated "if(getBarState" .. line above ?

      A working example would be greatly appreciated, if you can provide a link to one.

      In the meantime, I will start researching "getBarStateInternval (), and see if it might address my needs.

      Thanks again for your response

      Royce

      Comment


      • #4
        Hi Alex,

        I have found a EFS that you have written some time ago, would you mind taking a look at it to see where I have gone wrong.

        I don't get any errors when I load the EFS but I also don't get any green or red lines where I would expect then to show up.

        Sincerely,
        Royce
        Attached Files

        Comment


        • #5
          Hi Alex

          I was able to figure out what I was doing wrong with my EFS, if you did get a chance to look at my EFS, thanks for taking the time to do so.

          Royce

          Comment

          Working...
          X