• 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

DayofWeek example from NT Help does not compile

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

  • Kel108
    replied
    Turns out I needed to include the (int) type conversion which support provided me in another forum post.

    This now works:

    if ((int)Time[0].DayOfWeek == dayOfWeek)return;


    I specify the dayOfWeek as a private integer variable
    Thanks so much!

    Leave a comment:


  • NinjaTrader_AdamP
    replied
    Kel108,

    Could you post more of your code? I suspect there is something wrong elsewhere.

    Leave a comment:


  • Kel108
    started a topic DayofWeek example from NT Help does not compile

    DayofWeek example from NT Help does not compile

    I put the following example found in nt help in my ninjascript onbarupdate() section

    // If it's Monday, do not trade.
    if (Time[0].DayOfWeek == DayOfWeek.Monday)
    return;


    and I get the following compilation error

    'int' does not contain a definition for 'Monday' and no extension method 'Monday' accepting a first argument of type 'int' could be found (are you missing a using directive or an assembly reference?)


    basically I don't want to execute my system if it's monday.

    any suggestions?
    Last edited by Kel108; 05-20-2012, 02:43 PM.

Latest Posts

Collapse

Topics Statistics Last Post
Started by Rastus, Today, 10:27 PM
0 responses
3 views
0 likes
Last Post Rastus
by Rastus
 
Started by kloiuyvcp, Today, 09:54 PM
0 responses
3 views
0 likes
Last Post kloiuyvcp  
Started by WNorton, Today, 06:53 PM
0 responses
11 views
0 likes
Last Post WNorton
by WNorton
 
Started by Jorge.andres.o, Today, 03:44 PM
1 response
18 views
0 likes
Last Post bltdavid  
Started by r3n3v, Today, 06:30 PM
1 response
6 views
0 likes
Last Post r3n3v
by r3n3v
 
Working...
X