Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Play Wav File when Strategy Disables

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

    Play Wav File when Strategy Disables

    Hi, I want to play a wav file notification when a strategy is disabled. Is the correct place to put it in state == State.Terminated? Can I use Playsound() there? I have tried a basic test and it didn't work. Should I be putting it somewhere else?

    #2
    Hello sjmuk1,

    Thanks for your post.

    The PlaySound() method could be used to play a .wav file while running on real-time data.

    PlaySound: https://ninjatrader.com/support/help.../playsound.htm

    If this method is called in State.Terminated, it will play a sound anytime the State == State.Terminated. This could be multiple times as the script reaches State.Terminated multiple times throughout its lifecycle.

    See this help guide page about the NinjaScript Lifecycle explaining the states a NinjaScript goes through: https://ninjatrader.com/support/help...fecycle_of.htm

    There are no supported or documented methods for detecting if a strategy is disabled at this time so this would not be possible to accomplish.

    Please let me know if I may assist further.
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment


      #3
      Hi, In that case can you please request that a method of detecting when a strategy is disabled is created please? Also please show me where the list of errors that cause a disablement is located so I can code around it.

      Comment


        #4
        Hello sjmuk1,

        Thanks for your note.

        I have submitted this as a feature request to the development team for you. This request is being tracked under the number SFT-5742.

        As with all feature requests, interest is tracked before implementation is considered, so we cannot offer an ETA or promise of fulfillment. If implemented, it will be noted in the Release Notes page of the Help Guide.

        Release Notes — https://ninjatrader.com/support/help...ease_notes.htm

        You could use RealtimeErrorHandling to determine the behavior of a strategy when the strategy encounters an error.

        RealtimeErrorHandling — https://ninjatrader.com/es/support/h...orhandling.htm

        See this help guide page about the different ErrorCodes detectable in OnOrderUpdate(): https://ninjatrader.com/support/help...rderupdate.htm

        Please let us know if we may be of further assistance to you.​
        <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

        Comment


          #5
          +1 on this.
          As you provide a print out of when the strategy is enabled/disabled it wouldn't seem a difficult thing to implement as the core property is already there.
          It would be very helpful when strategies run into unseen errors and stops without you necessarily knowing.

          Comment


            #6
            Hello Mindset,

            Thanks for your note.

            I have added your vote to the feature request.

            Let me know if I may assist further.
            <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by gustavobp, Today, 03:15 AM
            0 responses
            5 views
            0 likes
            Last Post gustavobp  
            Started by gustavobp, Today, 03:00 AM
            0 responses
            5 views
            0 likes
            Last Post gustavobp  
            Started by nicbizz, Today, 02:14 AM
            0 responses
            5 views
            0 likes
            Last Post nicbizz
            by nicbizz
             
            Started by Ringer13, Today, 01:59 AM
            0 responses
            7 views
            0 likes
            Last Post Ringer13  
            Started by NINZAMANA, 02-06-2025, 09:03 AM
            2 responses
            24 views
            0 likes
            Last Post Fertryd2  
            Working...
            X