Exit after X minutes

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #168503 quote
    OMXet
    Participant
    Junior

    Hi

    A simple question for you guys:

    Exit a position after X minutes

    Code please

    #168506 quote
    robertogozzi
    Moderator
    Master

    Post your topic in the correct forum:
    _ ProRealTime Platform Support: only platform related issues.
    _ ProOrder: only strategy topics.
    _ ProBuilder: only indicator topics.
    _ ProScreener: only screener topics
    _ General Discussion: any other topics.

    Thank you 🙂
    _ Welcome New Members: for new forum members to introduce themselves.

    #168507 quote
    robertogozzi
    Moderator
    Master

    There you go:

    Timeframe(1 minute,UpdateOnClose)
    Once TimeLimit = 20     //exit after 20 minutes
    If not OnMarket then
       Count = 0
    Else
       Count = Count + 1
       If Count >= TimeLimit then
          Sell at Market
          Exitshort at Market
       Endif
    Endif
    OMXet and Midlanddave thanked this post
    #168511 quote
    OMXet
    Participant
    Junior

    Thanks for a quick and accurate answer.

    Works just as I want  ,>))

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

Exit after X minutes


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
OMXet @omxet Participant
Summary

This topic contains 3 replies,
has 2 voices, and was last updated by OMXet
4 years, 9 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 05/01/2021
Status: Active
Attachments: No files
Logo Logo
Loading...