2 conditions in 1 alert

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #97501 quote
    bewoke2
    Participant
    Average

    Hey folks !

    I have a question regarding how to set up two “specific” conditions in my alert.

    I have an open position, I would like to set an alert when 2 candlesticks closes above (or below whatever) the EMA13 line.

    To code that I’d write (myEMA is the EMA13 line):

    if (close[1] > myEMA and open[0] > myEMA and close[0] > myEMA).

    A chart is more explainful than the post, so I joined an example when my alert should pop-up.

    Thank you very much, I hope I was clear enough.

    Regards !

    tess.png tess.png
    #97503 quote
    robertogozzi
    Moderator
    Master

    Your code is perfect!

    #97529 quote
    bewoke2
    Participant
    Average

    Yes if I was setting up a scanner, but I want to make an alert. I found that I can make two conditions but can’t do the setup explained above.

    #97535 quote
    robertogozzi
    Moderator
    Master

    To set alerts you must do it with the available tool on the platform.

    Screeners, Indicators and Strategies cannot set alerts.

    You might also write an indicator that returns either 0 or 1 when your conditions are false or true, then set an alert on the platform on those returned values.

    #97539 quote
    bewoke2
    Participant
    Average

    Ok gotcha ! thanks !

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.

2 conditions in 1 alert


Platform Support: Charts, Data & Broker Setup

New Reply
Author
author-avatar
bewoke2 @bewoke2 Participant
Summary

This topic contains 4 replies,
has 2 voices, and was last updated by bewoke2
6 years, 9 months ago.

Topic Details
Forum: Platform Support: Charts, Data & Broker Setup
Language: English
Started: 05/02/2019
Status: Active
Attachments: 1 files
Logo Logo
Loading...