Announcement

Collapse
No announcement yet.

Plotting Alerts on charts

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

  • Plotting Alerts on charts

    Is there an example somewhere of plotting Alerts on charts?

    For example:

    ...
    if (...) {Plot a red diamond at the top of current bar}
    else if (...) {Plot a green diamond at the bottom of current bar}
    ...

    Thanks.
    Mihai Buta

  • #2
    Hello mbuta,

    You can find examples in the thread below for drawing shapes.
    Drawing Images, Shapes, and Text with EFS
    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
      Drawing Shapes, Images

      Thank you Jason, I tried (manually and with Wizard) but did not work.
      Besides, I am confused with shape.XXXX (not documenbted anywhere) and setBarImage (documented in the General Formula Refrence).


      Can you please send the simplest exapmle of an efs file that draws a Red diamond at the top of the current bar if (you choose the condition - I am looking for pivots actually).

      Thank you.
      Mihai
      Mihai Buta

      Comment


      • #4
        Hello Mihai,

        Here is a basic formula that has examples of all the draw functions for lines, shapes and images. setBarImage() is actual no longer active, we'll remove that form the general reference guide.

        PHP Code:
        var study = new MAStudy(100"Close"MAStudy.SIMPLE);

        function 
        preMain() {
            
        setPriceStudy(true);
        }

        var 
        vHigh;
        var 
        vLow;
        var 
        BarCntr 0;
        function 
        main() {
            var 
        study.getValue(MAStudy.MA);

            if(
        == null)
                return;

            if (
        getBarState() == BARSTATE_NEWBAR
                
        BarCntr +=1;
            
            
        vHigh high();
            
        vLow low();
            for (
        020; ++i) {
                
        vHigh Math.max(high(-i), vHigh);
                
        vLow Math.min(low(-i), vLow);
            }

            
        drawLineRelative(-20vHigh0vHighPS_SOLID2Color.red"High");
            
        drawLineRelative(-20vLow0vLowPS_SOLID2Color.green"Low");

            var 
        space 1;
            if (
        getInterval() != "D")
                
        space high() - low();
            
            if(
        close() >= v) {
                if(!
        Strategy.isLong()) {
                    
        drawShapeRelative(0low() - spaceShape.UPARROWnullColor.limeImage.ONTOP"Buy" BarCntr);
                    
        drawTextRelative(0low() - (space 1.75), "B"Color.blackColor.limeText.FRAME Text.ONTOP Text.BOLDnull9"text buy" BarCntr );
                    
        drawImageRelative(0low() - (space 3), "SystemHappyFace"nullImage.ONTOP"buy image" BarCntr);
                    
        Strategy.doLong("Crossing Up"Strategy.MARKETStrategy.THISBAR);
                }
            } else if(!
        Strategy.isShort()) {
                
        drawShapeRelative(0high() + spaceShape.DOWNARROWnullColor.yellowImage.ONTOP"Sell" BarCntr);
                
        drawTextRelative(0high() + (space 1.75), "S"Color.blackColor.redText.FRAME Text.BOTTOM Text.BOLDnull9"text sell" BarCntr );
                
        drawImageRelative(0high() + (space 3), "SystemHappyFace"nullImage.BOTTOM"short image" BarCntr);
                
        Strategy.doShort("Crossing Down"Strategy.MARKETStrategy.THISBAR);
            }

            return 
        v;

        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


        • #5
          Re: Reply to post 'Plotting Alerts on charts'

          Thank you Jason, I will try it
          Note: It sure looks much more complicated than I hoped.
          Maybe someone takes a look at hoe TradeStation does, it is so simple there
          (they ofer special constructs for this, and others).
          Mihai

          ----- Original Message -----
          From: <[email protected]>
          To: <[email protected]>
          Sent: Thursday, February 06, 2003 2:44 PM
          Subject: Reply to post 'Plotting Alerts on charts'


          > Hello mbuta,
          >
          > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          >
          Mihai Buta

          Comment

          Working...
          X