Define a time stop

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #147892 quote
    sebb9707
    Participant
    Junior

    Hi,

    I would like to define a time exit in a trading system where it sell the position after 5 days. How do I define that?

    I would also like to know how to define a sell of a postion at close of the first day with profit but with a maximum of 5 days. How would that be defined?

    Best regards,
    Sebastian B

    #147898 quote
    robertogozzi
    Moderator
    Master

    On a daily TF ?

    #147899 quote
    sebb9707
    Participant
    Junior

    Hi,

    Yes, on a daily TF, please.

    Best regards,
    Sebastian B

    #147903 quote
    robertogozzi
    Moderator
    Master

    Exit after N days:

    N = 5
    If OnMarket and ((BarIndex - TradeIndex) >= N) Then
       Sell at Market
       Exitshort at Market
    Endif
    #147905 quote
    robertogozzi
    Moderator
    Master

    Exit after N days or earlier if in profit:

    N = 5
    If OnMarket and (((BarIndex - TradeIndex) >= N) or (PositionPerf > 0)) Then
       Sell at Market
       Exitshort at Market
    Endif
    #147909 quote
    sebb9707
    Participant
    Junior

    Thank you so much for the help!

    Best regards,
    Sebastian B

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

Define a time stop


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
sebb9707 @sebb9707 Participant
Summary

This topic contains 5 replies,
has 2 voices, and was last updated by sebb9707
5 years, 3 months ago.

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