Announcement

Collapse
No announcement yet.

add vertical Grey line at alarm point?

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

  • add vertical Grey line at alarm point?

    Hi,

    I have an efs that sounds an alarm at a low volume point.
    I would also like the formula to draw a vertical light grey line on my price chart at this point as well?
    Any suggestions?
    Thanks you
    Attached Files

  • #2
    Re: add vertical Grey line at alarm point?

    jand1
    EFS does not plot in two panes at the same time. To accomplish what you are trying to do you need to create a second version of your efs that is set up as a price study that does not plot the volume and its average and that just draws the vertical line [when the conditions are met].
    To do this you need to replace the following statement in the preMain function
    PHP Code:
    setPriceStudy(false); 
    with
    PHP Code:
    setPriceStudy(true); 
    Then replace the return statement ie
    PHP Code:
    return new Array (volume(),MAofVol); 
    with
    PHP Code:
    return; 
    At that poiint you need to add a command to draw the lines when the condition is met. For example if you want to draw the lines when Volume is greater than the average you would modify this section of code
    PHP Code:
    if (getValue("rawtime",0) != nLastRawTime1) { 
            if(
    volume()>MAofVol){        
            
    Alert.playSound("ding.wav");
            
    Alert.addToList(getSymbol()+"  "+getInterval(),"Volume Alert 1",Color.black,Color.blue);
            
    nLastRawTime1 getValue("rawtime",0);
            }
        } 
    to the following
    PHP Code:
    if (getValue("rawtime",0) != nLastRawTime1) { 
            if(
    volume()>MAofVol){        
            
    //Alert.playSound("ding.wav");
            //Alert.addToList(getSymbol()+"  "+getInterval(),"Volume Alert 1",Color.black,Color.blue);
            
    drawLineRelative(0,0,0,Infinity,PS_SOLID,1,Color.lightgrey,rawtime(0));
            
    nLastRawTime1 getValue("rawtime",0);
            }
        } 
    In this example I commented out the alerts and added the command to draw the line. Apply the same logic to the other section if you want the lines to be drawn when Volume is less than the threshold
    Alex


    Originally posted by jand1
    Hi,

    I have an efs that sounds an alarm at a low volume point.
    I would also like the formula to draw a vertical light grey line on my price chart at this point as well?
    Any suggestions?
    Thanks you

    Comment

    Working...
    X