Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Path variable for \Documents\NinjaTrader 8 location
Collapse
X
-
Path variable for \Documents\NinjaTrader 8 location
I want to export custom sound files with my indicator. I understand how to add them to the exported .zip file but my question is, the full path to the NinjaTrader 8 folder under Documents is different on other PC's. What can I use for a path in the PlaySound statement in my code? Is there a NinjaTrader.Core.Globals statement for the Documents install location? I did try PlaySound(@"%userprofile%\Documents\NinjaTrader 8\... but it doesn't work ThanksTags: None
-
Hello mlarocco,
Thanks for writing in.
There are no supported NinjaTrader.Core.Globals statement for accessing the Documents folder. The specific file path would need to be hardcoded in your script
You can obtain the default NinjaTrader installation directory to access the sounds folder by using NinjaTrader.Core.Globals.InstallDir property. An example of this could be seen on the PlaySound help guide page linked below.
We are tracking interest in a current feature request ticket for the ability to supply the default location of custom sounds. I have submitted your vote to SFT-1652.
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
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>
-
Here is a code bite work-around I use.
private string strSoundfile_Buy;
private const string strcSoundFile_Alert2 = @"\sounds\Alert2.wav";
..
..
else if (State == State.DataLoaded)
{
strSoundfile_Buy = NinjaTrader.Core.Globals.InstallDir + strcSoundFile_Buy;
}
Define a string to use in an Alert or Playsound. Then initialize it in State.DataLoaded event... and use from that point forward.
Cheers
Comment
-
After I posted this I found I can use "PlaySound(NinjaTrader.Core.Globals.UserDataDir + @"\templates\BA5minGold\Cancel Order.wav");" and it seems to work fine. Does this make sense?Originally posted by NinjaTrader_BrandonH View PostHello mlarocco,
Thanks for writing in.
There are no supported NinjaTrader.Core.Globals statement for accessing the Documents folder. The specific file path would need to be hardcoded in your script
You can obtain the default NinjaTrader installation directory to access the sounds folder by using NinjaTrader.Core.Globals.InstallDir property. An example of this could be seen on the PlaySound help guide page linked below.
We are tracking interest in a current feature request ticket for the ability to supply the default location of custom sounds. I have submitted your vote to SFT-1652.
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
Please let me know if I may assist further.
Thanks
Comment
-
Hello mlarocco,
Thanks for your note.
This is not documented in the help guide but if it is working for you then yes, you could likely use that when calling the PlaySound() method in your script.
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
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
633 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
364 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
105 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
567 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
568 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment