Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Make the strategy enter and exit positions at an specific time

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

    Make the strategy enter and exit positions at an specific time

    Hello,

    I was wondering if somebody knew how to make a system enter a long/short position (or do any other thing) at an specific time. For instance, I enable a system at 12:00 and I want it to enter a long position at 12:30 and then exit at 13:00.

    I am new to ninja trader and it´s driving me mad!

    Thank you in advance,

    Miguel

    #2
    miguel,

    First off, welcome to the forum!

    Here is a sample :

    Code:
                if (ToTime(Time[0]) >= ToTime(12, 30, 0) && ToTime(Time[0]) <= ToTime(12, 31, 0)
                {
                    EnterLong(DefaultQuantity, "");
                }
    
                if (ToTime(Time[0]) >= ToTime(13, 0, 0))
                {
                    ExitLong("", "");
                }
    I would suggest attending our webinar on Automated Strategy Development : http://www.ninjatrader.com/webinars

    We have a lot of resources for learning. If you email us at support at ninjatrader dot com we'd be happy to send them to you.
    Adam P.NinjaTrader Customer Service

    Comment


      #3
      Thank you very much.

      Miguel

      Comment


        #4
        Miguel,

        No problem. I just replied to your email as well.
        Adam P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by nissan200sx55, Yesterday, 06:25 AM
        2 responses
        14 views
        0 likes
        Last Post nissan200sx55  
        Started by fredericlebre, Today, 01:19 AM
        1 response
        14 views
        0 likes
        Last Post NinjaTrader_Erick  
        Started by NM_eFe, Yesterday, 05:15 PM
        1 response
        11 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by cmtjoancolmenero, 04-29-2024, 03:40 PM
        25 responses
        81 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by TraderIqbal, 10-20-2023, 10:12 AM
        3 responses
        123 views
        0 likes
        Last Post NinjaTrader_Clayton  
        Working...
        X