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

Add a condition to an indicator to pause the Playback (Market Replay) process

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

    Add a condition to an indicator to pause the Playback (Market Replay) process

    Hello

    I'm customizing the indicator Position Display Indicator:
    https://ninjatraderecosystem.com/use...lay-indicator/

    Adding it some features, and what I'm actually needing is a way, hopefully a short way, to specify into the code that if any condition is met then the Market Replay process be paused inmediately. The idea is to have a strategy running and if the Account Balance = any specific custom value, for example $500.00, then the Market Replay process automatically get paused in order to be able to analyze what was wrong and that need to be improved. Please note I'm talking about to just pause the process, not to stop the process or to close the Playback connection, because the idea is to be able to analyze what happened and if you stop the process or the connection, then everything will reset to "zero" and you will have to start over.

    The code basic idea would be something like the next:

    Code:
    // code portion with '...' where extra code is needed but not written to not to have a very large message
    ...
    private double NetLiquidation;
    ...
    if (NetLiquidation =< 500.00)
    {
    // code to [B]pause [/B]the Market Replay process
    // and also print the message "[COLOR=#c0392b][B]The strategy has failed to meet the minimum necessary requirements at [U]hh:mm:mm a/pm[/U], on [U]Mmm DD, YYYY[/U][/B][/COLOR]"
    }
    else
    {
    // permanent printing the message "[COLOR=#27ae60][B]The strategy is in positive territory, you can continue trading[/B][/COLOR]" until NetLiquidation > 500.00
    }
    ...
    Could you please indicate how to this part because I tried to find a thread talking about something similar but couldn't find anything similar. Please put a code example if you can, I only have some weeks in the ninjascript world and I'm still learning.

    Thank you

    #2
    Hello futurenow,

    Thanks for your post.

    Controlling the playback by Ninjascript is not supported and no means are exposed to allow this.
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_PaulH View Post
      Hello futurenow,

      Thanks for your post.

      Controlling the playback by Ninjascript is not supported and no means are exposed to allow this.
      Thank you

      So there is not any way to control the playback when a specific condition is met

      Could you add this feature as a feature request for an future update of NinjaTrader 8?


      Comment


        #4
        Hello futurenow,

        Thanks for your reply.

        I will write this up as a feature request and will update this thread when I have further information.


        Paul H.NinjaTrader Customer Service

        Comment


          #5
          Hello futurenow,

          Your vote has been added to the existing feature request identified as SFT-3262, "Expose Playback controls for NinjaScript"

          Feature Request Disclaimer
          We receive many requests and cannot reasonably implement all requested features or changes. Interest is tracked internally and if enough interest is tracked, it would be weighed against how feasible it would be to make those changes to consider implementing.
          When new features are implemented, they will be listed in the Release Notes page of the Help Guide. The ID number will be different than the internal feature request tracking ID, but the description of the feature will let you know if that feature has been implemented.
          Release Notes - https://ninjatrader.com/support/help...ease_notes.htm
          Paul H.NinjaTrader Customer Service

          Comment


            #6
            hello, this works for me in NT8
            Code:
            if (CurrentBar == 727) { NinjaTrader.Adapter.PlaybackAdapter.PlaybackSpeed = 0; }

            Comment


              #7
              Hello balltrader,

              Thanks for your post

              Originally posted by balltrader View Post
              hello, this works for me in NT8
              Code:
              if (CurrentBar == 727) { NinjaTrader.Adapter.PlaybackAdapter.PlaybackSpeed = 0; }
              This is undocumented and unsupported code that you are welcome to use but if there are any issues we would not be able to assist.
              Undocumented code is also subject to change without notice.
              Paul H.NinjaTrader Customer Service

              Comment


                #8
                Please add my vote for this feature.

                Comment


                  #9
                  Originally posted by ender_wiggum View Post
                  Please add my vote for this feature.
                  Thanks for your feedback!

                  Your vote has been added to SFT-3262
                  Emily C.NinjaTrader Customer Service

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by cls71, Today, 04:45 AM
                  0 responses
                  1 view
                  0 likes
                  Last Post cls71
                  by cls71
                   
                  Started by mjairg, 07-20-2023, 11:57 PM
                  3 responses
                  213 views
                  1 like
                  Last Post PaulMohn  
                  Started by TheWhiteDragon, 01-21-2019, 12:44 PM
                  4 responses
                  544 views
                  0 likes
                  Last Post PaulMohn  
                  Started by GLFX005, Today, 03:23 AM
                  0 responses
                  3 views
                  0 likes
                  Last Post GLFX005
                  by GLFX005
                   
                  Started by XXtrader, Yesterday, 11:30 PM
                  2 responses
                  12 views
                  0 likes
                  Last Post XXtrader  
                  Working...
                  X