Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
Implementing a delay after first SendMail execution, possible?
Hi,
I have implmented SendMail in one of the scripts and it works fine but some time it generates too many e-mail messages in a short period of time. I want to limit the number of e-mails that i can get. So i am thinking of a way where after the first email is sent, system would not send an email for next 30 minutes, just like rearm function of 'Alert' command.
I'd appreciate If anyother user of NinjaTrader has any tips about what commands can I use to code such a functionality. Following is my sample script:
{
// Condition set 1
if (EMA(25)[0] > EMA(72)[0])
{
// SendMail([email protected], "[email protected]", "Go Long GBP/CHF", "Buy GBP/CHF");
Log("Buy Alert GBP/CHF", LogLevel.Information);
}
Any cues will be helpful.
Thanks.
Can you help answer these questions from other members on NexusFi?
Thanks for taking your time responding to my message.
I believe Ninja Trader programming instruction set does not recognize the command "lastEmailSent" so I cannot use your solution.
I was thinking of using an integer variable which gets triggered / rearmed 30 minutes after the last 'SendMail' command line is executed. And a 'SendMail' command line is executed only when that integer variable is triggered/rearmed. But I just don't know how to code such instruction. I'd appreciate any help and guidance here.