• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Modifying PriceAlert Indicator

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

  • NinjaTrader_ChelseaB
    replied
    Hi tonynt,

    The PriceAlert indicator does require COBC false.

    This will be more CPU intensive than COBC true, however, this script does not have a lot of code and does not require much resources.

    I wouldn't expect this indicator to cause heavy CPU usage.

    Leave a comment:


  • tonynt
    replied
    Hello,

    question please: it seems that the pricealert indicator plots only with COBC=false. Right? But isn´t this CPU intensive (especially when having this on 12 charts?)

    Thank you.
    Tony

    Originally posted by NinjaTrader_RyanM View Post
    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 ("[email protected]", "[email protected]", "KOS Buy Alert", "Set Buy Order");
              doOnce = false;
         }
    }

    Leave a comment:


  • sledge
    replied
    Originally posted by mystiq View Post
    is ninjatrader_ryan around?

    did you set up tools->options ->misc?

    Leave a comment:


  • mystiq
    replied
    is ninjatrader_ryan around?

    Leave a comment:


  • mystiq
    replied
    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, 05:52 PM. Reason: add info

    Leave a comment:


  • NinjaTrader_Matthew
    replied
    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

    Leave a comment:


  • mystiq
    replied
    Originally posted by NinjaTrader_RyanM View Post
    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 ("[email protected]", "[email protected]", "KOS Buy Alert", "Set Buy Order");
              doOnce = false;
         }
    }
    is this the only code needed to rcv emails? using sendmail() with priceAlert?

    what if your email settings are at DEFAULT?

    Leave a comment:


  • mystiq
    replied
    can you post that modified price alert to the forum with the sendmail command?

    Leave a comment:


  • mystiq
    replied
    sendmail with price alert

    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, 01:58 PM. Reason: add info

    Leave a comment:


  • NinjaTrader_RyanM1
    replied
    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 ("[email protected]", "[email protected]", "KOS Buy Alert", "Set Buy Order");
              doOnce = false;
         }
    }

    Leave a comment:


  • stressless
    started a topic Modifying PriceAlert Indicator

    Modifying PriceAlert Indicator

    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 ("[email protected]", "[email protected]", "KOS Buy Alert", "Set Buy Order");
    }

Latest Posts

Collapse

Topics Statistics Last Post
Started by MartinT, Yesterday, 01:12 PM
1 response
11 views
0 likes
Last Post NinjaTrader_Kate  
Started by GLFX005, Today, 12:22 PM
0 responses
4 views
0 likes
Last Post GLFX005
by GLFX005
 
Started by caveat_lector, Today, 11:58 AM
1 response
2 views
0 likes
Last Post NinjaTrader_Heath  
Started by Bionian, Today, 11:43 AM
1 response
6 views
0 likes
Last Post NinjaTrader_Kate  
Started by Abdullah_KSA, Today, 10:54 AM
3 responses
9 views
0 likes
Last Post NinjaTrader_PaulH  
Working...
X