![]() |
This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com
|
|||||||
| Strategy Development Support for the development of custom automated trading strategies using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Senior Member
Join Date: Sep 2008
Posts: 185
Thanks: 20
Thanked 2 times in 2 posts
|
Hello,
I have an Unmanaged strategy that places orders using code similar to Code:
SubmitOrder(0, OrderAction.Buy, ..... However, the other sound files (that I normally receive using ATM orders) are not played - i.e. "Target Filled", "Stop Filled", etc. In fact, when a stop is filled, the "Order Filled" audio file is played. I have not modified these files nor their path. As I said, these work on other ATM orders for the various built-in sound files. Since this is unmanaged, do I need to place order code such that these other sound files will play? Best Regards, Kirk |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Jun 2009
Location: Denver, CO
Posts: 3,149
Thanks: 10
Thanked 89 times in 81 posts
|
Kirk, unmanaged strategies don't know what sort of orders get filled, so that is why you receive the "Order filled" audio every time any order is filled. If you want a different sound to play when your stops/targets are executed, you'll need to code that in yourself (in OnExecution()). Please let me know if you have any other questions.
Austin
NinjaTrader Customer Service |
|
|
|
|
The following user says thank you to NinjaTrader_Austin for this post: |
|
|
|
#3 |
|
Senior Member
Join Date: Oct 2007
Location: Southy Florida
Posts: 263
Thanks: 16
Thanked 1 time in 1 post
|
Austin...... I was wondering the same thing.....In the OnExecution() section, how would the code look if you wanted it to say "Stop Filled" when the stop gets filled because of the stoploss?? Thanks!
|
|
|
|
|
|
#4 |
|
NinjaTrader Customer Service
Join Date: Mar 2012
Location: Denver, CO
Posts: 1,197
Thanks: 135
Thanked 181 times in 180 posts
|
Hello edgeliner,
You would want to use the GetAtmStrategyStopTargetOrderStatus() method for this to be able to get the status of the stop or target order. So you could do something like this: Code:
protected override void OnExecution(IExecution execution)
{
string[,] stopLossFilled = GetAtmStrategyStopTargetOrderStatus("STOP1", atmStrategyId);
if( stopLossFilled.Length > 0)
{
for(int i = 0; i < stopLossFilled.GetLength(0); i++)
{
if(stopLossFilled[i, 2].ToString() == OrderState.Filled.ToString())
{
Alert("Alert1", Priority.Low, "stop filled", "StopFilled.wav", 2, Color.White, Color.Black);
}
}
}
}
http://www.ninjatrader.com/support/h...rgetorders.htm Note, that you would have to have the same atmStrategyId to be able to get the proper order state. For an example of the ATM Strategy method you can go to the Control Center -> Tools -> Edit NinjaScript -> Strategy and double click on the SampleAtmStrategy to view some code. Let us know if we can be of further assistance.
JC
NinjaTrader Customer Service |
|
|
|
|
The following user says thank you to NinjaTrader_JC for this post: |
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Sound files | pkinoc | ATM Strategies (Discretionary Trading) | 7 | 11-14-2011 03:21 PM |
| Sound files | gg80108 | General Programming | 1 | 02-17-2011 08:38 AM |
| Controlling Strategy Order Sound Files | sgordet | Strategy Development | 1 | 01-03-2011 03:05 AM |
| sound files | donthiessen | Miscellaneous Support | 2 | 11-09-2010 08:49 AM |
| Sound files... | funk101 | General Programming | 3 | 04-29-2007 07:51 PM |