• 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, 01:43 PM.

Latest Posts

Collapse

Topics Statistics Last Post
Started by gbulle, Today, 11:31 AM
0 responses
1 view
0 likes
Last Post gbulle
by gbulle
 
Started by JPPoulin, Today, 10:43 AM
1 response
10 views
0 likes
Last Post NinjaTrader_ChrisL  
Started by explorer101, Today, 10:45 AM
1 response
8 views
0 likes
Last Post NinjaTrader_ChelseaB  
Started by caveat_lector, Today, 10:22 AM
2 responses
6 views
0 likes
Last Post caveat_lector  
Started by itrader46, Today, 10:24 AM
4 responses
14 views
0 likes
Last Post itrader46  
Working...
X