Sell after x amount of bars?

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #8051 quote
    dajvop
    Participant
    Master

    Hello! Need help with code to let me sell or exitshort (if on market) after x amount of bars.

    Thanks!

    #8062 quote
    Nicolas
    Keymaster
    New

    Hello, you need the TRADEINDEX instruction which save the BARINDEX number when the trade were launched.

    For example, if you want to exit a trade that have at least 5 bars elapsed since it were launched:

    if onmarket and BARINDEX-TRADEINDEX(1)>5 then 
      SELL AT MARKET 
      EXITSHORT AT MARKET 
    endif
    #8089 quote
    dajvop
    Participant
    Master

    Thank you Nicolas!

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

Sell after x amount of bars?


ProOrder support

New Reply
Author
author-avatar
dajvop @dajvop Participant
Summary

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

Topic Details
Forum: ProOrder support
Language: English
Started: 05/26/2016
Status: Active
Attachments: No files
Logo Logo
Loading...