Stop out position after x hours if not in profit

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #119648 quote
    startraderstartrader
    Participant
    Senior

    Hi. Does anybody know how to code a stop out after x minutes if not in profit by then?

    #119651 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    There you go:

    IF OnMarket AND (BarIndex - TradeIndex) >= 10 AND PositionPerf <= 0 THEN  //exit any trade, be it Long or Short, after 10 bars if not profitable by then
       SELL      AT MARKET
       EXITSHORT AT MARKET
    ENDIF
    startrader thanked this post
    #119654 quote
    VonasiVonasi
    Moderator
    Master

    startrader – Welcome to the forums. Your topic is strategy related so you should have posted in the ProOrder forum which is for strategy topics rather than in the General Discussion forum.

    I have moved your topic. Please try to post in the correct forum with future topics. šŸ™‚

Viewing 3 posts - 1 through 3 (of 3 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

Stop out position after x hours if not in profit


ProOrder: Automated Strategies & Backtesting

New Reply
Author
Summary

This topic contains 2 replies,
has 3 voices, and was last updated by VonasiVonasi
6 years, 7 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 02/14/2020
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...