Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy conditions at specific days in the month

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

    Strategy conditions at specific days in the month

    Hello guys,

    how do you create conditions for execute a strategy at specific days at the month?

    For example, I want an entry at the 8th day in the month and exit at the 3rd day in the month.

    Is it only possible via NinjaScript and what‘s the best way to do this?

    Thank you!



    #2
    Hello andi5385,

    You can compare a <DateTime>.Day to a specific number.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hi Chelsea,

      thank you for your reply. How is it possible in the condition builder?

      Thank you!
      Andreas

      Comment


        #4
        Hi andi5385,
        To my understanding, this can not be done with the StrategyBuilder. At least, I'm not aware that my suggestion I posted here ever took flight.

        Somewhat strange that "Day of week" is available in Strategy Builder, but "Day of month", "Day of year" or "Month" are (still) not exposed?
        Unless this was fixed, you will have to use NinjaScript to detect a new month, if true, reset the TradingDay counter, increment by one on every other new day, compare the value of the counter with your entry (e.g. 8) and exit input (e.g. 3) and then place/terminate your trades accordingly. The counter itself could be built as follows in NinjaScript:
        if (Time[0].Date.Month != Time[1].Date.Month)
        {
        tradingDay = 1;
        }
        else
        {
        tradingDay++;
        }
        NT-Roland

        Comment


          #5
          Hello Andreas,

          Just confirm, NT-Roland is correct. The Day (of month) is not available in the Strategy Builder and this would require unlocking the script and coding by hand.
          Chelsea B.NinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by NullPointStrategies, Yesterday, 05:17 AM
          0 responses
          57 views
          0 likes
          Last Post NullPointStrategies  
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          133 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          73 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          45 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          50 views
          0 likes
          Last Post TheRealMorford  
          Working...
          X