Exit after 10 bars?

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #6442 quote
    simon_json
    Participant
    Average

    Hi,

    How do I code an exit after 10 bars after the order?

    Thanks!

    #6459 quote
    Nicolas
    Keymaster
    Master

    Hi, with the TRADEINDEX instruction.

    Example: close all long positions if the last trade were at least 10 bars ago

    IF BARINDEX-TRADEINDEX(1) >= 10 THEN 
     SELL AT MARKET
    ENDIF
    #6478 quote
    simon_json
    Participant
    Average

    Thanks!

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

Exit after 10 bars?


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
simon_json @simon_json Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by simon_json
9 years, 9 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 05/04/2016
Status: Active
Attachments: No files
Logo Logo
Loading...