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

How to check if the current trading date

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

    How to check if the current trading date

    I want to run a check with my strategy. I want to make an if statement that checks to see if today's date is later than 1/20/2022, if so return true, else, false and disable strategy.

    Could you help me with this?
    Optimum Algo
    NinjaTrader Ecosystem Vendor - Optimum Algo

    #2
    Hello digo098,

    Code:
    if (Core.Globals.Now >= new DateTime(2022, 1, 20))
    {
    }
    else
    {
    CloseStrategy();
    }
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by WalterSkinner, Today, 04:40 PM
    0 responses
    6 views
    0 likes
    Last Post WalterSkinner  
    Started by jvanelli, Today, 04:08 PM
    1 response
    11 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by eleven, Today, 04:05 PM
    0 responses
    5 views
    0 likes
    Last Post eleven
    by eleven
     
    Started by space_trader, 05-15-2022, 08:14 AM
    4 responses
    25 views
    0 likes
    Last Post Tasker-182  
    Started by parkinsonbr, Yesterday, 05:06 PM
    1 response
    10 views
    0 likes
    Last Post NinjaTrader_ChrisL  
    Working...
    X