Exit after 2 bars after entry conditions

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

    Hi

    I would like to write an exit strategy that after my entry conditions are met I exit after 2 candles. I cant put a flatafter time as I have between opening times. I am using 1TF.

    Any ideas?

    #171798 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    There you go:

    If OnMarket AND (BarIndex - TradeIndex) >= 2 Then
       Sell at Market
       Exitshort at Market
    Endif
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

Exit after 2 bars after entry conditions


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, 3 months ago.

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