![]() |
This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com
|
|||||||
| Charting Support for NinjaTrader Advanced Charting. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Junior Member
Join Date: Jul 2008
Posts: 3
Thanks: 0
Thanked 0 times in 0 posts
|
I have already modified the PriceAlert Indicator as shown below. This added the SendMail feature to it, which forwards to my phone as an alert. I also want the alert to cancel after the first occurrence so I don't continue getting messages after it triggers. I believe I would use ResetAlert but I haven't gotten the script right. Can someone supply me with the line that I would add below to cancel the alert after it triggers? Thanks
if ((triggerOnGreaterThan && Input[0] >= price - (TickSize * 0.5)) || (!triggerOnGreaterThan && Input[0] <= price + (TickSize * 0.5))) { triggered = true; Alert(DateTime.Now.Millisecond.ToString(), Cbi.Priority.Medium, "Price level '" + price + "' hit!", Cbi.Core.InstallDir + @"\sounds\Alert4.wav", 0, Color.Yellow, Color.Black); SendMail ("support@ninjatrader.com", "steve@myemail.com", "KOS Buy Alert", "Set Buy Order"); } |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
|
Hi stressless,
ResetAlert() will make the alert active again. Using a value of 0 for Re-Arm after seconds means that it will only trigger once. It sounds like you need control mainly on the SendMail() command instead. You can add your own bool variable to this. Best may be a bool input so you could control send mail commands through the indicator properties. Declare in variables region: private bool doOnce; Add as a condition to your SendMail: Code:
if ((triggerOnGreaterThan && Input[0] >= price - (TickSize * 0.5)) || (!triggerOnGreaterThan && Input[0] <= price + (TickSize * 0.5)))
{
triggered = true;
Alert(DateTime.Now.Millisecond.ToString(), Cbi.Priority.Medium, "Price level '" + price + "' hit!", Cbi.Core.InstallDir + @"\sounds\Alert4.wav", 0, Color.Yellow, Color.Black);
if(doOnce)
{
SendMail ("support@ninjatrader.com", "steve@myemail.com", "KOS Buy Alert", "Set Buy Order");
doOnce = false;
}
}
Ryan M
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Senior Member
Join Date: Apr 2010
Posts: 147
Thanks: 21
Thanked 1 time in 1 post
|
Hi..
is it possible for someone to modify the price alert indy to include sendmail function? ![]() **how would you code smtpServer info in with the sendmail command? to send email with alert? ...(i do not want the system (MISC/OPTIONS.etc..) to send) smtp.XXX.com port587 no ssl acct username: xyz acct pw: ~~~
Last edited by mystiq; 07-29-2012 at 01:58 PM.
Reason: add info
|
|
|
|
|
|
#4 |
|
Senior Member
Join Date: Apr 2010
Posts: 147
Thanks: 21
Thanked 1 time in 1 post
|
can you post that modified price alert to the forum with the sendmail command?
|
|
|
|
|
|
#5 | |
|
Senior Member
Join Date: Apr 2010
Posts: 147
Thanks: 21
Thanked 1 time in 1 post
|
Quote:
what if your email settings are at DEFAULT? |
|
|
|
|
|
|
#6 |
|
NinjaTrader Customer Service
Join Date: Apr 2010
Location: Denver, CO, USA
Posts: 4,794
Thanks: 160
Thanked 568 times in 559 posts
|
Hello,
Yes SendMail() is all you need to send emails from the code when a condition is true. However the email settings it is using would need to be what is set from Tools--> Misc
Matthew
NinjaTrader Customer Service |
|
|
|
|
|
#7 |
|
Senior Member
Join Date: Apr 2010
Posts: 147
Thanks: 21
Thanked 1 time in 1 post
|
thanks but...u miss understand..i am using the default settings...so...is there any extra code needed to show smtpserver;port;acctinfo...etc..?
Last edited by mystiq; 07-29-2012 at 05:52 PM.
Reason: add info
|
|
|
|
|
|
#8 |
|
Senior Member
Join Date: Apr 2010
Posts: 147
Thanks: 21
Thanked 1 time in 1 post
|
is ninjatrader_ryan around?
|
|
|
|
|
|
#9 |
|
Senior Member
Join Date: Aug 2010
Location: Washington, D.C.
Posts: 1,194
Thanks: 180
Thanked 302 times in 260 posts
|
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| PriceAlert indicator error | JoshDance | Charting | 5 | 04-11-2011 10:17 AM |
| Modifying an indicator | alfa123 | Indicator Development | 1 | 02-15-2010 06:22 AM |
| Can anyone help with modifying this indicator? | maxreturn | Indicator Development | 1 | 07-12-2009 03:50 PM |
| Modifying Indicator Label | Mike Winfrey | Indicator Development | 1 | 09-03-2008 08:07 AM |
| Modifying NinjatraderPriceAction indicator | nico_p | Indicator Development | 1 | 03-30-2008 01:15 PM |