Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Exit position condition

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

    Exit position condition

    Hi,
    I am trying to do some backtest with strategy analyzer. My idea is to enter and exit position based on indicator values - my indicator has two values: lower and upper boundry (these boundries do not change during the session).
    When data series gets below lower boundry and than start raising I want to enter with long position, which I managed this way:
    - condition: Close[0] < lower boundry
    - do: EnterLongStop(DefaultQuantity, lower boundry,"long_position")

    Once I enter such position I do not want to sell it until price reaches upper boundry, but this I cannot accomplish in Strategy builder. I tried:
    - condition: currentMarketPosition == Long
    - do: ExitLongStop(DefaultQuantity, upper boundry, "exit_long_position")
    But this does not work. When I tried just "Exit Long Position" Strategy Analyzer did exit the position on next bar. Any other type of exittin Long position was unsuccesfull.

    See atteched picture - it should enter twice for long, but instead the first long expired on close of session.

    Thank for answer
    Attached Files

    #2
    Originally posted by antonek View Post
    Hi,
    I am trying to do some backtest with strategy analyzer. My idea is to enter and exit position based on indicator values - my indicator has two values: lower and upper boundry (these boundries do not change during the session).
    When data series gets below lower boundry and than start raising I want to enter with long position, which I managed this way:
    - condition: Close[0] < lower boundry
    - do: EnterLongStop(DefaultQuantity, lower boundry,"long_position")

    Once I enter such position I do not want to sell it until price reaches upper boundry, but this I cannot accomplish in Strategy builder. I tried:
    - condition: currentMarketPosition == Long
    - do: ExitLongStop(DefaultQuantity, upper boundry, "exit_long_position")
    But this does not work. When I tried just "Exit Long Position" Strategy Analyzer did exit the position on next bar. Any other type of exittin Long position was unsuccesfull.

    See atteched picture - it should enter twice for long, but instead the first long expired on close of session.

    Thank for answer
    That looks like you are using the override that identifies an Exit signal by specifying the entry signal name. Your entry signal name is "long_position", but you asking the Exit order to exit the order that was entered with the name "exit_long_position". There is no such position.

    If you want to exit a position that was entered with a signal called "long_position", then you need to tag the Exit with the exact same signal name, "long_position".

    I will surmise that you are trying to distinguish the orders by some kind of tagging. In that case, use IOrders, and name them according to your delights.
    Last edited by koganam; 11-25-2012, 05:08 PM.

    Comment


      #3
      I tried setting up the conditions through strategy builder. Can you check what is worng with it?

      What is IOrders?

      Thanks
      Attached Files
      Last edited by antonek; 11-26-2012, 01:48 PM.

      Comment


        #4
        Originally posted by antonek View Post
        I tried setting up the conditions through strategy builder. Can you check what is worng with it?

        What is IOrders?

        Thanks
        Your description implied that you wanted a "Target", but your pictures show you entering a "Stop".

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by wzgy0920, 04-20-2024, 06:09 PM
        2 responses
        26 views
        0 likes
        Last Post wzgy0920  
        Started by wzgy0920, 02-22-2024, 01:11 AM
        5 responses
        32 views
        0 likes
        Last Post wzgy0920  
        Started by wzgy0920, Yesterday, 09:53 PM
        2 responses
        49 views
        0 likes
        Last Post wzgy0920  
        Started by Kensonprib, 04-28-2021, 10:11 AM
        5 responses
        192 views
        0 likes
        Last Post Hasadafa  
        Started by GussJ, 03-04-2020, 03:11 PM
        11 responses
        3,234 views
        0 likes
        Last Post xiinteractive  
        Working...
        X