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!
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
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.
https://ninjatrader.com/support/help.../playsound.htm
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.Brandon H.NinjaTrader Customer Service
-
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
-
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.
https://ninjatrader.com/support/help.../playsound.htm
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
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by Taras, Yesterday, 03:44 AM
|
7 responses
129 views
0 likes
|
Last Post
by jeronymite
Today, 05:29 PM
|
||
Started by anton_tymoshchuk, Yesterday, 01:43 AM
|
4 responses
71 views
0 likes
|
Last Post
by jeronymite
Today, 05:25 PM
|
||
Started by trader24211341, 03-09-2023, 12:30 PM
|
2 responses
37 views
0 likes
|
Last Post
![]() |
||
Started by ct, Today, 04:56 PM
|
0 responses
6 views
0 likes
|
Last Post
![]()
by ct
Today, 04:56 PM
|
||
Started by qewcool, 03-19-2023, 05:51 PM
|
24 responses
207 views
1 like
|
Last Post
![]()
by jama12
Today, 04:43 PM
|
Comment