Go Back   NinjaTrader Support Forum > Historical Beta Archive > Version 8 Beta

Version 8 Beta Historical archive for NinjaTrader 8 beta.

NinjaTrader
Reply
 
Thread Tools Display Modes
Old 06-09-2016, 06:52 AM   #1
bergimax
Member
 
Join Date: Jan 2013
Location: Brescia
Posts: 87
Thanks: 33
Thanked 5 times in 4 posts
Default Load cumulative profit

Hi,

i would like to know if is it possible charge the cumulative profit of X trade ago, when i enable the strategy.

If is not possible, there is a solution can give me the possibility to reboot the PC or NT without loss data that strategy have in this moment?

Thank's in advance,
Bergimax
bergimax is offline  
Reply With Quote
Old 06-09-2016, 07:55 AM   #2
NinjaTrader_ChelseaB
NinjaTrader Customer Service
 
NinjaTrader_ChelseaB's Avatar
 
Join Date: Dec 2012
Location: Denver, CO
Posts: 6,692
Thanks: 111
Thanked 1,423 times in 1,350 posts
Default

Hello Bergimax,

When a strategy is restarted, the script will process all of the historical data. Depending on your settings, the script either not try and match any previous made orders (Wait until flat before executing live), or will attempt to resume and try and match previously made orders (Immediately submit live working historical orders).

If the settings are setup to resume and match the previously made orders, when orders are matched, these will still show in the real-time strategy performance (as these orders were made in real-time).

(edit)
NinjaTrader can try and resume your strategies when you restart them.
To do this, you will need to enable the following option before starting a new instance of a strategy:
  • Click Tools -> Options... -> select the Strategies tab -> select the NinjaScript sub-tab
  • Select the radio button option Immediately submit live working historical orders -> Click OK
    (Also, I would suggest unchecking the cancellation of exit orders when a strategy is disabled so that any open position that has a working exit continues using this already working exit after the strategy is disabled. The strategy will not be able to submit new exits while disabled or disconnected.)
  • When starting a new instance of the strategy set the Sync account position parameter to True
  • After running your strategy, be sure to save your workspace when you shutdown NinjaTrader

Below is a link to the help guide on Syncing Account Positions. Please see the section 'Immediately submit live working historical orders, Sync account position = true'
http://www.ninjatrader.com/support/h..._positions.htm

With these options the following will happen when the strategy resumes. (From the help guide):
  • Any active orders on the account previously generated by the strategy that does not match* an active strategy order will be cancelled. Should the strategy be unable to cancel and receive confirmation on the cancellation of these orders within 40 seconds the strategy will not start and an alert will be issued.
  • A previously generated order is considered to match an active strategy order when the order action, order type, quantity, limit price, and stop price are exactly identical.
  • The matching active orders on the account will then be mapped to the active strategy orders
  • Any remaining active strategy orders that cannot be successfully paired will be submitted live and the strategy will then try to sync your Account Position to your Strategy Position through the process below.

As mentioned in the help guide, if the historical orders do not match realtime orders made previously they are cancelled. If you want to ensure that your strategy resumes the previously placed orders with the 'Immediately submit live working historical orders, Sync account position = true' setup, you will need to ensure that the historical trades match the real time trades.

Adding intra-bar granularity can help with this.

Below is a link to the help guide on Syncing Account Positions.
http://www.ninjatrader.com/support/h..._positions.htm

When in historical data, only the Open, High, Low, an Close will be available and there will be no intra-bar data. Intra-bar granularity adds a second data series such as a 1 tick series so that the strategy has finer granularity in the historical data in between the OHLC of the primary series. This allows for more accurate trades.

Below is a link to an official reference sample that demonstrates how to add intra-bar granularity.
http://www.ninjatrader.com/support/f...ead.php?t=6652

Also, here is a link to the differences on real-time vs backtest (historical).
http://www.ninjatrader.com/support/h...ime_vs_bac.htm

As well as a link to the help guide on the Add() method.
http://www.ninjatrader.com/support/h...s/nt7/add3.htm

A link to the help guide on BarsInProgress.
http://www.ninjatrader.com/support/h...inprogress.htm

And a link to the help guide on Multi-Time Frame & Instruments. Please see the section 'How Bar Data is Referenced', and 'Accessing the Price Data in a Multi-Bars NinjaScript'.
http://www.ninjatrader.com/support/h...nstruments.htm
Last edited by NinjaTrader_ChelseaB; 02-19-2017 at 02:34 PM.
NinjaTrader_ChelseaB is offline  
Reply With Quote
Old 06-14-2016, 10:41 AM   #3
bergimax
Member
 
Join Date: Jan 2013
Location: Brescia
Posts: 87
Thanks: 33
Thanked 5 times in 4 posts
Default

Thank's for the replay, ChelseaB!

After your answer, new questions have arisen in me.
1_Is it possible run backtest from strategy tab in the control center, without go in the strategy analyzer?
2_if not, can backtest result are used from another strategy that work in live?

Thank's,
Bergimax
bergimax is offline  
Reply With Quote
Old 06-14-2016, 10:58 AM   #4
NinjaTrader_ChelseaB
NinjaTrader Customer Service
 
NinjaTrader_ChelseaB's Avatar
 
Join Date: Dec 2012
Location: Denver, CO
Posts: 6,692
Thanks: 111
Thanked 1,423 times in 1,350 posts
Default

Hi Bergimax,

Yes, when a strategy is added to the Strategies tab of the Control Center, it will still process historical data first and then will begin running in real-time. The historical strategy performance is the same as a backtest in the Strategy Analyzer.
NinjaTrader_ChelseaB is offline  
Reply With Quote
The following user says thank you to NinjaTrader_ChelseaB for this post:
Old 03-14-2017, 10:35 AM   #5
NinjaTrader_ChelseaB
NinjaTrader Customer Service
 
NinjaTrader_ChelseaB's Avatar
 
Join Date: Dec 2012
Location: Denver, CO
Posts: 6,692
Thanks: 111
Thanked 1,423 times in 1,350 posts
Default

Hello,

I've updated the links to the NinjaTrader 8 help guide.

When a strategy is restarted, the script will process all of the historical data. Depending on your settings, the script will either not try and match any previous made orders (Wait until flat), or will attempt to resume and try and match previously made orders (Immediately submit).

If the settings are setup to resume and match the previously made orders, when orders are matched, these will still show in the real-time strategy performance (as these orders were made in real-time).

NinjaTrader can try and resume your strategies when you restart them.
To do this, you will need to enable the following option before starting a new instance of a strategy:
  • Right-click the chart and select Strategies or right-click the Strategies tab of the Control Center and select New Strategy...
  • Select the strategy from the Available list (in the Chart Strategies window click the New button to add an instance of the strategy)
  • In the parameters on the right, set 'Start behavior' to 'Immediately submit, synchronize account' (or 'Immediately submit')
  • After running your strategy, be sure to save your workspace when you shutdown NinjaTrader
Below is a link to the help guide on Syncing Account Positions. Please see the section 'Immediately submit, synchronize account'
http://ninjatrader.com/support/helpG...hronizeAccount

With these options the following will happen when the strategy resumes. (From the help guide on Immediately submit, synchronize account):

This combination should be used when you want to begin trading your strategy off a flat state with minimal user interaction to sync your Account Position prior to start.
  • When your strategy starts it will check for any active orders previously generated by the strategy on your account. Any active orders on the account previously generated by the strategy that does not match* an active strategy order will be cancelled. Should the strategy be unable to cancel and receive confirmation on the cancellation of these orders within 40 seconds the strategy will not start and an alert will be issued.
  • The matching active orders on the account will then be mapped to the active strategy orders. These orders will be resumed properly.
    After the strategy is successful in cancelling any orders necessary, any remaining active strategy orders that cannot be successfully paired will be submitted live and the strategy will then try to sync your Account Position to your Strategy Position. On multi-instrument strategies it will perform this check for all instruments used by the strategy.

  • If the Account Position matches your Strategy Position, no reconciliatory order will be submitted. The strategy will then begin managing your Strategy Position immediately.
  • If the Account Position does not match your Strategy Position, NinjaTrader will submit a market order(s) to reconcile the Account Position to match your Strategy Position. The strategy will then begin managing your Strategy Position immediately.

    * A previously generated order is considered to match an active strategy order when the order action, order type, quantity, limit price, and stop price are exactly identical.
As mentioned in the help guide, if the historical orders do not match real-time orders made previously they are cancelled.
If you want to ensure that your strategy resumes the previously placed orders with the 'Immediately submit, synchronize account' setup, you will need to ensure that the historical trades match the real time trades.

Adding intra-bar granularity can help with this.

Below is a link to the help guide on Syncing Account Positions.
http://ninjatrader.com/support/helpG..._positions.htm

When in historical data, only the Open, High, Low, an Close will be available and there will be no intra-bar data. Intra-bar granularity adds a second data series such as a 1 tick series so that the strategy has finer granularity in the historical data in between the OHLC of the primary series. This allows for more accurate trades.

Below is a link to an official reference sample that demonstrates how to add intra-bar granularity.
http://www.ninjatrader.com/support/f...ead.php?t=6652

Also, here is a link to the differences on real-time vs backtest (historical).
http://ninjatrader.com/support/helpG...ime_vs_bac.htm

As well as a link to the help guide on the AddDataSeries() method.
http://ninjatrader.com/support/helpG...dataseries.htm

A link to the help guide on BarsInProgress.
http://ninjatrader.com/support/helpG...inprogress.htm

And a link to the help guide on Multi-Time Frame & Instruments. Please see the section 'How Bar Data is Referenced', and 'Accessing the Price Data in a Multi-Bars NinjaScript'.
http://ninjatrader.com/support/helpG...nstruments.htm
Last edited by NinjaTrader_ChelseaB; 03-14-2017 at 10:46 AM.
NinjaTrader_ChelseaB is offline  
Reply With Quote
The following user says thank you to NinjaTrader_ChelseaB for this post:
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Cumulative Profit robje737 Platform Technical Support 3 01-16-2015 10:22 AM
cumulative profit versus total net profit Ironplates Platform Technical Support 10 03-11-2013 06:05 PM
Higher Net Profit with Lower Cumulative Profit usuallywin Platform Technical Support 5 08-20-2012 09:48 PM
Total Net Profit != Cumulative Profit? Quant Platform Technical Support 3 12-22-2011 04:11 PM
Total Net Profit != Cumulative Profit? tjendra Strategy Development 22 03-04-2011 09:07 AM


All times are GMT -6. The time now is 04:18 AM.

Futures, foreign currency and options trading contains substantial risk and is not for every investor. An investor could potentially lose all or more than the initial investment. Risk capital is money that can be lost without jeopardizing ones financial security or lifestyle. Only risk capital should be used for trading and only those with sufficient risk capital should consider trading. Past performance is not necessarily indicative of future results. View Full Risk Disclosure.

CFTC Rules 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.

This website is hosted and operated by NinjaTrader, LLC (“NT”), a software development company which owns and supports all proprietary technology relating to and including the NinjaTrader trading platform. NT is an affiliated company to NinjaTrader Brokerage (“NTB”), which is a NFA registered introducing broker (NFA #0339976) providing brokerage services to traders of futures and foreign exchange products. This website is intended for educational and informational purposes only and should not be viewed as a solicitation or recommendation of any product, service or trading strategy. No offer or solicitation to buy or sell securities, securities derivative or futures products of any kind, or any type of trading or investment advice, recommendation or strategy, is made, given, or in any manner endorsed by any NT affiliate and the information made available on this Web site is not an offer or solicitation of any kind. Specific questions related to a brokerage account should be sent to your broker directly. The content and opinions expressed on this website are those of the authors and do not necessarily reflect the official policy or position of NT or any of its affiliates. 

Vendors along with their websites, products and services, collectively referred to as (“Vendor Content”), are independent persons or companies that are in no manner affiliated with NT or any if its affiliates. NT or any of its affiliates are not responsible for, do not approve, recommend or endorse any Vendor Content referenced on this website and it’s your sole responsibility to evaluate Vendor Content. Please be aware that any performance information provided by a vendor should be considered hypothetical and must contain the disclosures required by NFA Rule 2-29(c). If you are interested in learning more about, or investigating the quality of, any such Vendor Content you must contact the vendor, provider or seller of such Vendor Content. No person employed by, or associated with, NT or any of its affiliates is authorized to provide any information about any such Vendor Content. Visit the CFTC resources for education regarding the industry and signs of fraud.