SL on last candle

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #150463 quote
    umebon
    Participant
    Average

    Hi

    I have read and tried too figure this out but I can’t get it too work. I would like too have a SL that moves with previous candle. If price moves up i want SL too move to be set too last candles low. I’m working long only..

    #150465 quote
    robertogozzi
    Moderator
    Master

    There you go:

    IF Not OnMarket THEN
       NewSL = 0                     //clear NewSL when not OnMarket
    ELSE
       IF close > close[1] THEN      //update stop loss when price is rising
          NewSL = max(NewSL,low[1])  //to previous candle's low, if higher than before
       ENDIF
       IF NewSL > 0 THEN
          SELL AT NewSL STOP         //exit at calculated stop, if any
       ENDIF
    ENDIF
    umebon thanked this post
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

SL on last candle


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
umebon @umebon Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by robertogozzi
5 years, 3 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 11/14/2020
Status: Active
Attachments: No files
Logo Logo
Loading...