Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Time

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

    Time

    if (ToTime(Time[0]) > 100000 );
    {

    if ( CrossAbove(SMA(Fast), SMA(Slow), 1))
    EnterLong();
    else if (CrossBelow(SMA(Fast), SMA(Slow), 1))
    EnterShort();
    }




    Why does this not enter after 10am. only?

    #2
    neb1998,

    I am happy to assist you.

    Please try : ToTime(Time[0]) > ToTime(10,0,0)

    Also, you may want to bracket your trading times, i.e.

    If ( ToTime(Time[0]) > ToTime(10,0,0) && ToTime(Time[0]) < ToTime(18,0,0) )
    Adam P.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by neb1998 View Post
      if (ToTime(Time[0]) > 100000 );
      {

      if ( CrossAbove(SMA(Fast), SMA(Slow), 1))
      EnterLong();
      else if (CrossBelow(SMA(Fast), SMA(Slow), 1))
      EnterShort();
      }




      Why does this not enter after 10am. only?
      there is coding error. you got to remove the ;

      Comment


        #4
        perfect, didnt see that semi colon.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by argusthome, Yesterday, 10:06 AM
        0 responses
        18 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        17 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        14 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        9 views
        0 likes
        Last Post TheRealMorford  
        Started by Mindset, 02-28-2026, 06:16 AM
        0 responses
        38 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Working...
        X