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
Need email alert to give name of instrument
Collapse
X
-
Need email alert to give name of instrument
I run 2 different strategies on about 10 instruments in four different time frames. When I get an email I have to manually scan the instruments to see which one triggered the alert. Is there an easy way to get the strategy to tell me which instrument triggered the alert? Thanks!Tags: None
-
Using sendmail now
That is what I am using now to send the email but the message states "Long startegy triggered" I would like it to say long strategy triggered on USDJPY in 30 min time frame for example. Is there a way to get NT to "get the name of the instrument and automatically out it in the email. I am not aware of a way to get sendmail to do this. Thanks!
Comment
-
Code:SendMail("[email protected]", "[email protected]", "Trade Alert", "Long strategy triggered on " + Instrument.MasterInstrument.Name + " in " + Bars.Period.Value + "-" + Bars.Period.Id + " time frame.");
"Long strategy triggered on ER2 in 1-Minute time frame."Josh P.NinjaTrader Customer Service
Comment
-
-
The NinjaTrader documentation people may already have done this, but if not, I'd like to suggest this as a good example to add to the Help under SendMail.
It would be nice to see this example of Josh's there, in addition to the somewhat less complex example that's already there.
Also, I know its a matter of personal preference, but I like this alternate, but equivalent format that could be added as well:
Code:SendMail("[email protected]", "[email protected]", "Trade Alert", String.Format("Long strategy triggered on {0} in {1}-{2} time frame", Instrument.MasterInstrument.Name, Bars.Period.Value, Bars.Period.Id ));
When I first started with NinjaScript, some 8 months ago, I was somewhat lost on all the C# and .net ideosyncracies for a while, and it took me maybe a month to run across this one (String.Format instead of Variable.ToString() which really got tiresome after a while.) When I say I was a little lost, this is in spite of many years of programming in various other languages; I cannot imagine what it must be like for someone who has little or no experience when they're trying to pick up all these useful things that can be done in C#, but I suspect that little things like this might help. I think that adding more verbose and well-commented examples to the Help documentation would probably be a great assistance to any novice C# or NinjaScript programmer. I will try to add additional items to the forum to help on this, too, as they occur to me.
Comment
-
Originally posted by NinjaTrader_Josh View PostCode:SendMail("[email protected]", "[email protected]", "Trade Alert", "Long strategy triggered on " + Instrument.MasterInstrument.Name + " in " + Bars.Period.Value + "-" + Bars.Period.Id + " time frame.");
"Long strategy triggered on ER2 in 1-Minute time frame."
Comment
-
Hello cachevery,
Thank you for your post.
The time would be added with Time[0]:
Code:SendMail("[email protected]", "[email protected]", "Trade Alert", "Long strategy triggered on " + Instrument.MasterInstrument.Name + " in " + Bars.Period.Value + "-" + Bars.Period.Id + " time frame[B], at " +Time[0][/B]);
Comment
-
Originally posted by cacheveryThank you Patrick,
Now can you please help me with the adding email alert for the two conditions.One which goes one tick above 1000>>>1001,and the other which goes below the constant >>>999.I`ve attached the code and the screenshot to better understand what i need.
Thanks in advance!
Comment
-
Originally posted by NinjaTrader_PatrickH View PostHello cachevery,
Thank you for your post.
The time would be added with Time[0]:
Code:SendMail("[email protected]", "[email protected]", "Trade Alert", "Long strategy triggered on " + Instrument.MasterInstrument.Name + " in " + Bars.Period.Value + "-" + Bars.Period.Id + " time frame[B], at " +Time[0][/B]);
"at 01.01.1800 0:00:00"
Comment
-
Originally posted by NinjaTrader_PatrickH View PostHello cachevery,
Thank you for your patience.
Can you provide the indicator file so I may test this item on my end? Where are you testing the indicator? On what instrument, period and interval?
I can also provide insight on your two conditions as well.
Here is the indicator.I use it with kagi bars on FDAX futs 60 seconds.Attached Files
Comment
-
Hello cachevery,
Thank you for your response.
Where in the indicator's code did you place the SendMail() method? I am not looking for the syntax you are using at all, you have provided this several times already. I need to specifically know where you placed the SendMail() method in your indicator's code not what the SendMail() method looks like.
Alternatively you can provide the full indicator with the SendMail() in it so I can test on my end to see how you go the date of 01.01.1800 0:00:00.
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by DJ888, 04-16-2024, 06:09 PM
|
4 responses
12 views
0 likes
|
Last Post
by DJ888
Today, 04:28 PM
|
||
Started by terofs, Today, 04:18 PM
|
0 responses
7 views
0 likes
|
Last Post
by terofs
Today, 04:18 PM
|
||
Started by nandhumca, Today, 03:41 PM
|
0 responses
6 views
0 likes
|
Last Post
by nandhumca
Today, 03:41 PM
|
||
Started by The_Sec, Today, 03:37 PM
|
0 responses
3 views
0 likes
|
Last Post
by The_Sec
Today, 03:37 PM
|
||
Started by GwFutures1988, Today, 02:48 PM
|
1 response
9 views
0 likes
|
Last Post Today, 03:09 PM |
Comment