Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Built-In Sound Files in Unmanaged Strategy

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

    Built-In Sound Files in Unmanaged Strategy

    Hello,

    I have an Unmanaged strategy that places orders using code similar to
    Code:
    SubmitOrder(0, OrderAction.Buy,  .....
    When orders are pending and filled, targets and stops are pending / filled / cancelled, etc., the built-in audio files stating "Order Pending", ""Order Filled" are correctly played.

    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
    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.
    AustinNinjaTrader Customer Service

    Comment


      #3
      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!

      Comment


        #4
        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);
        					}
        				}
        				
        			}
        		}
        Here is a link to our Help Guide that goes over GetAtmStrategyStopTargetOrderStatus() that you may view:
        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.
        JCNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by argusthome, Yesterday, 10:06 AM
        0 responses
        17 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        16 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        14 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        9 views
        0 likes
        Last Post TheRealMorford  
        Started by Mindset, 02-28-2026, 06:16 AM
        0 responses
        36 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Working...
        X