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

Automating Trading Stop for Economic Reports

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

    Automating Trading Stop for Economic Reports

    This question is also for NT7 strategy development for automated strategies.

    If you have an automated futures trading strategy for either NT7 or NT8, is there any way to include some type of trading halt for economic reports?

    Can it be coded into the NinjaScript for the strategy to be automated? My guess is no, and the only way to handle is to manually turn off the strategy prior to those reports.

    Thanks
    -EC_Chris-
    NinjaTrader Ecosystem Vendor - Emergent Cybernetics

    #2
    Hello,

    Thank you for the post.

    For NT7 there is not really anything built in that would be advisable to use for this purpose, you would just need to add logic to the script to halt for that time period.

    In NT8, you could potentially define that time as a holiday to prevent the script from running during that time. https://ninjatrader.com/support/help...radingHolidays

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Ok, that was my understanding.

      Regarding NT7, by you saying "add logic to the script to halt for that time period." The only way to do that would be to put a time frame in, say 7:15-7:30 where the strategy wouldn't trade. But that would mean, every day it wouldn't trade everyday in that time frame.

      Can specific dates be chosen to not trade during that timeframe? For example, let's say we want to chose the first Friday of every month to not trade in that time frame. Essentially you would have to code in every date for the year and re-code that date each year for the code. Is something like that even possible? It seems challenging, just wanting to confirm my assumptions.

      Thanks!
      -EC_Chris-
      NinjaTrader Ecosystem Vendor - Emergent Cybernetics

      Comment


        #4
        Hello,

        Yes, you would be working with the standard time object which is a C# DateTime object that contains both a time and date. You would need to make the logic how you would want it to work, so if it was only one day you would need both a time and date filter for that.
        There are some convenience methods to convert the time and date to ints to make them easier to compare or input.




        Using the Time[0] object you could create a time filter that uses both a time and date.

        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by nandhumca, Today, 03:41 PM
        0 responses
        4 views
        0 likes
        Last Post nandhumca  
        Started by The_Sec, Today, 03:37 PM
        0 responses
        3 views
        0 likes
        Last Post The_Sec
        by The_Sec
         
        Started by GwFutures1988, Today, 02:48 PM
        1 response
        5 views
        0 likes
        Last Post NinjaTrader_Clayton  
        Started by ScottWalsh, 04-16-2024, 04:29 PM
        6 responses
        33 views
        0 likes
        Last Post ScottWalsh  
        Started by frankthearm, Today, 09:08 AM
        10 responses
        36 views
        0 likes
        Last Post frankthearm  
        Working...
        X