Announcement

Collapse
No announcement yet.

alerts on tick give false bar on close

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

  • alerts on tick give false bar on close

    I am generating alerts on a tick by tick basis...i.e. changing bar color.

    I want to trade the alert based on the tick, to get the earliest entry, however often by the end of the interval (400t) the alert was false.

    I have been doing a manual refresh by typing in 400t when a new bar color/alert appears to test if the alert sticks. I would like to have my efs code do this refresh for me to erase the false alerts on a tick by tick basis.

    Could not find any refresh function in efs library, any ideas?

    Thanks in advance.

  • #2
    Hello ratherBgolfing,

    The method I would recommend as an alternative to reloading the chart is to use getBarState() and wait until BARSTATE_NEWBAR occurs to evaluate your alert condition, which in turn would be modified to look at the values on bar -1 rather than the current bar 0.
    Jason K.
    Project Manager
    eSignal - an Interactive Data company

    EFS KnowledgeBase
    JavaScript for EFS Video Series
    EFS Beginner Tutorial Series
    EFS Glossary
    Custom EFS Development Policy

    New User Orientation

    Comment


    • #3
      thanks....too late though?

      Thanks for the reply. I think that code with have me wait until the next bar though instead of trading on current bar? Is that correct?

      The reason I want to refresh during the current bar automatically on a tick by tick basis is to watch for the predominant alert and make a decision during the current bar to take the trade or not. Maybe not possible?

      Comment


      • #4
        another way to state problem

        Another way to state the problem is this.

        I want to only have the most current alert (bar color and entry price) print on the chart during the current bar.

        I tried to solve this by using a TagName of 1 which, unfortunately, only allows 1 alert in the whole chart; thereby accomplishing task in current bar but also erasing all alerts on all previous bars; therfore no good.

        Hence, I have been doing manual refresh during the current bar to get the current alert print in current bar without erasing prints for previous bars.

        Is there not a way to erase all previous prints during the current bar (automatically with efs code) and only show the current alert condition in current bar without erasing prints on rest of chart? Say I get 3 alerts during current bar; I am in red bar condition and get green, red, green alerts; I want to only print the last green alert during current bar. Sounds picky, at the same time often the conditions change early in the bar (400t) and I want to trade then (maybe on tick 50), rather than wait for bar to close.

        Thanks in advance.

        Comment


        • #5
          Hello ratherBgolfing,

          Try using the getCurrentBarCount() function for the tag name rather than "1." This will give each bar one unique tag name, which will allow you to accomplish your desired alert behavior and prevent erasing your previous bar's alerts at the same time.
          Jason K.
          Project Manager
          eSignal - an Interactive Data company

          EFS KnowledgeBase
          JavaScript for EFS Video Series
          EFS Beginner Tutorial Series
          EFS Glossary
          Custom EFS Development Policy

          New User Orientation

          Comment


          • #6
            Problem solved. Thanks.

            Jason,

            Thank you very much. That did the trick. It only allows one print during current bar, without disturbing previous bars/prints), which is exactly what I wanted. Before I would have a green buy entry price below bar and a red sell entry price above bar (i.e. after two or more alerts) and did not know which one to trade without refresh. Now only one print.

            Thanks again. I was frustrated for weeks on that one.

            Comment

            Working...
            X