NexusFi: Find Your Edge


Home Menu

 





how to get data from backtest last day before ExitOnClose ?


Discussion in NinjaTrader

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




 
Search this Thread

how to get data from backtest last day before ExitOnClose ?

  #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?
Better Renko Gaps
The Elite Circle
Futures True Range Report
The Elite Circle
Are there any eval firms that allow you to sink to your …
Traders Hideout
Deepmoney LLM
Elite Quantitative GenAI/LLM
My NT8 Volume Profile Split by Asian/Euro/Open
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
61 thanks
Funded Trader platforms
39 thanks
Battlestations: Show us your trading desks!
26 thanks
NexusFi site changelog and issues/problem reporting
25 thanks
The Program
17 thanks
  #2 (permalink)
 choke35 
Germany
 
Experience: Intermediate
Platform: Other
Trading: ES, YM, 6E
Posts: 2,668 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
 
Experience: Intermediate
Platform: Other
Trading: ES, YM, 6E
Posts: 2,668 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
 
Experience: Intermediate
Platform: Other
Trading: ES, YM, 6E
Posts: 2,668 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
 
Experience: Intermediate
Platform: Other
Trading: ES, YM, 6E
Posts: 2,668 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


© 2024 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 - Privacy Policy - Downloads - Top
no new posts