Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Email alerts

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

    Email alerts

    Is it anyway possible to program a ninjascript to send an email once an order has been placed or a trade signal has been triggered?

    #2
    Hello maninjapan,

    Yes, this is possible. Please see the link below for more information.

    Comment


      #3
      Great, thanks for that, is it possible to send the symbol and order price in the body of the email?

      Comment


        #4
        maninjapan,

        You would just need to create a string that contains that information and then put it into that SendMail() command.

        To get symbol name you could use Instrument.FullName
        To get the order price you would just put in whatever price you submitted at.

        string someString = Instrument.FullName + " " + someOrderPrice;

        Then just pass in someString to SendMail().
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          what would be correct format for the if statement. Im not sure how I would write the 'orderfilled' part..

          if ('orderfilled')
          sendmail();


          Thanks
          Last edited by maninjapan; 10-13-2009, 03:55 PM.

          Comment


            #6
            Either check if your Market Position changed and thus the order put you in a trade - http://www.ninjatrader-support.com/H...tPosition.html

            Or work with the IOrder object and the returned fill state - http://www.ninjatrader-support.com/H...V6/IOrder.html

            Comment


              #7
              feel like Im getting a bit out of my depth here, is the following at least part of what I need.....



              if (order.OrderState == OrderState.Filled)

              Comment


                #8
                Suggest you just check MarketPosition along with Quantity instead of IOrders. IOrders can become complex really fast.
                Josh P.NinjaTrader Customer Service

                Comment


                  #9
                  I know you said they can get complex, but I had a go anyway.... Im trying to follow my orders.
                  I guess I dont quite have it here though.... Am I even close with what I have here?

                  Code:
                  protected override void OnOrderUpdate(IOrder order) 
                    {  
                     if (order.OrderState != OrderState.Filled)
                     {
                      Print("Order Limit Price @"+ order.LimitPrice);
                      Print("Order Status "+order.Token);
                     }  
                        
                      
                    }

                  Comment


                    #10
                    maninjapan,

                    You would need to filter it to show you a specific order. Please see this reference: http://www.ninjatrader-support2.com/...ead.php?t=7499
                    Josh P.NinjaTrader Customer Service

                    Comment


                      #11
                      much appreciated Josh, extrapolating that to a workable Print command is out of my reach though.....

                      Comment


                        #12
                        The idea is you need to assign an IOrder object to take on your entry/exit orders. Then in OnOrderUpdate() you need to check for that specific IOrder that you assigned earlier with the same if-statements as shown in the sample.

                        If all this is too advanced I suggest you not touching it as this area is complex.
                        Josh P.NinjaTrader Customer Service

                        Comment


                          #13
                          right, thats what I figured, which takes me back to square 1, trying to find out what is wrong with my not so complex breakout strategy.....

                          Comment


                            #14
                            You could try this reference. It may help a bit: http://www.ninjatrader-support2.com/...ead.php?t=3223
                            Josh P.NinjaTrader Customer Service

                            Comment

                            Latest Posts

                            Collapse

                            Topics Statistics Last Post
                            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                            0 responses
                            596 views
                            0 likes
                            Last Post Geovanny Suaza  
                            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                            0 responses
                            343 views
                            1 like
                            Last Post Geovanny Suaza  
                            Started by Mindset, 02-09-2026, 11:44 AM
                            0 responses
                            103 views
                            0 likes
                            Last Post Mindset
                            by Mindset
                             
                            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                            0 responses
                            556 views
                            1 like
                            Last Post Geovanny Suaza  
                            Started by RFrosty, 01-28-2026, 06:49 PM
                            0 responses
                            554 views
                            1 like
                            Last Post RFrosty
                            by RFrosty
                             
                            Working...
                            X