NexusFi: Find Your Edge


Home Menu

 





Implementing a delay after first SendMail execution, possible?


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one Big Mike with 4 posts (2 thanks)
    2. looks_two raindrop with 4 posts (0 thanks)
    3. looks_3 Blackburn with 3 posts (0 thanks)
    4. looks_4 Quick Summary with 1 posts (0 thanks)
    1. trending_up 5,325 views
    2. thumb_up 3 thanks given
    3. group 3 followers
    1. forum 13 posts
    2. attach_file 1 attachments




 
Search this Thread

Implementing a delay after first SendMail execution, possible?

  #11 (permalink)
 Blackburn 
Malchow (Meckl.)
 
Experience: Intermediate
Platform: NinjaTrader, TWS
Trading: Stocks
Posts: 17 since Mar 2011
Thanks Given: 15
Thanks Received: 0

I canīt receive emails.

I insert:
#region Variables
private DateTime lastEmailSent;
#endregion

and:
protected override void OnBarUpdate()

{
// Condition set 1
if (ToTime(Time[0]) >= 100000 && ToTime(Time[0]) <= 220000
&& WMA(Weighted, 20)[0] > WMA(Weighted, 50)[0]
&& Low[0] > WMA(Weighted, 20)[0]
&& WMA(Weighted, 20)[0] > WMA(Weighted, 20)[4]
&& Close[0] > Swing(5).SwingHigh[0])
{
if (DateTime.Now > lastEmailSent.AddMinutes(30))
{
SendMail("[email protected]", "[email protected]", "Buy LONG position", "Entry @ "+ Close[0] + ".");
lastEmailSent = DateTime.Now;
}
EnterLong(DefaultQuantity, "Long");
}

But I delete the code under "Properties":
#region Properties
[Description("")]
[GridCategory("Parameters")]
public int MyInput0
{
get { return myInput0; }
set { myInput0 = Math.Max(1, value); }
}
#endregion

Where is the error?
Thanks für your help.

Blackburn

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
ZombieSqueeze
Platforms and Indicators
Exit Strategy
NinjaTrader
Are there any eval firms that allow you to sink to your …
Traders Hideout
Ninja Mobile Trader VPS (ninjamobiletrader.com)
Trading Reviews and Vendors
 
  #12 (permalink)
 
MrYou's Avatar
 MrYou 
NC, USA
 
Experience: None
Platform: None Yet
Trading: Guitar
Posts: 403 since Jun 2011
Thanks Given: 618
Thanks Received: 196

You might try adding a set of parentheses for your first condition:

 
Code
if ((EMA(25)[0] > EMA(72)[0])
                && (DateTime.Now > lastEmailSent.AddMinutes(30))
Just a guess. Not sure if its valid for C#.

Reply With Quote
  #13 (permalink)
 Blackburn 
Malchow (Meckl.)
 
Experience: Intermediate
Platform: NinjaTrader, TWS
Trading: Stocks
Posts: 17 since Mar 2011
Thanks Given: 15
Thanks Received: 0


thanks for your answer.

how can I put the specific in my case? (The code above)

Blackburn

Reply With Quote
  #14 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,399 since Jun 2009
Thanks Given: 33,178
Thanks Received: 101,542


Blackburn View Post
I canīt receive emails.

Take out everything except the part that sends the email, do you get it then? If not, your ISP likely blocks port 25 and you'll need to reconfigure NinjaTrader options.

Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote




Last Updated on August 17, 2011


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts