NexusFi: Find Your Edge


Home Menu

 





How to backtest the strategy on specific trading time in ninjatrader?


Discussion in NinjaTrader

Updated
    1. trending_up 4,676 views
    2. thumb_up 0 thanks given
    3. group 2 followers
    1. forum 2 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
 owen 
CT
 
Experience: Beginner
Platform: NinjaTrader, TradeStation
Posts: 13 since Aug 2009
Thanks Given: 0
Thanks Received: 6

Everyday, I only trade 2 hours. I would like to backtest some strategy only in this two hours everyday. Who can tell me how to setup this time period in ninjatrader?

I also would like to backtest some strategy in specific day each week. Like I only want to backtest the strategy on each Monday. How to do that?

Thanks


Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Irans Answer Due Today: Peace Surges to 33.5%, Invasion …
Prediction Markets & Event Contracts
Hormuz Surges From 14% to 26.5% Intraday as Irans Answer …
Prediction Markets & Event Contracts
The June 15 Resolution Trap: Irans Agreed Text Still Pri …
Prediction Markets & Event Contracts
Penalties in Budapest, Peace Deadline in Tehran: Arsenal …
Prediction Markets & Event Contracts
Peace Deal Forward Curve: May 22%, June 51%, December 81 …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
NexusFi site changelog and issues/problem reporting
8 thanks
Darmok and Jalad at Tanagra
1 thanks
  #3 (permalink)
 
aslan's Avatar
 aslan 
Madison, WI
Market Wizard
 
Experience: Advanced
Platform: ALT
Trading: ES
Posts: 624 since Jan 2010
Thanks Given: 356
Thanks Received: 1,129


You can put some code at the beginning of your strategy to do something like this:

 
Code
int time = ToTime(Time[0]);
if (time >= 83000 && time <= 103000) {
    // do your thing
}
Make sure you close an open position at the end of your timeframe as well.

Another interesting item in NT, is the "distribution" graph in the performance report, as it shows a distribution of the trades by hour of day. This can be very enlightening.


Reply With Quote




Last Updated on March 21, 2010


© 2026 NexusFi®, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Downloads - Top
no new posts