If you're testing on the weekend (or when your instrument would be closed) be sure to change the session template to something that would be open (such as default 24/7)
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Cumulitive Profit not changing..
Collapse
X
-
For testing strategies in real time the simulated connection works great. It doesn't resemble live market data but lets you control and manipulate the markets: http://www.ninjatrader.com/support/h...connection.htm
If you're testing on the weekend (or when your instrument would be closed) be sure to change the session template to something that would be open (such as default 24/7)LanceNinjaTrader Customer Service
-
Lance, I figured why the #'s were off. The output for example would read -.72 and the strategy analyzer window would read -146. I guess you have to multiply by the # of shares(in my case 200 shares). Then the the last digit being 2 less I guess is just commission.
Still having the issue with the orders not closing out at end of day when backtesting, it's something to do with this line...
// If our Long Limit order is still active we will need to cancel it.
{
CancelOrder(entryOrder);
}
What exactly does this mean, it says "if order is still active", does this mean that it's still flat but it's been activated and the fill order is pending?
if so do I need to put some sort of IF condiition before it such as...
if (order.OrderState == OrderState.PendingSubmit)
or
if (entryOrder != null)Last edited by zachj; 11-03-2013, 06:01 PM.
Comment
-
If you want the orders to close out at the end of the session you can set ExitOnClose = true; http://www.ninjatrader.com/support/h...xitonclose.htm
If you want it to be a custom exit time you would want to create your own exit/flatten routine.
Example pseudo code:
Code:if(its the exit time) { if(myIOrder != null) CancelOrder(myIOrder); //will also want to set the order to null (typically this is done in OnOrderUpdate() ) }LanceNinjaTrader Customer Service
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
601 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
347 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
103 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
559 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
558 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment