Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

RC1 and strategy exits not completing

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

    RC1 and strategy exits not completing

    I am running a strategy on forex instruments using simple static targets and stop losses to exit the trades.

    Several times now I have observed that the strategy will exit a position, and it will add the PnL to the "Realized Profit" column, but it will not set the "Unrealized Profit" and the "Average Price" columns back to zero.

    More importantly though it does not cancel the non-executed order of the OCO exit order pair.

    In my logging, I also do not see any log statement from the onExecution event for the exit order when it's hit, i.e. the strategy's onExecution event isn't fired.

    This has happened twice in comparison to about 10 correct exits.

    I also noticed that the orders are not submitted to IB as OCO. This is despite the checkbox "Local OCO Simulation" being not checked in the IB connection config.

    This means that I am not safe from unintended consequences if my connection to the internet goes down for long - as it did last night due to a power black-out in my area of London, for 6 hours.
    Last edited by adamus; 11-09-2010, 09:12 AM.

    #2
    Hello adamus,

    Please use Help > Mail to support feature to send your log / trace files. Let us know the date time when this occurred so we know where to investigate.

    If you can isolate the steps needed to see this and a simple strategy, please include those as well.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      It occurred 3 times today but I'm afraid I don't recall when or which instrument anymore. I'll wait until it happens again.

      Comment


        #4
        I think that part of the problem with OCO is that my script should do something extra to create the OCO flag.

        Currently in the onExecution() event for entries, I submit ExitLongStop and ExitLongLimit with the fromEntrySignal label given to tie the exits to the position.

        However the exit limit and stop orders are not submitted OCO. In the Control Center Orders tab, the OCO column is empty.

        In the Help docs for the ExitLongLimit and ExitLongStop methods, there is no reference to OCO as a possibility. But it is very important to me to submit these orders OCO into the broker platform (IB) so that the exit orders are OCO live even if my internet connection goes down.

        I see that in my IB connection setup, I have the option "Local OCO simulation" disabled. Is this my problem? I understood that this is meant to be disabled if I want the OCO flag set on the orders with IB.

        Comment


          #5
          Hello,

          The issue is not your configuration your configuration is correct.

          Your issue is that your using the managed approach to order entry and ExitLongLimit()

          Since you are correct there is no way to set OCO on the managed approach. The strategy needs to be connected to know when to cancel the stop loss if one gets hit currently and your position is no longer long or short.

          To Get OCO tied orders using managed approach your only option is SetStopLoss() and SetProfitTarget(), these orders are OCO tied when submitted.

          You can then use this method to move them if you need to move them:

          Modifying them:


          Monitoring Them:


          To add OCO manually if you need multiple profit targets and stop losses you would need to use the unmanaged approach however to be able to set the OCO id.



          Let me know if I can be of further assistance.

          Comment


            #6
            I have an occurence of the strategy failing to register the closing execution in the 'Unrealized' column of the strategies tab.

            NT has moved the PnL into the 'Realized' column and closed the position but it looks like the strategy is messed up.

            My logging shows no onExecution event was ever called so it thinks it's still long.

            This is only one trade in about 200 I have executed over the last 10 days. There were a couple of others as I mentioned earlier but generally this is 1 in 50 or 1 in 75 occurence.

            After re-enabling the strategy, I can see from my logging that the simulated trading of the 20 'DaysToLoad' history has executed without the same problem, i.e. historically the onExecution event was fired for this trade exit.
            Last edited by adamus; 11-16-2010, 08:35 AM.

            Comment


              #7
              Thanks. Please use the Help > Mail to support feature to send us your log / trace files.(Attn: 392261) Let us know the date / time that this occurred.
              Ryan M.NinjaTrader Customer Service

              Comment


                #8
                It happened yesterday shortly before I made my previous post on this thread.

                What time zone is that? My time zone is GMT0+0
                Attached Files

                Comment


                  #9
                  Hello adamus,

                  There can be several lines per second in that log file. Please let us know the exact date / time when this occurred.
                  Ryan M.NinjaTrader Customer Service

                  Comment


                    #10
                    Sorry, I don't know.

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by Carolscogginsi, Yesterday, 10:45 PM
                    0 responses
                    5 views
                    0 likes
                    Last Post Carolscogginsi  
                    Started by RaddiFX, Yesterday, 10:15 AM
                    2 responses
                    15 views
                    0 likes
                    Last Post RaddiFX
                    by RaddiFX
                     
                    Started by patrickmlee007, Yesterday, 09:33 AM
                    2 responses
                    18 views
                    0 likes
                    Last Post patrickmlee007  
                    Started by magnatauren, 08-15-2020, 02:12 PM
                    5 responses
                    208 views
                    0 likes
                    Last Post RaddiFX
                    by RaddiFX
                     
                    Started by rene69851, 05-02-2024, 03:25 PM
                    1 response
                    23 views
                    0 likes
                    Last Post rene69851  
                    Working...
                    X