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!
See more
See less

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

    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
            BertrandNinjaTrader Customer Service

            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 mattbsea, Today, 05:44 PM
                            0 responses
                            3 views
                            0 likes
                            Last Post mattbsea  
                            Started by RideMe, 04-07-2024, 04:54 PM
                            6 responses
                            31 views
                            0 likes
                            Last Post RideMe
                            by RideMe
                             
                            Started by tkaboris, Today, 05:13 PM
                            0 responses
                            2 views
                            0 likes
                            Last Post tkaboris  
                            Started by GussJ, 03-04-2020, 03:11 PM
                            16 responses
                            3,282 views
                            0 likes
                            Last Post Leafcutter  
                            Started by WHICKED, Today, 12:45 PM
                            2 responses
                            20 views
                            0 likes
                            Last Post WHICKED
                            by WHICKED
                             
                            Working...
                            X