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
Email alerts
Collapse
X
-
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?Tags: None
-
Great, thanks for that, is it possible to send the symbol and order price in the body of the email?
Comment
-
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
-
what would be correct format for the if statement. Im not sure how I would write the 'orderfilled' part..
if ('orderfilled')
sendmail();
ThanksLast edited by maninjapan; 10-13-2009, 03:55 PM.
Comment
-
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.htmlBertrandNinjaTrader Customer Service
Comment
-
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
-
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
-
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=7499Josh P.NinjaTrader Customer Service
Comment
-
much appreciated Josh, extrapolating that to a workable Print command is out of my reach though.....
Comment
-
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
-
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
-
You could try this reference. It may help a bit: http://www.ninjatrader-support2.com/...ead.php?t=3223Josh 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
by mattbsea
Today, 05:44 PM
|
||
Started by RideMe, 04-07-2024, 04:54 PM
|
6 responses
31 views
0 likes
|
Last Post
by RideMe
Today, 05:31 PM
|
||
Started by tkaboris, Today, 05:13 PM
|
0 responses
2 views
0 likes
|
Last Post
by tkaboris
Today, 05:13 PM
|
||
Started by GussJ, 03-04-2020, 03:11 PM
|
16 responses
3,282 views
0 likes
|
Last Post
by Leafcutter
Today, 04:14 PM
|
||
Started by WHICKED, Today, 12:45 PM
|
2 responses
20 views
0 likes
|
Last Post
by WHICKED
Today, 03:36 PM
|
Comment