Stop Loss after 4 days

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #12143 quote
    michi2410
    Participant
    New

    hello,

    at the moment iam developing a new stategy and i need your coding support.

    i’m looking for the code snippet to define that my long position should sell after 4 days.
    i only can found thinks like sell after x pipes or soething like this, but i only need the command to sell my long position after 4 days

    greetings

    #12148 quote
    Nicolas
    Keymaster
    Master

    If you are trading on a daily timeframe, you can test if the actual trade has 4 bars elapsed since its inception. You should look at TRADEINDEX in the documentation.

    #12175 quote
    michi2410
    Participant
    New

    Hi Nicolas,

    thank you very much!

    IF LONGONMARKET AND (BarIndex – TradeIndex) >= 4 THEN
    SELL AT MARKET
    ENDIF

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

Stop Loss after 4 days


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
michi2410 @michi2410 Participant
Summary

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

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