Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

MIT does not change when strategy conditions change

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

    MIT does not change when strategy conditions change

    Hi,
    I have a strategy (based on 1 hour Chart), that enters an MIT order once certain conditions are met. The MIT limit is an EMA.
    It is very well possible, that all conditions are met as of e.g. 10 am, however the EMA is only touched e.g. 6 hours later, hence the EMA changed from when conditions were met for the first time, until conditions are still met AND the current EMA/Limit is touched.

    The strategy is supposed to change the MIT limit every hour (actually I set calculate "on each tick"), when a new EMA is "available". This works very well in the backtest.

    Going live though, the strategy does not adjust the MIT limit over time to new EMA values.

    I created the strategy with the strategy builder, calculate on each tick. The set that defines the entry is quite simple: If all: condition a, b, c --> Action: EnterlongMIT(Defaultquantity,(EMA(xyz)[0]);

    Any idea why the strategy does not update the MIT limit, or enter a new MIT limit on bar close?
    Also, in case conditions a, b or c are not met anymore, then of course I don't want the EnterlongMIT limit anymore.

    Hence, what I want is a completely new check of conditions on every new bar, and a reset of the MIT limit (and a cancellation of the former limit)

    Thanks a lot for your thoughts!







    #2
    Hello Jayzie,

    Welcome to the NinjaTrader forums!

    Thank you for reporting this.
    I am noticing the MIT order is only updating to a new price when the bar closes and is not updating intra-bar.

    I've submitted a report to our development about this.
    Once I have further information or a tracking ID for this behavior, I will update this thread.


    However, you have mentioned that the MIT order is not updating when the bar closes.
    Attached is a test script.
    Are you able to reproduce this behavior where the MIT order is not updating when the bar closes with the attached test script?
    Attached Files
    Last edited by NinjaTrader_ChelseaB; 04-17-2019, 08:10 AM.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hi Chelsea,
      Thanks for your message, and yes, please keep me posted when you get news from your development team.

      How should I try to reproduce the behavior with the test script? Could you please give further advice how to test it?
      As mentioned, I only realized this behavior when I set the strategy live. I tested it on the simulation account prior to setting live, however didn't realize it then. However it might be that it happened and I just didnt see it.
      I will run again on simulation mode and check. It might however be that it takes a few days / weeks until such a situation arrives.
      Will keep you posted as well.

      Kind regards!

      Comment


        #4
        ps: I did set the strategy calculation "on bar close" now. then actually it should work and update the MIT at every bar close, correct?

        Comment


          #5
          pps: the situation came faster than i thought, sadly the MIT limit did not update on bar close, even though the EMA (which is the MIT limit) changed it's value.
          In order to double check, I de-activated the strategy when a new bar started, deleted the MIT order from the orders tab, and activated the strategy again. Immediately a new limit order appeared in the chart, with a different limit value.

          Comment


            #6
            Hello Jayzie,

            Below is a link to a video of testing the test script I have provided you.


            If you take the same steps as shown in the video are you experiencing different behavior than what is shown in the video?

            If so, please let me know and I will have you contact our platform support so that we may schedule a call so that I may test this test script on your end.
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              Hi Chelsea,
              thanks a lot for the video and the explanation. I ran the test script as explained in the video, it worked exactly as in the video. Then I ran my strategy on the same mode, it also ran as it should run (i.e. the MIT limit changed on every new candle). I don't know why it didn't update the MIT limit on each candle when I ran it live. Unless you do not have any other idea, I will run my strategy on simulation mode again and observe.
              please let me know if you have any other thoughts why the MIT limit didn't update with each candle when i ran the strategy live recently - or if you have any other idea what i could test or how I could proceed.

              Thanks a lot!

              Comment


                #8
                Hello Jayzie,

                Our development pointed out I made a simple mistake using the Low[0] instead of the Close[0]. If the price slider is going up, the low of the bar isn't going to change.

                I tested again using the Close[0], and the order is updating in real-time as expected. Updated test script attached.
                Attached Files
                Chelsea B.NinjaTrader Customer Service

                Comment


                  #9
                  HI Chelsea,
                  thanks again.
                  I tested again with simulated data feed, your test script works fine. As well does my own strategy with the simulated data feed, the MIT limit order updates on bar close (which it is supposed to do). My MIT limit order is a function of the EMA value. So whenever the EMA value changes, the MIT limit order is supposed to change as well.
                  Sadly that didnt happen last week when I traded it live. The MIT limit order did not change on bar close, even though it should have, as the EMA changed its value.
                  Summarizing: The update of the MIT limit order work fine in the backtest, it works fine on simulated data feed, sadly it didn't work in live trading.
                  Any idea why that could be?

                  Thanks

                  Comment


                    #10
                    Hello Jayzie,

                    I don't see any reason the account type would make a difference, live or sim.

                    Are you able to reproduce this with a live order?

                    Try placing the order at a larger distance where it will not be filled in high activity and see if there is no movement in real-time. (Then cancel it)
                    Chelsea B.NinjaTrader Customer Service

                    Comment


                      #11
                      Hi Chelsea,

                      I tried it again today with a live order, the MIT limit didn't update on bar close.
                      I took a video with the MIT limit order active, then I disabled the strategy, cancelled the order, re-activated the strategy: the new MIT limit order has been 1 point higher - actually where the old order should have been as well. (there hasn't been a bar close in between disabling the strategy and re-activating it). If you want I can send the video.

                      any additional idea how we find out why the order doesn't update?

                      Thanks

                      Comment


                        #12
                        Hello Jayzie,

                        To confirm you are using the updated test script I have provided you in post #8?

                        If so, please send an email to platformsupport [at] ninjatrader [dot] com so that you may demonstrate the behavior is different with this script on your end.
                        In the email please include a link to this forum thread.

                        Chelsea B.NinjaTrader Customer Service

                        Comment


                          #13
                          Hi,
                          I am facing exactly the same issue with MIT orders described above. The strategy updates the MIT order on the bar update accordig to the value change of the indicator, both with Sim101 and backtesting, but not when running Live.
                          I am really struggling to understand why this happens. I am connected to NT Continuum, the MIT order trigger is activated when conditions are met, but if not triggered the indicator value is updating but not the MIT order value.
                          What could cause the different behaviour? I am running on 30 min OnBaUpdate
                          Thank you,
                          Martin

                          Comment


                            #14
                            Hello martin70,

                            Welcome to the NinjaTrader forums!

                            Have you tested the test script posted in post #8?
                            I've tested this and found it works in real-time.

                            If this test script is giving you different behavior, I would like you to send an email to scriptingsupport [at] ninjatrader [dot] com so that we may schedule a call where I can observe you testing this provided test script on your end.
                            Chelsea B.NinjaTrader Customer Service

                            Comment


                              #15
                              Hi Chelsea,
                              I tested Live the script in post #8. It dos not work, MIT is triggered at the beginning and then does not update (I tested on MCL 1 min bars). I've sent you the Email on scriptingsupport.
                              Thank you
                              Martin

                              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