Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Enter at a specific time?

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

    Enter at a specific time?

    Can a trade entry have a specific time? For example, enter long at 8:59:50 at 1041?

    To be exact - I would like to have the script enter a trade at 50 seconds into a certain time period. Not at the end of a close bar.

    Thank you

    #2
    Market orders trade almost immediately, so if you mean triggering a trade, sure, just add a conditional statement to your trade logic trigger that also checks the current time.

    You could use the C# .NET methods such as DateTime, but NT provides TimeTo() in the library...



    There's an time example in the reference samples section here on the forum.

    Comment


      #3
      rbrahy, it is definitely possible to do that. What you might want to look into is using a timer object to fire off events. You can check what the time is every OnBarUpdate() and then just calculate how long until your desired entry time and then have the timer fire that far away. It would also be helpful to look into DateTime objects and how to manipulate them.
      AustinNinjaTrader Customer Service

      Comment


        #4
        Perfect... Thank you for the information and resource. I appreciate it.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by futtrader, 04-21-2024, 01:50 AM
        4 responses
        41 views
        0 likes
        Last Post futtrader  
        Started by Option Whisperer, Today, 09:55 AM
        1 response
        11 views
        0 likes
        Last Post bltdavid  
        Started by port119, Today, 02:43 PM
        0 responses
        7 views
        0 likes
        Last Post port119
        by port119
         
        Started by Philippe56140, Today, 02:35 PM
        0 responses
        7 views
        0 likes
        Last Post Philippe56140  
        Started by 00nevest, Today, 02:27 PM
        0 responses
        7 views
        0 likes
        Last Post 00nevest  
        Working...
        X