NexusFi: Find Your Edge


Home Menu

 





how to get data from backtest last day before ExitOnClose ?


Discussion in NinjaTrader

Updated
    1. trending_up 6,708 views
    2. thumb_up 2 thanks given
    3. group 3 followers
    1. forum 13 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
seanMen
tel aviv
 
Posts: 7 since Aug 2015
Thanks Given: 0
Thanks Received: 1

When i use backtest i export all actions to a .csv file. my problem is with the last day of backtest which i don't get any prints on that day
Example, i'm running a backtest from 1/1/13 until 10/8/15 and printing every enter to OnBarUpdate including every buy or sell order according to my strategy.
on the last trading day (7/8/15 on this case) i don't see any OnBarUpdate prints. just ExitOnClose price which dosent fit the real close price of that date.
I tried to prints from the function OnTermination but still, when printing the date i get 6/8/15.
does anyone have any idea how to get data from the last day on backtest (like close price)
thank you


Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Saylors 41-Month HODL Breaks: Strategy Sells 32 BTC as $ …
Prediction Markets & Event Contracts
Prediction Markets Lock Fed Pause at 99pct for April 29 …
Prediction Markets & Event Contracts
Five Days Until the Gap Dies -- CME Goes 24/7 on All Dig …
Traders Hideout
Prop Firm Tracked Payouts Hit $115M in Q1 but Growth Fla …
Funded Trading Evaluation Firms
Sundays Verdict: Lebanon Locked at 99.85% as Iran June 7 …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Sober Journey With S&P
24 thanks
2026 Jlab journal
10 thanks
Lady Vols Primer: Trading Volatility Journal
8 thanks
Algo automated / semi-automated trading anyone?
6 thanks
Trying to learn Volume and price action correlation
5 thanks
  #2 (permalink)
 choke35 
Germany
Market Wizard
 
Experience: Intermediate
Platform: Other
Trading: ES, YM, 6E
Posts: 2,622 since Feb 2013
Thanks Given: 5,101
Thanks Received: 6,558

A frequent error source is a wrong session template.
Did you already make sure that your session template is correct?


Reply With Quote
  #3 (permalink)
seanMen
tel aviv
 
Posts: 7 since Aug 2015
Thanks Given: 0
Thanks Received: 1


Sorry i don't think that i understand your meaning
which session template did you mean?
(if you meant, using the right strategy then yes, i did check that the right one is running)


Reply With Quote
  #4 (permalink)
 choke35 
Germany
Market Wizard
 
Experience: Intermediate
Platform: Other
Trading: ES, YM, 6E
Posts: 2,622 since Feb 2013
Thanks Given: 5,101
Thanks Received: 6,558


seanMen View Post
Sorry i don't think that i understand your meaning
which session template did you mean?
(if you meant, using the right strategy then yes, i did check that the right one is running)

NT instruments use session templates.
Data-Series-Window

If you don't use the original instrument setting (e.g. because of yourself trading from a different time zone), you will have to adjust the settings:
Creating-A-Session-Template


Reply With Quote
  #5 (permalink)
seanMen
tel aviv
 
Posts: 7 since Aug 2015
Thanks Given: 0
Thanks Received: 1

I'll give it a try
Thank you for your resopond


Reply With Quote
Thanked by:
  #6 (permalink)
seanMen
tel aviv
 
Posts: 7 since Aug 2015
Thanks Given: 0
Thanks Received: 1

Hi again
I tried to change the session , build a new template and saved but the ninja doesn't let me work with that template for some reason, anyway i'm downloading data from the data manager before backtesting so i don't think that this is the problem.
can you think of any other way that i'll be able to print the close price of the last backtesting day? (meaning, the day of ExitOn Close)


Reply With Quote
  #7 (permalink)
 choke35 
Germany
Market Wizard
 
Experience: Intermediate
Platform: Other
Trading: ES, YM, 6E
Posts: 2,622 since Feb 2013
Thanks Given: 5,101
Thanks Received: 6,558


seanMen View Post
Hi again
I tried to change the session , build a new template and saved but the ninja doesn't let me work with that template for some reason, anyway i'm downloading data from the data manager before backtesting so i don't think that this is the problem.
can you think of any other way that i'll be able to print the close price of the last backtesting day? (meaning, the day of ExitOn Close)

Strange.
Data manager aside, which real-time data do you use or do you only have free EOD data?


Reply With Quote
  #8 (permalink)
seanMen
tel aviv
 
Posts: 7 since Aug 2015
Thanks Given: 0
Thanks Received: 1

Im downloading free EOD data from yahoo finance via the Historical data manager


Reply With Quote
  #9 (permalink)
 choke35 
Germany
Market Wizard
 
Experience: Intermediate
Platform: Other
Trading: ES, YM, 6E
Posts: 2,622 since Feb 2013
Thanks Given: 5,101
Thanks Received: 6,558

Ok. Assumed that your strategy code works correctly, your problem presumably results from your data.
That can also cause the session template errors.

Are you just playing a little with the NT functions to learn about the program or do you already plan to develop anything "real"?


Reply With Quote
  #10 (permalink)
seanMen
tel aviv
 
Posts: 7 since Aug 2015
Thanks Given: 0
Thanks Received: 1


i ran real before but found too many bugs (for my strategy) within the NT therefore i started writing an external code to implement my strategy but still need to use the NT backtest
can you print the last day close price (same day as exitonclose) when running backtest from your NT ?


Reply With Quote




Last Updated on August 13, 2015


© 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