Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Play Wav File when Strategy Disables
Collapse
X
-
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?Tags: None
-
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>
-
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
-
+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
-
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
![]()
by gustavobp
Today, 03:15 AM
|
||
Started by gustavobp, Today, 03:00 AM
|
0 responses
5 views
0 likes
|
Last Post
![]()
by gustavobp
Today, 03:00 AM
|
||
Started by nicbizz, Today, 02:14 AM
|
0 responses
5 views
0 likes
|
Last Post
![]()
by nicbizz
Today, 02:14 AM
|
||
Started by Ringer13, Today, 01:59 AM
|
0 responses
7 views
0 likes
|
Last Post
![]()
by Ringer13
Today, 01:59 AM
|
||
Started by NINZAMANA, 02-06-2025, 09:03 AM
|
2 responses
24 views
0 likes
|
Last Post
![]()
by Fertryd2
Today, 01:51 AM
|
Comment