top of page

Don’t Trade On Holidays NinjaTrader function

We are adding the Dont Trade On Holidays function to our NinjaTrader strategies. We have already done this for Tradestation and MultiCharts and you can read about it here.

The latest DontTradeOnHolidays file has been updated for the current holiday through January 2, 2021.

You can download the Example NinjaScript here and the Holidays.txt file here.

This Example NinjaScript shows you how to add this Holiday function class to your files.

You will need to put the Holidays.txt file in the C:UsersYourNameDocuments or in general your Documents folder (since some use different drives or formats).

You will need to update the Holidays.txt file and add dates going forward. It is updated through January 2, 2021 for the upcoming holiday weekends in 2020 including New Years 2021. We do not trade the portfolios when the stock market is closed or closes early (on day trade strategies but keep swing positions open). The futures can still trade on stock market holidays for a brief session. It is difficult to manage systems around different early closes, so we backtest without these days and do not trade them going forward.

Additional open code examples to set this up in NinjaTrader can be found in our Crude Oil After Hours and Crude Oil Weekly Inventories trading system from our membership site at https://algorithmictradingsystems.com

Comments


EXCLUSIVE MARKET AND STRATEGY UPDATES

 Capstone Trading Systems © 2025. All Rights Reserved.

U.S. Government Required Disclaimer - Commodity Futures Trading Commission. Futures and options trading has large potential rewards, but also large potential risk. You must be aware of the risks and be willing to accept them in order to invest in the futures and options markets. Don't trade with money you can't afford to lose. This website is neither a solicitation nor an offer to Buy/Sell futures or options. No representation is being made that any account will or is likely to achieve profits or losses similar to those discussed on this website. The past performance of any trading system or methodology is not necessarily indicative of future results.

CFTC RULE 4.41 - HYPOTHETICAL OR SIMULATED PERFORMANCE RESULTS HAVE CERTAIN LIMITATIONS. UNLIKE AN ACTUAL PERFORMANCE RECORD, SIMULATED RESULTS DO NOT REPRESENT ACTUAL TRADING. ALSO, SINCE THE TRADES HAVE NOT BEEN EXECUTED, THE RESULTS MAY HAVE UNDER-OR-OVER COMPENSATED FOR THE IMPACT, IF ANY, OF CERTAIN MARKET FACTORS, SUCH AS LACK OF LIQUIDITY, SIMULATED TRADING PROGRAMS IN GENERAL ARE ALSO SUBJECT TO THE FACT THAT THEY ARE DESIGNED WITH THE BENEFIT OF HINDSIGHT. NO REPRESENTATION IS BEING MADE THAT ANY ACCOUNT WILL OR IS LIKELY TO ACHIEVE PROFIT OR LOSSES SIMILAR TO THOSE SHOWN.

bottom of page