Announcement

Collapse
No announcement yet.

Help Candle Confirmation and alert

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

  • Help Candle Confirmation and alert

    I am trying to modify a study I downloaded based on stochastics so that it will email me if there is a buy or sell alert. I got the email alert part figured out the only thing i am trying to figure out is how to make esignal confirm that the candle has closed remaining with a buy or sell signal before sending an email.

    Im using it within this section:



    function goLong(nStop) {
    bEntry = true;
    vPosition = "long";
    vColor = Color.green;
    vStop = nStop;
    vLong = false;
    vShort = false;
    drawShapeRelative(0, low() - nSpace, Shape.UPARROW, null,
    Color.lime, Shape.BOTTOM, "l"+getValue("rawtime"));
    drawTextRelative(0, low() - (1.2*nSpace), "B", Color.lime, null,
    Text.BOLD|Text.CENTER|Text.TOP|Text.ONTOP, null, 12, "l"+getValue("rawtime"));
    Alert.email(getMostRecentAsk(),["Buy this pair:"]);
    return;
    }



    Any help would be much appreciated

  • #2
    pmazenett
    On the first tick of a new bar check for the condition to be true at the prior bar. For example assume that the signal is triggered by a cross of the Stochastic you would do as shown in the example enclosed below
    Alex

    PHP Code:
    var PercK stochK(14,3,3)
    var 
    PercD stochD(14,3,3)

    if(
    getBarState()==BARSTATE_NEWBAR){
        if(
    PercK.getValue(-1) > PercD.getValue(-1) && PercK.getValue(-2) <= PercD.getValue(-2)){
            
    Alert.email(getMostRecentAsk(),"Buy this pair:");
        }

    Comment

    Working...
    X