Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy stay highlighted yellow after ExitOnClose

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

    Strategy stay highlighted yellow after ExitOnClose

    Hi,
    I found one issue where strategy doesn't turn into running green state, even if the strategy itself isn't at position.

    Issue happen at this specific scenario:
    • Setup strategy into the chart (maybe this doesn't need to be done)
    • Enable strategy between sessions, so no new data are comming into the chart
    • The strategy had to have trade generated at previous session, which is closed on ExitOnClose

    If you enable strategy this way, the strategy stays yellow even if position was already closed. The strategy doesn't even turn green at next market open, so if strategy generate another trade, this trade will be ignored to be executed.

    Regards
    Dalibor

    #2
    Hello Dalibor,

    Thank you for your post.

    Can you re-create this with the SampleMaCrossOver in NinjaTrader?

    Can you provide a strategy as an example that I could test on my end to re-create this item?

    I look forward to your response.

    Comment


      #3
      Hi PatrickH,

      please try strategy from attachement. This strategy simply generate trade all the time with ExitOnClose enabled. You can use for examle NQ symbol with session CME Index Futures RTH. You should also try scenario, when strategy is Enabled in the middle of session. In that case the strategy also don't turn green after session end.
      Attached Files

      Comment


        #4
        Hello Dalibor,

        Thank you for your response.

        I am not seeing the same results on my end. Please go to Tools > Options > Strategies > NinjaScript > On Starting a Real-Time Strategy > and please advise what this setting is set to.

        I look forward to your response.

        Comment


          #5
          I have set Wait until flat before executing live.

          I also attach printscreen to see how my environment look like after market close.
          Attached Files

          Comment


            #6
            Hello Dalibor,

            Thank you for your patience.

            This is due to the order handling in NinjaTrader. Market Orders (ExitOnClose in this case) cannot be submitted on the last bar of the session. This also is true for enabling the strategy in between the session close and open, as the last bar was the last bar of the previous session.

            This is true for historical data, but in real-time the ExitOnClose works as intended.

            Please let me know if I may be of further assistance.
            Last edited by NinjaTrader_PatrickH; 09-11-2013, 01:46 PM.

            Comment


              #7
              Hi Patrick,

              Understand, but I still see the issue that you can miss the trade on the next day if you aren't careful. So is there a workaround to make the things work (in best where no code change is required)? I guess that enabling strategy at first 15 minutes of next session should work, but in that case I'm not near to my computer at that moment, so I can't realize that this way.

              On other side, in this special case I don't see the problem to close the trade at session close while this is still backtest and NinjaTrader is ordinarily able to close trade at session close for the backtest mode, because no broker order is executed in here.

              Dalibor

              Comment


                #8
                Hello Dalibor,

                Thank you for your response.

                There is no work around I am aware of for this item order that are submitted on the last bar historically or when in real-time with CalculateOnBarClose = True will need a a new bar before the order is submitted, but if it is the last bar it is never going to be submitted as it is ExitOnClose and not ExitOnOpen.

                Please let me know if I may be of further assistance.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by algospoke, 04-17-2024, 06:40 PM
                6 responses
                48 views
                0 likes
                Last Post algospoke  
                Started by arvidvanstaey, Today, 02:19 PM
                4 responses
                11 views
                0 likes
                Last Post arvidvanstaey  
                Started by samish18, 04-17-2024, 08:57 AM
                16 responses
                61 views
                0 likes
                Last Post samish18  
                Started by jordanq2, Today, 03:10 PM
                2 responses
                9 views
                0 likes
                Last Post jordanq2  
                Started by traderqz, Today, 12:06 AM
                10 responses
                19 views
                0 likes
                Last Post traderqz  
                Working...
                X