Announcement

Collapse
No announcement yet.

Add alert and draw?

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

  • Add alert and draw?

    Can someone please tell me how I can get an alert to pop up after the following condition is met? I've read and read and tried and tried but just can't get it to do it correctly?
    Thanks is advance.

    if ((BBhigh <= KChigh) || (BBlow >= KClow)) {
    drawShapeRelative(0,0,Shape.CIRCLE,null,nColorSque eze,Shape.TOP);

    I want it to sound an alert when this occurs.....

  • #2
    TxTrader2
    From your description it is not clear if you want the alert to be triggered when the condition first occurrs during a bar or when it occurrs on a completed bar only.
    In the first case see the example shown in this thread.
    In the second case use an if(getBarState()==BARSTATE_NEWBAR) statement and in it check for your condition to be true at the prior bar at which point you execute the alert.
    For information on the available types of alerts and their syntax see this article in the EFS KnowledgeBase
    Alex

    Comment

    Working...
    X