Exit after X minutes

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

    Hi

    A simple question for you guys:

    Exit a position after X minutes

    Code please

    #168506 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    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
    robertogozzirobertogozzi
    Moderator
    Legend

    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
    OMXetOMXet
    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.
ProRealAI ProRealAI New

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTimeā„¢ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

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 OMXetOMXet
5 years, 5 months ago.

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