Trailing Stop using Last Down Bar

Optuma Forums Optuma Scripting Trailing Stop using Last Down Bar

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #54187
    • Topics: 12
    • Replies: 17
    • Posts: 29


    Can anybody please help.

    I am trying to script a trailing Stop Loss which uses the last Down Bar.  As per the attached diagram.

    I have used LOW() <=  LAST(BARTYPES().Lower     Also tried other variations like CrossesUnder and Crosses.

    However the “LAST()” function does not work as I think!

    Does anyone know what does?

    Also would like to know how to correctly use LAST() function.

    Thanks in anticipation,


    • Topics: 43
    • Replies: 312
    • Posts: 355

    Hi Lester,

    LAST() plots the latest value of the tool or price. See here for examples:

    To get the value of the last low of a lower bar (including an outside bar) use the VALUEWHEN() function:

    So the stop formula would be when the low value of the lower/outside bar is lower than the previous:

    The blue line is the low value and the red Show Bars are when they are lower:


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

Pin It on Pinterest

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.