How to exit a position on condition1 OR condition2

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #147642 quote
    PaulchalPaulchal
    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
    robertogozzirobertogozzi
    Moderator
    Legend

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

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

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