Stop out position after x hours if not in profit

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

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

    #119651 quote
    robertogozzi
    Moderator
    Master

    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
    Vonasi
    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.

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 Vonasi
6 years ago.

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