Announcement

Collapse
No announcement yet.

alert once per bar

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

  • alert once per bar

    does anyone know how to return only one alert signal per bar to the "triggered alert list"? I have an efs from formula wizard I'm using.

    thanks,

    chris...

  • #2
    Chris
    Add the alert to the while the following will happen only the first time: section in the Formula Wizard.
    Alex

    Comment


    • #3
      alex,

      it's like that already. the situation is, suppose the alert trigger is calculated as $25.05 and as the price move up to the trigger, tick trades moves from $25.04 to $25.06 would trigger then trades between $25.02 - $25.04 for a minute then trades $25.06-$25.07 causes another trigger and so on within a 5 min bar.

      In any case, attached is my formula wizard code if anyone wants to play with it.
      Attached Files

      Comment


      • #4
        This should give you some ideas
        Attached Files

        Comment


        • #5
          You may need to change the line
          i(getBarState()==BARSTATE_NEWBAR)vLastAlert = 0;
          to
          if(getBarState()==BARSTATE_NEWBAR)vLastAlert = 0;
          Alex

          Comment


          • #6
            doh! My bad, thanks Alex for the qc work

            Comment


            • #7
              alex, david,

              thanks guys, I'll integrate your codes and study the logic this weekend. I've read about similar questions related to backtesting and automated trading, and looks like a similar fix. Perhaps, using this fix in the new version of wizard? :-} You guys are awsome!!!

              Thanks again. I'll code and let you know the results next week.

              chris...

              Comment


              • #8
                What is the variable for NewAlertTrigger? I have a ReferenceError. Attached is what I have so far, implementing both fixes for one test per bar and your one alert per bar. Are my statements put in the right place in the function main? Can you help me with this last step? I added var NewAlertTrigger = 0; is this the correct reference?

                Thanks so much,

                chris...

                SPY alerts triggered multiple times today 4/15/03 at 10:28 to 10:29 on 15min chart. not working as expected. Can you see if I have the code in the right place?
                Attached Files
                Last edited by cgnahc; 04-15-2003, 11:40 AM.

                Comment


                • #9
                  Testing your code..

                  It would appear that your code is working (as far as I can tell). I just loaded it up and received an Alert "Short Lower Low". I will continue to watch it for any signs of errors.

                  Brad
                  Brad Matheny
                  eSignal Solution Provider since 2000

                  Comment


                  • #10
                    Try This...

                    I modified some items in your code. The time stamps are used to determine is we are allowed an action (alert) or if we are allowed to test for a new alert.

                    You'll notice that I placed the TimeStamp test in the main() function to determine if we are allowed to test for a NEW ALERT.

                    I also placed the "record TimeStamp" line in each of the Alert functions (onaction1 and onaction2). This records out "alert Action" and prevents the main() loop from checking again until a new bar forms.

                    I think this is what you want.

                    Brad
                    Attached Files
                    Brad Matheny
                    eSignal Solution Provider since 2000

                    Comment


                    • #11
                      Brad,

                      Thanks for all your help. Trying it out now and notice the current bar color is white/black while alert is triggered. I won't know about how the alerts work until regular trading hours. Can you check on that bar color bug?

                      thanks,

                      chris...
                      Last edited by cgnahc; 04-15-2003, 02:36 PM.

                      Comment


                      • #12
                        setColorPriceBars( true );

                        may need to be placed in preMain()

                        to fix the white bar issue

                        Comment


                        • #13
                          ok dave,

                          done, market action slowing down after hours now, so may have to wait until tomorrow to see. Reloading all my charts. Whoops, sorry, loaded efs on qqq and bar is still white.

                          attached is the latest code.

                          chris...
                          Attached Files

                          Comment


                          • #14
                            Sometimes you need to close esignal and reopen for this change to take effect, try that please.

                            Comment


                            • #15
                              well,

                              I rebooted and reloaded, and we'll need some more market action to make sure. As qqq hit 26.68 after hours, I see a white bar on the next tick $26.67. ... Man, this is a bugger.

                              chris...

                              Comment

                              Working...
                              X