Changing Stop Loss after a certain time in trade

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #211470 quote
    Crocogotter
    Participant
    New

    Hiya

    I suspect that there’s a simple way of doing what I’d like, but unfortunately I haven’t got the programming knowledge to work it out. What I’d like to be able to do is change the Stop Loss to Break Even after 30 minutes, using a 1 minute chart. Initial Stop Loss would be 60, but I’d like to be able to code it to change it to Break Even after 30 minutes please.

     

    Many thanks in advance.

    #211475 quote
    robertogozzi
    Moderator
    Master

    30 minutes are 30 1-minute bars, so you must check they are elapsed AND you have some profits:

    IF OnMarket AND (BarIndex - TradeIndex >= 30) AND PositionPerf > 0 THEN
       SET STOP Breakeven
    ENDIF
    Crocogotter thanked this post
    #211476 quote
    Crocogotter
    Participant
    New

    Many thanks for the speedy reply, I’ll give that a try.

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

Changing Stop Loss after a certain time in trade


ProOrder: Automated Strategies & Backtesting

New Reply
Author
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by Crocogotter
2 years, 11 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 03/13/2023
Status: Active
Attachments: No files
Logo Logo
Loading...