Trailing Stop using Last Down Bar

Optuma Forums Optuma Scripting Trailing Stop using Last Down Bar

This topic contains 1 reply, has 2 voices, and was last updated by Darren Darren 2 weeks, 2 days ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #54187
    Avatar
    Lester
    • Topics: 7
    • Replies: 8
    • Posts: 15

    Hi,

    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,

    Lester

    Attachments:
    #54193
    Darren
    Darren
    • Topics: 38
    • Replies: 261
    • Posts: 299

    Hi Lester,

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

    https://help.optuma.com/kb/faq.php?id=1091

    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:

    Capture

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.

Close