How to exit a position on condition1 OR condition2

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #147642 quote
    Paulchal
    Participant
    Average

    Hi

    It is possible to have a OR condition.

    To exit a position can I have if long on market condition 1 OR condition 2 sell?

    #147643 quote
    robertogozzi
    Moderator
    Master

    You may have as many conditions you need, using both AND and OR, even combining them, eventually using parentheses  to set their priority.

    Example (2 ways to code the same conditions to exit a Long position):

    //   1
    If LongOnMarket AND (Condition1 OR condition2) Then
       SELL AT MARKET
    Endif
    ///////////////////////////////////////////////////////
    //   2
    c1 = LongOnMarket
    c2 = Condition1
    c3 = Condition2
    If c1 AND (c2 OR c3) Then
       SELL AT MARKET
    Endif

    I moved your post from thr ProScreener to the ProOrder support forum, as it’s a strategy.

    Please use the correct support forum. Thank you 🙂

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

How to exit a position on condition1 OR condition2


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Paulchal @paulchal Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by robertogozzi
5 years, 4 months ago.

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