Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy Wizard and variable Profit Target

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Strategy Wizard and variable Profit Target

    I'm trying to to get the Strategy Wizard to issue a Profit Target order based the Average Entry Price and using the indicator ATR as the offset. The Wizrd generates the correct code for the Exit Long Limit but on the Exit Short Limit I can't seem to get the Wizard to accept a minus offset. It will not accept my minus sign.

    Here is the code that the Wizard generates:
    // Condition set 3
    if (Position.MarketPosition == MarketPosition.Long)
    {
    ExitLongLimit(Position.AvgPrice + ATR(15)[0], "Exit Long PT", "Entry Long");
    }

    // Condition set 4
    if (Position.MarketPosition == MarketPosition.Short)
    {
    ExitShortLimit(Position.AvgPrice + ATR(5)[0], "Exit Short PT", "Entry Short");
    }

    I can't seem to be able to tell the Wizard that for a Short Profit Traget the ATR needs to be subtracted from the Position.AvgPrice.

    Thanks

    #2
    Here is the trick: You need to get the ATR multiplied by a -1. You can do this like:
    - add Action
    - Exit long position by a limit order
    - click on Limit price -> new box pops up
    - Average position price
    - Offset type = Price
    - click on Offset -> new box pops up
    - select ATR
    - Offset type = Percent
    - Offset = -2
    - Ok, Ok, Ok

    -> ExitLongLimit(Position.AvgPrice + (ATR(14)[0]) * (1 + -2), "", "");

    Which is equivalent to ExitLongLimit(Position.AvgPrice - (ATR(14)[0]), "", "");

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    576 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    334 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    101 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    553 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    551 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X